Skip to main content
Glama

πŸ” mcp-keyguard

Your AI agent should never see your API keys. Now it won't.

mcp-keyguard is a local MCP server that acts as a secure proxy between your AI agent (Claude, Cursor, Windsurf...) and any external API.

Instead of pasting your OpenAI, Stripe or GitHub keys into the chat context, you store them encrypted on your machine. The agent calls mcp-keyguard, which injects the real key server-side and returns the result.

The key never leaves your machine. The agent never sees it.


Why this matters

In 2025, a vulnerability in a popular MCP hosting platform exposed thousands of API keys from over 3,000 servers. The root cause? Keys passed through infrastructure the user didn't control.

mcp-keyguard is the opposite: fully local, zero external dependencies, your keys encrypted at rest with AES-128.


Related MCP server: aarifmms/keyblind

How it works

Your prompt β†’ Claude β†’ mcp-keyguard β†’ [injects real key] β†’ External API
                           ↑
                    Key never leaves here

Installation

Requirements: Python 3.10+

pip install mcp httpx cryptography
git clone https://github.com/ggc180820/mcp-keyguard.git
cd mcp-keyguard

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-keyguard": {
      "command": "python",
      "args": ["/path/to/mcp-keyguard/main.py"]
    }
  }
}

Restart Claude Desktop. Done.


Usage

1. Store a key (you do this once per key)

"Use add_key to store my OpenAI key with alias 'openai',
header_name 'Authorization', header_prefix 'Bearer '"

2. Make authenticated requests (Claude does this automatically)

"Use make_request with alias 'openai' to call
https://api.openai.com/v1/models"

3. Check what's stored

"Use list_keys"
β†’ Shows aliases and headers. Never the real values.


Tools

Tool

What it does

add_key

Store an API key encrypted in the vault

list_keys

List stored aliases β€” values are never shown

make_request

Make an authenticated HTTP request, key injected server-side

delete_key

Remove a key from the vault


Security model

  • Keys are encrypted with Fernet (AES-128-CBC + HMAC-SHA256)

  • The encryption key lives in vault.key on your machine only

  • All HTTP requests are made locally with a 30s timeout

  • Never commit vault.key or vault.json to git (already in .gitignore)


mcp-keyguard Pro

Need more control? Pro adds:

Feature

Free

Pro

Encrypted local vault

βœ…

βœ…

Unlimited keys

βœ…

βœ…

Multiple vaults (per project/client)

❌

βœ…

Audit log (who used which key, when, where)

❌

βœ…

Key rotation alerts

❌

βœ…

πŸ‘‰ Get Pro β€” 5€/month


License

MIT β€” free forever for personal use.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Local 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.
    2
    58 npm
    2
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Encrypted 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.
    7
    39 npm
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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 npm
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Bounded 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 npm
    MIT