Secure secret vault for AI agents via Model Context Protocol (MCP)
Project description
Keysmith MCP 🔐
Secure secret vault for AI agents using the Model Context Protocol (MCP). Give your agents access to what they need, without compromising your master password or exposing long-lived credentials.
Why Keysmith?
AI agents and autonomous systems often need access to API keys, database credentials, or other secrets to perform tasks. Most current solutions involve:
- Environment Variables: Hard to manage, visible to all processes, and persist indefinitely.
- Hardcoding: Dangerous and bad practice.
- Complex Vaults (HashiCorp/1Password): Overkill for local agent development, often requiring complex CLI authentication.
Keysmith is designed to be the "Goldilocks" solution: simple enough for a single developer, yet secure enough to protect your most sensitive keys.
Key Features
- Strong Encryption: Uses Fernet (AES-128-CBC) with key derivation via PBKDF2 (SHA-256, 480k iterations).
- Time-To-Live (TTL): Automatically expires secrets after a set period. Great for temporary agent access.
- Audit Logging: Every single access (or attempted access) is logged to
~/.keysmith/audit.log. - MCP Native: Implements the Model Context Protocol, making it plug-and-play with any MCP-compatible environment or autonomous agent.
- Multi-Agent Swarms: Designed to support multiple agents on the same machine reading from the same vault simultaneously.
[!NOTE] Multi-agent file locking currently requires Unix/macOS. Windows support is planned for v0.2.
Installation
pip install keysmith-mcp
Quickstart
-
Initialize the vault:
keysmith initThis will prompt you for a master password and create your encrypted vault in
~/.keysmith/. -
Add a secret:
# Permanent secret keysmith add OPENAI_KEY sk-your-key # Secret that expires in 3 hours (180 minutes) keysmith add GITHUB_TOKEN ghp_your_token --ttl 180 # Short-lived secret for a single task (30 minutes) keysmith add STRIPE_KEY sk_live_... --ttl 30
-
Configure your MCP Client: Add Keysmith to your MCP host configuration file (e.g.,
mcp_config.jsonor your custom agent settings):{ "mcpServers": { "keysmith": { "command": "keysmith", "args": ["serve"], "env": { "KEYSMITH_PASSWORD": "your-master-password" } } } }
Security Model
Keysmith follows a simple but robust security model:
- At Rest: Your data is stored in
~/.keysmith/vault.enc, encrypted with a key derived from your master password + a unique salt. - In Memory: The MCP server requires the
KEYSMITH_PASSWORDenvironment variable. It decrypts the vault into memory only when the server starts. - Agent Visibility:
- list_secrets: Agent sees only the names (e.g.,
STRIPE_KEY), never the values. - get_secret: Agent gets the value. This action is permanently recorded in the audit log.
- add_secret: Agent can store new temporary credentials.
- revoke_secret: Agent can "self-destruct" a key after use.
- list_secrets: Agent sees only the names (e.g.,
Comparison
| Feature | 1Password / Vault | Env Vars | Keysmith |
|---|---|---|---|
| Setup Complexity | High | Low | Low |
| Agent Integration | Via custom SDKs | Native | Native (MCP) |
| Audit Logs | Yes (Enterprise) | No | Yes (Built-in) |
| Auto-Expiry | No | No | Yes (TTL) |
| Local First | Mostly Cloud | Yes | Yes |
| Multi-Agent Support | No | No | Yes |
Roadmap
- OS keychain integration (macOS Keychain, Windows Credential Locker)
- Local web dashboard for audit log visualization
.envfile importer
License
MIT - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keysmith_mcp-0.1.0.tar.gz.
File metadata
- Download URL: keysmith_mcp-0.1.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32bde50eadd0af8bf1abb5a6a02b91c716e27e4807e0a25e4a80f0ab89dce8fe
|
|
| MD5 |
c9f30c9db337412b427a7d423ec22e67
|
|
| BLAKE2b-256 |
ba655d034d06f0fd4a7f012b5ab4c31076b0434f532fc7e09f35d3f8873f6d78
|
File details
Details for the file keysmith_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keysmith_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb185e1a9e16b39f7654df1051b904b309ca0b67f733921fee47bed295d05e15
|
|
| MD5 |
f28e26720d38ae4cbabf167c6cddc1e7
|
|
| BLAKE2b-256 |
fbedc40bb29fe077d3c2c5912bbe1bf5c38f5d26ab3484b2e2887dcdc3fda7b7
|