Skip to content
MCP server

keygrant

Secrets manager MCP server that runs commands with API keys the model never sees

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, macOS, Windows
Runs
Locally
Version
0.1.11
Listing updated
3 days ago

About keygrant

keygrant is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.

The model handles secret names only. When it needs a key, it calls exec_with_secrets, which runs the command with the values injected into that child process and redacts the output, including base64, hex and URL-encoded forms, before anything returns to the model. list_secrets returns names, descriptions and usage, never values. There is deliberately no store tool, because a value passed through a tool call would land in context; secrets go in from the terminal with keygrant set, reading from stdin.

Every new command needs your approval in a native dialog that shows the exact command. A grant covers that command string in one agent session for 15 minutes, held in memory only, and a timeout means deny. Storage uses the OS facility: Keychain on macOS, DPAPI on Windows, Secret Service on Linux. End-to-end encrypted sync and a phone approver are in preview.

The README is candid about limits. An approved command can still send a key over the network, so reading the dialog is the control, and approving a script approves what it does. Redaction is a second line of defence and local malware is out of scope. Per-secret egress allowlists are on the roadmap. Python 3.10 or newer is required.

Install

Run in a terminal

claude mcp add keygrant -- uvx keygrant

Add to claude_desktop_config.json

{
  "mcpServers": {
    "keygrant": {
      "command": "uvx",
      "args": [
        "keygrant"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "keygrant": {
      "command": "uvx",
      "args": [
        "keygrant"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "keygrant": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "keygrant"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "keygrant": {
      "command": "uvx",
      "args": [
        "keygrant"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "keygrant": {
      "command": "uvx",
      "args": [
        "keygrant"
      ]
    }
  }
}

Tools this server provides (2)

Taken from the project documentation; the running server may differ.

list_secrets
List secret names, descriptions and usage, never values.
exec_with_secrets
Run a command with secrets injected and output redacted.

What it does

Names for the model, values for the process
Secrets are injected into the child process only.
Per-command approval
A native dialog shows the full command; timeout denies.
Forced output redaction
Output is scrubbed of secrets and common encodings.
OS-native storage
Keychain, DPAPI or Secret Service rather than a dotfile.
No store tool
The agent cannot write secrets through chat.
Project wiring
keygrant init adds the MCP entry and CLAUDE.md guidance.

Good for

  • Let an agent call an API without its key entering context
  • Approve each deploy command individually
  • Reduce the damage of a prompt-injected agent
  • Keep keys out of transcripts and logs

Pricing

Open source

Installs from PyPI; sync and phone approver are in preview, no price listed

Prices change. Check keygrant.app before you buy.

keygrant FAQ

Where are secrets stored?

In the OS credential store; the README describes a DPAPI-encrypted vault on Windows and the login Keychain on macOS.

How long does an approval last?

A grant covers one command in one session for 15 minutes, in memory only.

Can the agent add secrets?

No. Values are entered through the CLI, not by a tool call.

Can an approved command still leak a key?

Yes. The README says reviewing the dialog is the control.

How do I set it up?

uv tool install keygrant, then keygrant init in each project, or install the Claude Code plugin.

Is keygrant free?

Yes. keygrant is open source, so you can use and self-host it for free.

How do I add keygrant to Claude Code?

Run this command in your terminal: claude mcp add keygrant -- uvx keygrant

What are the best alternatives to keygrant?

The closest alternatives to keygrant are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to keygrant

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools