Private Bin MCP服务器
用于安全加密共享的模型上下文协议(MCP)服务器 私人垃圾箱该服务器使AI助手能够创建和检索加密的共享,同时保持强大的安全边界。
🔒 安全特性
- 服务器URL控制:PrivateBin服务器URL是通过环境变量配置的,不能被AI代理覆盖(防止数据泄露)
- 隐藏密码:默认密码存储在环境变量中,LLM不可见
- 基于文件的解密:解密的内容会写入文件,而不会返回给代理(使敏感数据对LLM隐藏)
- 端到端加密:所有内容在发送到服务器之前都在本地加密
安装
使用uvx(推荐)
uvx privatebin-mcp使用pip
pip install privatebin-mcp来源
git clone https://github.com/aaronsteers/privatebin-mcp.git
cd privatebin-mcp
uv sync配置
所需的环境变量
创建一个 .env 文件或设置这些环境变量:
# Required: PrivateBin server URL
PRIVATEBIN_SERVER_URL=https://privatebin.net
# Optional: Default passcode for additional security
PRIVATEBIN_DEFAULT_PASSCODE=your-secret-passcodeMCP客户端配置
将此服务器添加到您的MCP客户端配置中(例如,Claude Desktop、Devin):
{
"mcpServers": {
"privatebin": {
"command": "uvx",
"args": ["privatebin-mcp"],
"env": {
"PRIVATEBIN_SERVER_URL": "https://privatebin.net",
"PRIVATEBIN_DEFAULT_PASSCODE": "optional-default-passcode"
}
}
}
}或者,如果从源代码安装:
{
"mcpServers": {
"privatebin": {
"command": "uv",
"args": ["run", "privatebin-mcp"],
"cwd": "/path/to/privatebin-mcp",
"env": {
"PRIVATEBIN_SERVER_URL": "https://privatebin.net",
"PRIVATEBIN_DEFAULT_PASSCODE": "optional-default-passcode"
}
}
}
}可用工具
1. create_encrypted_share_from_string
从字符串内容创建并发布加密粘贴。
参数:
content(字符串,必填):要加密和共享的文本内容format(字符串,可选):格式类型-plaintext,syntaxhighlighting,或markdown(默认值:plaintext)expiration(字符串,可选):到期时间-5min,10min,1hour,1day,1week,1month,1year,或never(默认值:1week)burn_after_reading(布尔值,可选):首次查看后删除(默认值:false)enable_discussion(布尔值,可选):启用注释(默认值:false)passcode(字符串,可选):附加密码保护(回退到PRIVATEBIN_DEFAULT_PASSCODE)
退货: 带加密密钥的完整私人箱URL
例子:
# AI assistant creates an encrypted share
url = create_encrypted_share_from_string(
content="Secret information here",
format="markdown",
expiration="1day",
burn_after_reading=True,
passcode="optional-extra-security"
)
# Returns: https://privatebin.net/?abc123#encryptionkey2. create_encrypted_share_from_file
从文件内容创建并发布加密粘贴。
参数:
file_path(字符串,必填):要加密和共享的文件路径- 与相同的可选参数
create_encrypted_share_from_string
退货: 带加密密钥的完整私人箱URL
例子:
# AI assistant shares a file
url = create_encrypted_share_from_file(
file_path="/path/to/document.txt",
format="plaintext",
expiration="1week"
)3. save_decrypted_share_to_file
检索并解密PrivateBin共享,将其保存到文件中。
参数:
url(字符串,必填):完整的PrivateBin URL(带片段)output_path(string,必填):保存解密内容的路径passcode(string,可选):共享受保护时的密码(回退到PRIVATEBIN_DEFAULT_PASSCODE)
退货: 带有文件路径的成功消息(不包括解密内容)
例子:
# AI assistant retrieves and saves a share
result = save_decrypted_share_to_file(
url="https://privatebin.net/?abc123#encryptionkey",
output_path="/path/to/output.txt",
passcode="optional-passcode"
)
# Returns: "Successfully saved decrypted content to: /path/to/output.txt (1234 characters)"
# Note: The actual content is NOT returned to the AI - only written to the file用例
1.安全的信息共享
AI助手可以创建敏感信息的加密共享,而数据在对话中不可见:
User: "Share this API key securely: sk-abc123..."
AI: Creates encrypted share with burn_after_reading=True
Returns URL to user
API key never appears in conversation history2.临时代码段
共享自动过期的代码片段:
AI: Creates share with format="syntaxhighlighting", expiration="1hour"
Perfect for temporary code reviews or debugging sessions3.安全的文件传输
在系统之间安全地传输文件:
AI: Reads file, creates encrypted share, provides URL
User: Downloads from another system
AI: Can retrieve and save to different location if needed安全模型
AI能做什么
- ✅ 从字符串或文件创建加密共享
- ✅ 检索共享并将其保存到文件
- ✅ 指定格式、过期时间和其他粘贴选项
AI不能做什么
- ❌ 选择PrivateBin服务器(通过env-var配置)
- ❌ 查看默认密码(通过env-var配置)
- ❌ 检索共享时查看解密内容(仅写入文件)
该安全模型确保:
- 无数据泄露:AI无法将数据发送到任意服务器
- 隐藏证书:LLM无法看到密码
- 受控访问:解密后的内容会保存到文件中,而不是对话历史记录中
发展
有关开发设置、测试和贡献指南,请参阅 贡献.md.
运作原理
- 本地加密:内容在发送之前使用AES-256-GCM进行本地加密
- 服务器存储:只有加密数据存储在PrivateBin服务器上
- 键入URL:加密密钥包含在URL片段中(在
#),它永远不会发送到服务器 - 安全共享:与可以在浏览器中或通过此MCP服务器解密内容的收件人共享完整的URL
相关项目
- 私人垃圾箱 -服务器软件
- privatebin Python库 -Python客户端库(此MCP服务器使用)
- privatebin cli -PrivateBin的命令行工具
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
作者
亚伦·斯蒂尔 -
支持
如果您遇到任何问题或有疑问,请 打开一个问题 在GitHub上。
