keyper

keyper

Encrypts and stores API keys and environment variables locally, providing them to AI agents via MCP with tools for listing, describing, getting secrets, and running commands with secret values redacted.

Category
访问服务器

README

<div align="center">

<img src="assets/hero.png" alt="keyper — an encrypted local secrets vault that serves your API keys to your AI over MCP" width="820">

██╗  ██╗███████╗██╗   ██╗██████╗ ███████╗██████╗
██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗
█████╔╝ █████╗   ╚████╔╝ ██████╔╝█████╗  ██████╔╝
██╔═██╗ ██╔══╝    ╚██╔╝  ██╔═══╝ ██╔══╝  ██╔══██╗
██║  ██╗███████╗   ██║   ██║     ███████╗██║  ██║
╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝     ╚══════╝╚═╝  ╚═╝

your keys, kept — encrypted, local, MCP-native

Stop pasting sk-... into your AI. keyper keeps your API keys and env vars encrypted at rest on your own machine and hands them to your AI agent on demand over the Model Context Protocol.

license python deps status

</div>


Why

Every time you paste an API key into a chat, it lands in a transcript, maybe a log, maybe a training set. keyper breaks that habit. Your secrets live in one AES-256-GCM–encrypted file that only unlocks with your OS keychain or a passphrase. Your AI asks keyper for what it needs — and for the common case (calling an API, running a deploy) the value never even enters the conversation.

  • 🔐 Encrypted at rest — AES-256-GCM, per-secret nonce, secret-name bound as AAD.
  • 🗝️ Unlocks your way — OS keychain (silent) or a scrypt-derived passphrase.
  • 🤖 MCP-native — works with Claude Desktop, Claude Code, Cowork, or any MCP client.
  • 🧾 Redacted executionrun_with_secrets uses a key without ever showing it.
  • 🖥️ Local web UI — add and name keys with a click; nothing leaves 127.0.0.1.
  • 📄 One auditable file — ~800 lines of Python, two real dependencies.

Quickstart

git clone https://github.com/sharziki/keyper
cd keyper
bash quickstart.sh

That installs the deps, creates your vault, prints your MCP config line, and opens the web UI to add keys. Prefer to do it by hand? Read on.

Install

pip install cryptography "mcp[cli]" keyring
# keyring is only needed for keychain mode; skip it if you'll use --passphrase

Create a vault

python keyper.py init                 # keychain mode (master key in your OS keychain)
python keyper.py init --passphrase    # or derive the key from a passphrase (scrypt)

Add secrets

python keyper.py set OPENAI_API_KEY -d "personal key"   # prompts (not in shell history)
echo -n 'sk-...' | python keyper.py set STRIPE_KEY       # or pipe it in
python keyper.py import-env ./.env                       # or bulk-import a .env
python keyper.py list                                    # names only, no values

…or skip the terminal entirely:

python keyper.py ui        # opens http://127.0.0.1:8765/?token=…

<div align="center">

add · name · describe · delete — all over localhost, token-gated, values encrypted the instant you save

</div>


Connect it to your AI

All clients run the same stdio command: python keyper.py serve. Use absolute paths.

<details> <summary><b>Claude Code</b></summary>

claude mcp add keyper -- /usr/bin/python3 /abs/path/keyper.py serve
# passphrase mode:
claude mcp add keyper -e KEYPER_PASSPHRASE=your-passphrase -- /usr/bin/python3 /abs/path/keyper.py serve

</details>

<details> <summary><b>Claude Desktop / Cowork</b> (<code>claude_desktop_config.json</code> → <code>mcpServers</code>)</summary>

{
  "mcpServers": {
    "keyper": {
      "command": "/usr/bin/python3",
      "args": ["/abs/path/keyper.py", "serve"],
      "env": { "KEYPER_PASSPHRASE": "your-passphrase" }
    }
  }
}

Drop the env block if you use keychain mode. Restart the app afterward. </details>

Then ask your AI things like "use run_with_secrets with OPENAI_API_KEY to list my models."


Tools the AI gets

Tool Returns the value? Use it for
list_secrets ❌ names + descriptions Discovering what's in the vault
describe_secret(name) ❌ metadata only Details on one secret
get_secret(name) plaintext into context When the AI must read the raw value
run_with_secrets(command, secret_names[]) ❌ redacted from output Using a key without exposing it

The one tradeoff: get_secret puts a plaintext value into the model's context, where it could be logged. Prefer run_with_secrets — it injects secrets as environment variables into a subprocess and redacts any occurrence from the output. Treat a get_secret result as you would the key itself.


How it protects your secrets

  • AES-256-GCM authenticated encryption; a fresh random 96-bit nonce per secret.
  • The secret's name is bound in as Additional Authenticated Data, so a ciphertext can't be silently moved onto another name without decryption failing.
  • Master key: 32 random bytes in your OS keychain, or scrypt (n=2¹⁵) from a passphrase. The vault file alone is useless without it.
  • Plaintext is never written to disk or to the audit log.
  • Vault file and access.log are created 0600.
  • The web UI binds to 127.0.0.1, requires a per-launch token, and rejects any request whose Host header isn't localhost (blocks DNS-rebinding from malicious sites).

Threat model, briefly

keyper protects secrets at rest and keeps them out of your shell history and out of chat when you use run_with_secrets. It does not defend against malware already running as your user, or against you asking the AI to get_secret and pasting the result somewhere public.


Configuration

Variable Purpose
KEYPER_VAULT Vault file path (default ~/.config/keyper/vault.json)
KEYPER_PASSPHRASE Passphrase for passphrase-mode vaults (required by the server)
KEYPER_VALUE Value source for non-interactive set (scripting)
KEYPER_NO_AUDIT Set to disable the access log

CLI: init · set · get · list · rm · rotate · import-env · ui · serve — run keyper <cmd> -h.


Contributing

Issues and PRs welcome — see CONTRIBUTING.md. keyper is intentionally small and auditable; changes that touch crypto or the UI's auth must spell out their threat-model impact.

License

MIT © 2026 Sharvil Saxena

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选