mcp-keyward
🔐 mcp-keyguard
您的 AI 代理永远不应看到您的 API 密钥。现在它看不到了。
mcp-keyguard 是一个本地 MCP 服务器,充当您的 AI 代理(Claude、Cursor、Windsurf 等)与任何外部 API 之间的安全代理。
您无需将 OpenAI、Stripe 或 GitHub 密钥粘贴到聊天上下文中,而是将它们加密存储在您的机器上。代理调用 mcp-keyguard,后者在服务器端注入真实密钥并返回结果。
密钥永远不会离开您的机器。代理永远看不到它。
为什么这很重要
2025 年,一个流行的 MCP 托管平台中的漏洞暴露了来自 3000 多个服务器的数千个 API 密钥。根本原因是什么?密钥通过了用户无法控制的基础设施。
mcp-keyguard 则完全相反:完全本地化,零外部依赖,您的密钥在静态时使用 AES-128 加密。
Related MCP server: aarifmms/keyblind
工作原理
Your prompt → Claude → mcp-keyguard → [injects real key] → External API
↑
Key never leaves here安装
要求: Python 3.10+
pip install mcp httpx cryptography
git clone https://github.com/ggc180820/mcp-keyguard.git
cd mcp-keyguard添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"mcp-keyguard": {
"command": "python",
"args": ["/path/to/mcp-keyguard/main.py"]
}
}
}重启 Claude Desktop。完成。
使用方法
1. 存储密钥(每个密钥只需执行一次)
"使用 add_key 存储我的 OpenAI 密钥,别名为 'openai', header_name 为 'Authorization',header_prefix 为 'Bearer '"
2. 发起经过身份验证的请求(Claude 会自动执行此操作)
"使用 make_request 并指定别名 'openai' 来调用 https://api.openai.com/v1/models"
3. 查看已存储的内容
"使用 list_keys" → 显示别名和标头。绝不会显示真实值。
工具
工具 | 功能 |
| 将 API 密钥加密存储在保险库中 |
| 列出已存储的别名 — 绝不会显示值 |
| 发起经过身份验证的 HTTP 请求,密钥在服务器端注入 |
| 从保险库中删除密钥 |
安全模型
密钥使用 Fernet (AES-128-CBC + HMAC-SHA256) 加密
加密密钥仅存在于您机器上的
vault.key中所有 HTTP 请求均在本地进行,超时时间为 30 秒
切勿将
vault.key或vault.json提交到 git(已包含在.gitignore中)
mcp-keyguard Pro
需要更多控制?Pro 版增加了:
功能 | 免费版 | Pro 版 |
加密本地保险库 | ✅ | ✅ |
无限密钥 | ✅ | ✅ |
多个保险库(按项目/客户) | ❌ | ✅ |
审计日志(谁在何时何地使用了哪个密钥) | ❌ | ✅ |
密钥轮换提醒 | ❌ | ✅ |
许可证
MIT — 个人使用永久免费。
This server cannot be deployed
Maintenance
Related MCP Connectors
A secret store for AI agents: the agent never sees the plaintext.
Secrets for developers and agents—secure context and workflows without exposing secret values.
Encrypted store for API keys and database URLs your code needs. Use them without reading them.
Give your AI hands. Identity, credential vault, and API gateway for autonomous agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceLocal AES-256-GCM encrypted vault for AI agents. Resolve {{PLACEHOLDER}} secrets in prompts at runtime — LLMs never see real API keys. Argon2id key derivation, zero cloud.258 npm2MIT
- AlicenseAqualityDmaintenanceEncrypted secrets vault that blinds AI agents to API keys. Stores secrets in AES-256-GCM encrypted SQLite vault, resolves them at runtime via MCP values never appear in LLM conversation transcripts. Sandbox .env files with deterministic fakes.739 npm3MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to securely use credentials like passwords and API keys without exposing them in the context window, through encrypted storage and proxy-based injection.3 npm2MIT
- AlicenseNot gradedqualityBmaintenanceBounded egress gateway & secret proxy for AI agents and applications, enabling safe credential injection into upstream requests while keeping raw secrets out of LLM prompt contexts.8 npmMIT