# keygrant

> keygrant is an open-source MCP server for security. Secrets manager MCP server that runs commands with API keys the model never sees. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux
- **Website:** https://keygrant.app
- **Repository:** https://github.com/bazingaedward/keygrant
- **MCP Registry name:** io.github.bazingaedward/keygrant
- **Categories:** security, developer tools
- **Listing updated:** 2026-11-14

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add keygrant -- uvx keygrant
```

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

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

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/keygrant
