Secret Vault MCP Server
AES-256-GCM encrypted local secret storage exposed as MCP tools, with secrets captured via native OS dialogs and never passing through the LLM API.
README
Secret Vault — MCP Server
AES-256-GCM encrypted local secret storage exposed as Claude Code MCP tools. The critical security property: secret values and the master key are captured via native OS dialogs and never pass through the LLM API.
Part of the secret-vault skill. This repo contains the standalone MCP server. The full skill (MCP server + CLI + docs) lives at wwt/ai-skills-catalog — skills/secret-vault.
Security Contract
| What the LLM sees | What the LLM never sees |
|---|---|
Secret key names (github.token) |
Secret values |
| Tags, created date, rotated date | The vault master key |
Operation results ("stored", "deleted") |
Decrypted vault contents |
When you ask Claude to store a secret, it calls vault_set(name="github.token").
The MCP server opens a native macOS password dialog — you type the value there.
It goes directly from the dialog into the encrypted vault file, never through
the LLM API.
Installation
1. Clone and install dependencies
git clone https://github.com/sam-ueckert/vault-mcp.git ~/repos/vault-mcp
pip3 install -r ~/repos/vault-mcp/requirements.txt
2. Register the server in ~/.claude.json
Add to the top-level mcpServers object:
{
"mcpServers": {
"secret-vault": {
"type": "stdio",
"command": "python3",
"args": ["/Users/YOUR_USERNAME/repos/vault-mcp/server.py"]
}
}
}
3. Allow the tools in ~/.claude/settings.json
{
"permissions": {
"allow": [
"mcp__secret-vault__vault_status",
"mcp__secret-vault__vault_init",
"mcp__secret-vault__vault_rekey",
"mcp__secret-vault__vault_list",
"mcp__secret-vault__vault_set",
"mcp__secret-vault__vault_rotate",
"mcp__secret-vault__vault_delete",
"mcp__secret-vault__vault_exists",
"mcp__secret-vault__vault_get_metadata",
"mcp__secret-vault__vault_update_tags",
"mcp__secret-vault__vault_import"
]
}
}
4. Restart Claude Code. The server spawns as a subprocess on first tool use.
Prerequisites
pip3 install cryptography mcp
mcp 1.0+ is required. argon2-cffi is optional — if installed, passphrase KDF upgrades from PBKDF2 to Argon2id.
Installation
1. Register the server in ~/.claude.json
Open ~/.claude.json and add to the top-level mcpServers object:
{
"mcpServers": {
"secret-vault": {
"type": "stdio",
"command": "python3",
"args": ["/path/to/skills/secret-vault/mcp-server/server.py"]
}
}
}
Replace /path/to/ with the actual path to your skills checkout, e.g.:
~/repos/claude-skills/skills/secret-vault/mcp-server/server.py
2. Allow the tools in ~/.claude/settings.json
Add to the permissions.allow array:
"mcp__secret-vault__vault_status",
"mcp__secret-vault__vault_init",
"mcp__secret-vault__vault_list",
"mcp__secret-vault__vault_set",
"mcp__secret-vault__vault_rotate",
"mcp__secret-vault__vault_delete",
"mcp__secret-vault__vault_exists",
"mcp__secret-vault__vault_get_metadata",
"mcp__secret-vault__vault_update_tags",
"mcp__secret-vault__vault_rekey",
"mcp__secret-vault__vault_import"
3. Restart Claude Code
The server spawns as a subprocess on first tool use. No daemon to start.
First-Run Behaviour
On macOS, the server auto-initializes the vault on first use:
- Generates a random 256-bit key
- Stores it in the macOS Keychain under
agent-secret-vault - Creates
~/.agent/vault/vault.enc
From that point on, all subsequent calls are silent — the Keychain handles key resolution without prompting.
To use a passphrase instead of the Keychain:
Ask Claude: "Initialize the vault with a passphrase"
This calls vault_init(key_tier="passphrase") and prompts via native dialog.
Vault Storage
~/.agent/vault/
├── vault.enc # AES-256-GCM encrypted JSON — all secrets live here
├── .vault-meta # Key tier, salt (if passphrase), created date
└── audit.log # Append-only log: timestamps + key names, no values
The encryption format is identical to the CLI skill — both tools read and
write the same vault.enc file.
Tools Reference
vault_status
Check initialization state, key tier, and number of stored secrets.
Ask Claude: "What's my vault status?"
vault_init(key_tier, force?)
Initialize or re-initialize the vault.
key_tier |
Behaviour |
|---|---|
keychain |
Random 256-bit key stored in OS Keychain (default on macOS) |
passphrase |
Argon2id-derived key — prompts via native dialog |
env |
Reads VAULT_KEY hex env var |
Warning: Re-initializing creates a new empty vault, permanently destroying all stored secrets. The tool refuses if secrets exist unless
force=Trueis passed. Usevault_rekeyto rotate the master key while preserving secrets.
Ask Claude: "Initialize the vault" or "Initialize with a passphrase"
vault_rekey(new_key_tier)
Rotate the vault master key while preserving all stored secrets.
Decrypts with the current key, generates or derives a new key via native dialog (for passphrase), re-encrypts every secret under the new key, and updates the key tier. The new key never passes through the LLM.
new_key_tier |
Behaviour |
|---|---|
keychain |
New random key stored in OS Keychain |
passphrase |
New passphrase collected via native dialog |
env |
New key read from VAULT_KEY env var |
Ask Claude: "Rekey the vault" or "Rotate the vault master key to use a passphrase"
vault_list(tags?)
List all stored secret names, tags, and timestamps. Values are never shown.
Ask Claude: "List my secrets" or "List secrets tagged env:prod"
vault_set(name, tags?)
Store a new secret or overwrite an existing one.
The value is not a parameter — a native macOS password dialog opens and captures it directly. The LLM only receives the key name.
Ask Claude: "Store a secret called github.token" or "Save my AWS access key as aws.access_key_id tagged env:prod,service:aws"
vault_rotate(name)
Replace an existing secret's value. Same dialog-capture behaviour as vault_set.
Records a rotation timestamp.
Ask Claude: "Rotate my github.token"
vault_delete(name)
Permanently remove a secret.
Ask Claude: "Delete the secret github.token"
vault_exists(name)
Check whether a key exists without retrieving its value.
Ask Claude: "Does github.token exist in the vault?"
vault_get_metadata(name)
Return tags, created date, and last-rotated date for a secret. No value.
Ask Claude: "Show me the metadata for aws.access_key_id"
vault_update_tags(name, tags)
Replace all tags on a secret without touching its value.
Ask Claude: "Tag github.token with env:prod,service:github"
vault_import(file_path, tags?, keep?)
Import secrets from a file on disk. Supports .env (KEY=VALUE) and JSON ({"key": "value"}) formats.
Write the secrets to a file yourself, then call this tool — values go from
the file directly into the encrypted vault via the MCP server process, never
through the LLM API. The file is securely overwritten with random bytes and
deleted after import. Pass keep=True to preserve it.
| Parameter | Default | Description |
|---|---|---|
file_path |
required | Absolute path to the .env or JSON file |
tags |
"" |
Comma-separated tags applied to all imported secrets |
keep |
False |
Keep the file on disk after import |
Ask Claude: "Import secrets from /tmp/staging.env" or "Import /tmp/keys.json tagged env:prod"
Key Naming Convention
Use dot-separated namespaces for discoverability:
service.credential_type
aws.access_key_id
aws.secret_access_key
github.pat
github.token
azure.client_secret
slack.bot_token
anthropic.api_key
Relationship to the CLI Skill
This MCP server and the CLI script (vault.py in wwt/ai-skills-catalog) share the
same vault file (~/.agent/vault/vault.enc) and encryption format — both tools can
read and write the same vault.
| Use case | Tool |
|---|---|
| Asking Claude to manage secrets interactively | MCP server — values never hit LLM |
Bulk import from .env or JSON file |
vault_import MCP tool or CLI vault.py import |
| Scripting / CI pipelines | CLI vault.py get key --export |
| Export for GitHub Actions / GitLab CI | CLI vault.py export --format github-actions |
Warning:
vault.py get <key>prints the value to stdout. If captured as a Claude tool result, the secret is exposed to the LLM API. Use the MCP server for all interactive agent use.
Gotchas
- Keychain prompt on first use: macOS may show a Keychain authorization
dialog the first time a new session accesses
agent-secret-vault. Click "Always Allow" to suppress future prompts. - Passphrase mode re-prompts every session: The master key is cached in the server process memory. When you open a new Claude Code session, the passphrase dialog appears on the first vault tool call.
- No value retrieval tool by design: There is no
vault_get_valuetool. This is intentional — if you need a secret injected into a command, usevault.py get key --exportin a shell script outside of Claude. - Binary secrets: Files with non-UTF-8 content (SSH keys, etc.) are stored as base64. The CLI skill handles these natively via file-based operations.
- Vault location is fixed:
~/.agent/vault/— not configurable in this version.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。