passkey-mcp
This server provides tools to manage OS-keychain secrets and secure MCP server configurations.
List passkey entries, inspect field names, and view non-sensitive entry metadata.
Reverse-lookup environment variables to matching entries and validate
passkey://references.Preflight
passkey runcommands and inspect project secret manifests and trust status.Check MCP server security status and run passkey/MCP diagnostics.
Request or rotate secrets via native OS dialogs without exposing secret values.
Wrap MCP server configs to inject secrets at runtime.
Review sanitized audit logs and optionally autofill local Chrome CDP tabs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@passkey-mcp run myapi -- python app.py"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
passkey-mcp
Zero-plaintext secrets for AI coding agents and the terminal.
Store API keys and credentials in your native OS Keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) and inject them into MCP servers and CLI processes at runtime—with real-time output masking and zero secrets in config files, shell history, or LLM context.
Quickstart · How It Works · AI Agent Workflows · Security Model · Documentation Wiki
Positioning:
passkey-mcpis a local OS-keychain secret injector—not a team password manager, shared cloud vault, or 1Password replacement. No cloud sync, no background daemon, no telemetry. Alpha (0.11.x).
How It Works
AI coding tools normally store MCP server tokens in plaintext JSON on disk (~/.cursor/mcp.json, ~/.claude.json, claude_desktop_config.json). One command (passkey init) moves those tokens into your OS Keychain, saves a 0o600 backup in <data_dir>/backups/, and rewrites the launch command to inject secrets in memory at startup:
{
"mcpServers": {
"stripe": {
- "command": "npx",
- "args": ["-y", "@stripe/mcp"],
- "env": {
- "STRIPE_SECRET_KEY": "sk_live_51N..."
- }
+ "command": "passkey",
+ "args": ["run", "--quiet", "stripe", "--", "npx", "-y", "@stripe/mcp"]
}
}
}Need to leave passkey? Run passkey unwrap at any time to restore inline commands cleanly.
Related MCP server: secrets-mcp-server
60-Second Quickstart
Install
uv tool install passkey-mcp
# or: pipx install passkey-mcp(Working from a local git clone? Run uv sync && uv run passkey --help.)
Step 1 — Secure Existing MCP Configs in One Command
passkey init --dry-run # Preview detected plaintext MCP secrets across installed tools
passkey init # Migrate tokens to OS Keychain and wrap server configs
passkey status # Verify all servers report 'secured'Step 2 — Store & Run Your Own Secrets
passkey new stripe # Masked input ('•' bullets + live char counter)
passkey run stripe -- pytest # Inject into child env with stdout/stderr maskingStep 3 — Onboard Your AI Coding Agents
# Install PreToolUse secret-guard hooks + SKILL.md / .mdc / AGENTS.md rules in one shot
passkey hook install --tool all --with-skillAdd passkey-mcp-server to your MCP client (claude mcp add passkey -- passkey-mcp-server) or drop this into your client's mcp.json:
{
"mcpServers": {
"passkey": {
"command": "passkey-mcp-server"
}
}
}Once connected, agents gain 13 secret-free MCP tools (passkey_find, passkey_project_status, passkey_request_secret, passkey_entry_info, passkey_preflight_run, passkey_doctor, ...) and 3 guided @mcp.prompt() playbooks (setup-project-secrets, debug-missing-credential, migrate-exposed-mcp-configs).
AI Agent Workflows
1. Real-Time Stream Scrubbing (SecretMasker)
Even if a test crash, traceback, or rogue print(os.environ) dumps an injected token, passkey scrubs raw UTF-8 and JSON-escaped secret values (len >= 4, across pipe chunk boundaries) before they reach terminal scrollback or LLM context:
$ passkey run -q stripe -- python3 -c 'import os; print("Token:", os.environ["STRIPE_SECRET_KEY"])'
Token: <concealed by passkey>2. Out-of-Band Native OS Secret Popups (passkey_request_secret)
When an entry is missing—or an API returns 401 Unauthorized on an expired key—your agent doesn't stall or ask you to paste secrets into chat. It triggers a native macOS/Linux hidden-input dialog directly on your desktop that saves straight into your OS Keychain:
# Missing credential -> pops native hidden dialog ("Passkey - Secret Request")
passkey request stripe_dev --fields STRIPE_SECRET_KEY,WEBHOOK_SECRET --policy session \
--hint "Stripe Dashboard -> Developers -> API keys" --json
# Expired credential -> fires macOS Notification banner + "Passkey - Rotate Secret" modal
passkey request resend --fields RESEND_API_KEY \
--reason "HTTP 401 Unauthorized: API token expired" \
--hint "Resend Dashboard -> API Keys -> Create API Key" --jsonThe agent receives only {"ok": true, "status": "updated", "fields_saved": ["RESEND_API_KEY"], "rotated": true}—never the secret.
3. Biometric Touch ID Session Leases (policy = session)
First-run onboarding (passkey) lets you choose your global default-policy (passkey config default-policy <mode>), and you can switch individual entries or your entire keychain (passkey policy --all <mode> [--exclude-mcp]) anytime:
Policy | Biometric Behavior | Ideal Use Case |
| 1 Touch ID tap unlocks the calling agent session ( | CLI/agent APIs ( |
| Headless OS Keychain access (0 extra prompts; still scrubbed by | Background IDE-boot MCP servers ( |
| Touch ID on every single invocation unless an explicit | Production databases, billing, & root credentials |
# Switch all CLI/agent entries to 1-tap Session Touch ID while keeping background MCP servers headless
passkey policy --all session --exclude-mcp --yes
# Or switch everything to zero-prompt YOLO mode (requires 1 Touch ID tap on policy relaxation; blocked for AI agents)
passkey policy --all allow --yesAsymmetric Policy Step-Up: Tightening policies (
allow -> session,session -> prompt) requires zero prompts, while relaxing any entry ordefault-policy(prompt -> session/allow,session -> allow) is hard-blocked (POLICY_DOWNGRADE_FORBIDDEN) for AI agents/MCP and requires 1-tap Touch ID / OS auth in your terminal.
4. Zero-Config Repo Execution (passkey project init + passkey exec)
Commit a secret-free .env.passkey pointer manifest to git so humans and agents never have to stitch entry names together:
# Scan .env.example (refuses live .env!), map matching keychain entries, and write .env.passkey
passkey project init
# Run from anywhere inside the repo — HMAC-verified against trusted_projects.json
passkey exec -q -- pytest5. Peer-to-Peer Encrypted Token Sharing (passkey share + passkey upload)
Hand a credential set to a teammate over Slack/Teams without writing files to disk or pasting plaintext keys:
# Sender: fuzzy-match entry, copy compact AAD-authenticated pk1:... token to clipboard (120s auto-clear),
# and print a random 8-word Scrypt passphrase for a separate channel
passkey share stripe_dev
# Recipient: paste the pk1:... token & passphrase at masked prompts, preview fields, and save to keychain
passkey uploadSecurity Model
┌───────────────────────────────────────────────────────────────────────────┐
│ AI Agent / LLM Context (Claude Code, Cursor, Gemini CLI, Codex, VS Code) │
│ • Sees ONLY: entry names, field keys, policy, lease status (`--json`) │
│ • Blocked from `.env`, `*.backup`, `*.enc`, `passkey get` via PreToolUse │
│ • Receives child stdout/stderr with secrets -> `<concealed by passkey>` │
└───────────────────────────────┬───────────────────────────────────────────┘
│ MCP stdio / CLI subprocess
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ passkey Broker (In-Memory, Zero Background Daemons) │
│ 1. Verifies repo manifest SHA-256 against HMAC `trusted_projects.json` │
│ 2. Enforces `allow` | `session` (`proc_pidinfo` lineage) | `prompt` ACL │
│ 3. Reads secret payload from OS Keychain (`service="passkey"`) │
│ 4. Injects env vars into child process ONLY & scrubs output streams │
│ 5. Appends caller-attributed record to HMAC hash-chained `audit.log` │
└───────────────────────────────────────────────────────────────────────────┘OS Keychain at Rest: Credentials, config values, and all four internal 256-bit HMAC keys (
__audit_hmac_key__,__lease_hmac_key__,__trust_hmac_key__,__policy_hmac_key__) live in your OS Keychain—<data_dir>(0o700) stores0o600secret-free metadata (entries.jsonv2) and HMAC-anchored policy overrides (policies.json) so discovery,<TAB>completion,--dry-runpreflight, andO(1)bulk policy switching trigger zero secret Keychain prompts.Authenticated Portability (
pk1:&PK01):passkey share/passkey uploadexchange compact URL-safepk1:...tokens authenticated withAES-256-GCM("pk1:" + headerAAD) +Scrypt(N=2^20, r=8, p=1), whilepasskey export --encryptandpasskey share -owriteO_EXCL,0o600PK01bundles.Tamper-Evident Audit Chain: Every operation records
actorattribution (humanvs.agentclient) in an HMAC-SHA256 hash chain (passkey audit --verify).Pre-Execution Agent Guardrails:
passkey hook checkblocks agent file/shell reads of.env,*.backup,*.enc,passkey get,passkey share/upload/receive, policy mutations (passkey policy <entry> <mode>,passkey policy --all,passkey config default-policy <mode>), explicit access-pass mutations (passkey access/passkey leasegrant & revoke), and plaintextpasskey export(exit code2).Loopback-Only Browser Broker:
passkey browser-fillverifies exact(scheme, host, port)ORIGINmatch over direct loopback CDP WebSockets (127.0.0.1) before injecting login fields outside LLM context.Honest Boundaries: Same-UID processes on an unlocked machine share user-level OS privileges (and on macOS
pipx/venv installs, Keychain ACLs bind to the underlyingpython3binary). See SECURITY.md for the full threat model and vulnerability reporting policy.
Supported MCP Clients & CLI Wrappers
Category | Supported Integrations |
MCP Clients ( | Claude Code ( |
Agent Hooks & Skills ( | Claude Code ( |
CLI Plugins ( |
|
Keep GITHUB_TOKEN, AWS_SECRET_ACCESS_KEY, ANTHROPIC_API_KEY, and OPENAI_API_KEY out of ~/.zshrc permanently with scoped CLI wrappers (session > .passkey.toml > global > auto):
passkey plugin init gh # Bind 'gh' CLI to your 'github' keychain entry
passkey plugin init aws --scope dir # Bind 'aws' per-repo inside committable .passkey.toml
passkey plugin run gh -- pr status # Injects GH_TOKEN & scrubs output streamsData Storage Locations
Platform | Metadata Directory ( |
macOS |
|
Linux |
|
Windows |
|
(Override anytime with PASSKEY_DATA_DIR. Upgrading passkey-mcp via pipx or uv tool preserves every stored keychain entry, policy, lease, and audit record.)
Documentation Wiki
Explore the complete documentation in docs/Home.md:
Guide | Topics Covered |
30-second architecture overview & "Choose Your Path" router | |
| |
Masked input shortcuts ( | |
| |
Connecting | |
Committable | |
Threat model, OS boundaries, | |
Loopback Chrome DevTools ( | |
All commands, subcommands, global flags, | |
All 13 FastMCP tools, schemas, | |
Fixes for macOS Keychain ACL prompts, Seatbelt sandboxes, Linux keyrings, stale FIFOs, and |
Essential Commands Cheat Sheet
passkey new <entry> # Create an entry via masked interactive prompt
passkey find <ENV_VAR> --json # Reverse-lookup which entry stores an env var
passkey request <entry> -f <VAR> --json # Capture/rotate a secret via native OS popup
passkey project init # Generate committable .env.passkey from .env.example
passkey exec -q -- <command> # Auto-inject repo manifest secrets with output masking
passkey run -q <entry> -- <command> # Inject explicit entry secrets into any command
passkey policy <entry> session # Require 1 Touch ID tap per 10m agent session
passkey policy --all session --exclude-mcp # Enable Session Touch ID while keeping MCP servers headless
passkey access # Interactive Access Menu (grant day pass, list, revoke, policy)
passkey access <entry> d # Grant an 8-hour workday pass with 1 Touch ID tap
passkey access --all d --exclude-mcp # Unlock all protected non-MCP entries for an 8h workday
passkey config default-policy session # Set default policy for new/requested/uploaded entries
passkey share <entry> # Copy encrypted pk1: share token + 8-word passphrase
passkey upload # Decrypt a pasted pk1: token into OS Keychain
passkey init # Migrate plaintext MCP server tokens to OS Keychain
passkey doctor --deep # Verify Keychain, PATH, configs, and HMAC audit chain
passkey audit --verify # Cryptographically verify tamper-evident audit.logDevelopment & License
Requires Python 3.10+ and uv (see CONTRIBUTING.md and docs/architecture.mmd):
uv sync
uv run pytest -q
uv run ruff check passkey/ tests/MIT License — see LICENSE and SECURITY.md.
Available Tools
13 toolspasskey_audit_recentARead-onlyIdempotent
Return recent sanitized audit log records with caller attribution.
Secret values and HMAC key material are never included.
Args: limit: Maximum number of recent records to return (default: 20, max: 100)
Returns: List of sanitized audit log entries (most recent first)
Inputs: limit. Returns: result
passkey_cdp_autofillA
Deterministically fill credentials into a local Chrome DevTools browser tab.
Disabled by default; enable explicitly via passkey config mcp-browser-broker on.
Verifies exact scheme + host + port match against the entry's ORIGIN config
before touching any secret fields, and never returns secret values.
Args: entry_name: Name of the passkey entry containing ORIGIN and credentials cdp_url: Loopback CDP WebSocket URL (e.g., ws://127.0.0.1:9222)
Returns: Dictionary with {"filled": bool, "origin": str, "fields_injected": [...]}
Inputs: cdp_url (required), entry_name (required).
passkey_doctorARead-onlyIdempotent
Run diagnostics on passkey and MCP configurations.
Checks for common issues including:
Config file existence and validity for all detected tools
Passkey command availability in PATH
Keychain access permissions
MCP servers with missing passkey entries
MCP servers with exposed secrets
(deep=True) entry age analysis and bundle file permissions
Args: deep: Include extended checks (entry age, bundle permissions)
Returns: Dictionary with diagnostic results
Inputs: deep.
passkey_entry_infoARead-onlyIdempotent
Inspect complete non-sensitive metadata for a passkey entry without exposing values.
Read-only: never triggers Touch ID, never decrements active lease uses, and never exposes secret or config values.
Args: entry_name: Name of the passkey entry (e.g., "stripe")
Returns: Dictionary with exists, policy ('allow', 'session', or 'prompt'), has_active_lease, will_prompt_biometric, fields (secret key names), config_keys, and timestamps.
Inputs: entry_name (required).
passkey_fieldsARead-onlyIdempotent
List field names in a passkey entry (without revealing values or logging a secret read).
Returns the names of secret fields stored in the specified entry.
Prefer passkey_entry_info when you also need config_keys, policy,
and has_active_lease.
Args: entry_name: Name of the passkey entry (e.g., "slack")
Returns: List of field names (e.g., ["SLACK_TOKEN", "SLACK_COOKIE"])
Raises: Exception: If entry not found or keychain access fails
Inputs: entry_name (required). Returns: result
passkey_findARead-onlyIdempotent
Reverse-lookup which passkey entries store given environment variable names.
Matches exact names, service-specific aliases (e.g., GH_TOKEN <-> GITHUB_TOKEN), and entry-scoped generic fields (e.g., RESEND_API_KEY -> resend/API_KEY) across both secret fields and config keys without reading or exposing values.
Args: vars: Environment variable names to find (e.g., ["RESEND_API_KEY", "GH_TOKEN"]) from_file: Optional path to a safe template file (e.g., ".env.example")
Returns: Dictionary with matches, results, resolved_entries, missing_vars, and suggested_run_command.
Inputs: vars, from_file.
passkey_listBRead-onlyIdempotent
List all available passkey entries.
Returns the names of all secret entries stored in the system keychain. Each entry can contain multiple key-value secret pairs.
Returns: List of entry names (e.g., ["slack", "github", "aws"])
Inputs: no named parameters. Returns: result
passkey_preflight_runARead-onlyIdempotent
Dry-run preflight for passkey run without spawning a process or exposing values.
Validates that all requested entries, --env-file mappings, passkey://
references, active leases, and optional command executable are ready.
Args: entries: Entry names to inject (e.g., ["stripe", "github"]) env_files: Optional dotenv/reference files to validate command: Optional command argv to verify executable availability
Returns: Secret-free preflight dictionary with ready, injected_env_vars, entries_missing, will_prompt_biometric, and remediation steps.
Inputs: entries (required), command, env_files.
passkey_project_statusARead-onlyIdempotent
Inspect repo secret manifest (.env.passkey / .passkey.toml), HMAC trust, and readiness.
Auto-discovers the project manifest up to the enclosing git root, verifies
whether its SHA-256 digest is trusted in trusted_projects.json, and
preflights all referenced entries and passkey:// URIs without exposing
any secret values.
Args: project_dir: Project directory to inspect (default: current directory) command: Optional command argv to verify executable availability
Returns: Secret-free dictionary with manifest_found, trusted, trust_status, ready, injected_env_vars, will_prompt_biometric, and remediation steps.
Inputs: command, project_dir.
passkey_request_secretAIdempotent
Prompt the human user via an out-of-band native OS hidden dialog to save or rotate secrets.
Opens a secure macOS/Linux password dialog directly on the user's desktop,
stores the entered value(s) straight into the OS keychain, and returns only
field names and status — secret values NEVER enter AI context or tool output.
Automatically skips fields that already exist unless overwrite=True or
an error/expiry reason is provided (which triggers a native rotation
notification + Passkey - Rotate Secret prompt and stamps last_rotated).
Args: entry_name: Keychain entry name to create or update (e.g., "stripe_dev") fields: Environment variable / field names to capture (max 10) policy: Optional access policy ('allow', 'session', or 'prompt'; defaults to default-policy; policy relaxations below an existing entry's policy or default-policy are rejected) hint: Optional short hint shown in the dialog (e.g., where to find the key) reason: Optional error/expiry reason (e.g., "401 Unauthorized: token expired") timeout: Seconds to wait before timing out (5-300, default: 120) overwrite: Re-prompt even if requested fields already exist
Returns: Secret-free dictionary with ok, status ('created'|'updated'|'already_exists'), entry, fields_saved, fields_present, policy, and optional rotated/last_rotated.
Inputs: fields (required), entry_name (required), hint, policy, +3 more.
passkey_statusARead-onlyIdempotent
Show security status of MCP servers across all detected tools.
Analyzes configs for Claude, Gemini, VS Code, Cursor, OpenCode, Windsurf, Cline, and Zed to identify which MCP servers have their secrets secured via passkey and which still have credentials exposed in plaintext.
Returns: Dictionary with per-tool server status and summary counts
Inputs: no named parameters.
passkey_validate_referencesARead-onlyIdempotent
Validate passkey:/// secret references in a template or env file.
Checks whether every referenced entry and field exists in the keychain without exposing any secret values, and reports prompt-gated entries lacking a lease.
Args: file_path: Path to a template or .env.passkey file containing passkey:// references
Returns: Dictionary with {"valid": bool, "checked": int, "missing": [...], "prompt_entries_without_lease": [...]}
Inputs: file_path (required).
passkey_wrap_serverAIdempotent
Update MCP config files to use passkey wrapper for a server.
Prerequisites: Entry must already exist in passkey keychain.
Args: server_name: Name of the server (must match passkey entry) config_paths: Config files to update (default: all detected configs)
Returns: - configs_updated: List of updated config paths - configs_skipped: List of configs where server not found - errors: Any errors encountered
Inputs: server_name (required), config_paths.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
The core actions (request_secret, wrap_server, list, find, audit_recent, cdp_autofill) are clearly distinct, but the set contains a cluster of overlapping read-only checkers: passkey_status, passkey_doctor, passkey_project_status, passkey_preflight_run, and passkey_validate_references all answer variations of 'is this configured/ready?'. passkey_fields also openly overlaps passkey_entry_info (its description even says to prefer entry_info for richer output), so an agent can reasonably hesitate between several tools.
All 13 tools share a consistent passkey_ prefix and snake_case, which makes them instantly recognizable as one family. There is minor word-order drift (verb_noun like passkey_request_secret / passkey_wrap_server versus noun-first like passkey_entry_info / passkey_project_status / passkey_audit_recent), but the style is readable and predictable overall.
13 tools sits squarely in the well-scoped range, and each one maps to a recognizable stage of the secret-management workflow (capture, discover, validate, wrap, audit, autofill). Nothing looks like filler, and the surface is not so large that selection becomes a burden.
Creation/rotation, listing, lookup, validation, wrapping, diagnostics, and auditing are covered thoroughly, but lifecycle teardown is missing: there is no delete/remove entry tool, no way to change an entry's policy after creation, and no lease acquire/release management despite leases being referenced throughout. Agents hitting those needs will dead-end and have to fall back to the CLI.
Maintenance
Related MCP Connectors
Secrets for developers and agents—secure context and workflows without exposing secret values.
Encrypted secret store and rotation for autonomous agent credentials
Encrypted store for API keys and database URLs your code needs. Use them without reading them.
A vault for .env files and project credentials: one encryption key per project, a second factor before protected values open, an audit row for every reveal, and scoped MCP access for coding agents.
Related MCP Servers
- AlicenseAqualityFmaintenanceA GitHub-native secrets manager that allows AI assistants to securely manage, generate, and validate credentials without exposing sensitive values in conversation history. It supports secret scanning, environment diffing, and secure command execution by injecting masked variables directly into the runtime environment.810 npm2MIT
- AlicenseCqualityCmaintenanceEnables AI agents to securely store and manage encrypted secrets locally while using them indirectly through environment-variable injection or file writes, so plaintext values never enter the agent's context.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to securely inject API keys and secrets into environment files, configs, or commands without the agent ever seeing the secret values.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables Claude Code to use locally encrypted, multi-tenant credentials by running commands with injected secrets, writing .env files, materializing files, and making HTTP requests, while scrubbing values from all output so they never enter the chat. Also supports sealed retrieval and saving through native dialogs or an auto-clearing clipboard, role-based credential selection, versioning, rollback, archiving, and a full audit log.MIT