Keystash
macOS Keychain secret broker where an agent can use your API keys but never read them
- Pricing
- Open source
- Platforms
- macOS, CLI, self-hosted
- Runs
- Locally
- Version
- 0.4.2
- Listing updated
- 1 day ago
About Keystash
Keystash is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.
keystash is built on one rule: the agent manages keys it cannot see. Values go into the macOS login Keychain and are never written to a file the tool owns, printed or returned by any interface. Only metadata such as name, tags, rotation schedule and allowed URLs sits on disk in a 0600 JSON file. The README stresses that there is no secret_read tool and no CLI command that echoes a value; the code path does not exist.
The MCP server speaks stdio only and opens no socket. It exposes six tools to list entries, store or rotate a value the user types into a native hidden dialog, generate a strong value and return only a fingerprint, call a pre-approved URL with a credential, and delete an entry after a confirmation dialog. Names must follow a SERVICE_ENV_PURPOSE pattern, and rotation intervals let keystash doctor report entries that are overdue.
It installs from PyPI, relies on macOS tools such as security, osascript and pbcopy, and uses Touch ID when a value is actually needed. The README is bilingual, in Chinese and English.
Install
Run in a terminal
claude mcp add keystash -- uvx keystashAdd to claude_desktop_config.json
{
"mcpServers": {
"keystash": {
"command": "uvx",
"args": [
"keystash"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"keystash": {
"command": "uvx",
"args": [
"keystash"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"keystash": {
"type": "stdio",
"command": "uvx",
"args": [
"keystash"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"keystash": {
"command": "uvx",
"args": [
"keystash"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"keystash": {
"command": "uvx",
"args": [
"keystash"
]
}
}
}Tools this server provides (6)
Taken from the project documentation; the running server may differ.
- secret_list
- Lists entries with name, tags, rotation dates and allowed URLs.
- secret_store
- Stores a value the user types into a dialog.
- secret_rotate
- Replaces a value the same way.
- secret_generate
- Generates a strong value and stores it, returning a fingerprint.
- secret_use
- Calls an allowed URL with the credential and returns the reply.
- secret_delete
- Erases the entry and its Keychain item after a confirmation dialog.
What it does
- No read tool
- No tool or CLI command returns a stored value to the agent.
- Keychain storage
- Values live in the macOS login Keychain; only metadata is on disk.
- Restricted secret use
- secret_use can only call URLs approved per entry.
- Secret generation
- Generates strong values and returns a fingerprint only.
- Rotation tracking
- Metadata records rotation intervals and doctor flags overdue entries.
- Stdio only
- The server opens no network socket.
Good for
- Let an agent call an API with your key without exposing the key
- Rotate keys on a schedule through an assistant
- Generate and store a new credential without seeing it
- Audit which keys are past their rotation date
Pricing
Open source
Free, open source on PyPI and GitHub
Prices change. Check pypi.org before you buy.
Keystash FAQ
Can the agent read my keys?
No. The README says there is no secret_read tool and no code path that returns a value.
Where are values stored?
In the macOS login Keychain; metadata is plain JSON on disk.
How many tools does it expose?
Six: list, store, rotate, generate, use and delete.
How do I install it?
pip install keystash or uv tool install keystash, then run keystash mcp.
Is Keystash free?
Yes. Keystash is open source, so you can use and self-host it for free.
How do I add Keystash to Claude Code?
Run this command in your terminal: claude mcp add keystash -- uvx keystash
What are the best alternatives to Keystash?
The closest alternatives to Keystash are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Keystash

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools