Skip to main content

Keysmith MCP 🔐

PyPI version Tests Passing License: MIT

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:

  1. Environment Variables: Hard to manage, visible to all processes, and persist indefinitely.
  2. Hardcoding: Dangerous and bad practice.
  3. 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.

Installation

pip install keysmith-mcp

Quickstart

  1. Initialize the vault:

    keysmith init
    

    This will prompt you for a master password and create your encrypted vault in ~/.keysmith/.

  2. 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
    
  3. Configure your MCP Client: Add Keysmith to your MCP host configuration file (e.g., mcp_config.json or 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_PASSWORD environment 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.

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
  • .env file importer

License

MIT - See LICENSE for details.

Metadata

Release files for keysmith-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keysmith-mcp 0.1.0
File Size Uploaded Provenance
keysmith_mcp-0.1.0.tar.gz 12.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for keysmith-mcp 0.1.0
File Interpreter ABI Platform
keysmith_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / keysmith_mcp-0.1.0.tar.gz

Download URL keysmith_mcp-0.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
32bde50eadd0af8bf1abb5a6a02b91c716e27e4807e0a25e4a80f0ab89dce8fe
BLAKE2b-256 checksum
How to use checksums
ba655d034d06f0fd4a7f012b5ab4c31076b0434f532fc7e09f35d3f8873f6d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / keysmith_mcp-0.1.0-py3-none-any.whl

Download URL keysmith_mcp-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb185e1a9e16b39f7654df1051b904b309ca0b67f733921fee47bed295d05e15
BLAKE2b-256 checksum
How to use checksums
fbedc40bb29fe077d3c2c5912bbe1bf5c38f5d26ab3484b2e2887dcdc3fda7b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for keysmith-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page