Phantom Secrets MCP Server
Integrates with Windsurf (by Codeium) to manage secrets via the Phantom MCP server, providing tools for secret operations and diagnostics.
Integrates with GitHub Copilot to manage secrets via the Phantom MCP server, enabling secure secret management within the AI coding assistant.
Click on "Install 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., "@Phantom Secrets MCP Serverinitialize secrets for my project"
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.
Delegate everything to AI. Without sharing a single key.
Phantom hands every AI tool a worthless phm_ token. The local proxy injects the real key at the network layer. Full access. Zero exposure.
Quick start · Why Phantom? · MCP setup · Docs · phm.dev
▶ Watch the 45-second demo · 🛡 Security model · 📋 Threat model · 💬 Discussions
Why Phantom?
AI coding agents read your .env files. Once a real API key enters an LLM's context window, it leaks — via prompt injection, session logs, malicious MCP servers, or training data. GitGuardian reports AI-assisted commits leak secrets at 2× the baseline rate.
Every other secrets manager protects keys at rest and in transit. Phantom protects them in context:
🔒 Real keys never enter the LLM —
.envcontains onlyphm_tokens; the proxy swaps them at the network edge.⚡ 10-second setup —
npx phantom-secrets initand you're protected. No accounts, no DNS, no MITM cert dance.🧰 Works with every AI tool — Claude Code, Cursor, Windsurf, Codex, GitHub Copilot. Anything that reads
.env.🦀 Open source, local-first, MIT — your secrets live in your OS keychain. The optional cloud sync is end-to-end encrypted; the server only ever sees ciphertext.
Used by developers who don't want to choose between delegating to AI and not pasting their Stripe key into a chat window.
Related MCP server: Kova Mind MCP Server
Quick Start
$ npx phantom-secrets init
# Auto-detects .env, .env.local, or .env in subdirectories
# Stores real secrets in OS keychain, rewrites .env with phantom tokens
# Auto-configures Claude Code MCP server if detected
$ phantom agent doctor
# One human-readable readiness check for AI-agent safety
$ phantom exec -- claude
# Authenticated proxy running on 127.0.0.1:54321
# AI sees phantom tokens; proxy injects real keysWindows
The same commands work on Windows. npx phantom-secrets init installs via npm as on macOS/Linux.
After phantom start --daemon, the CLI detects your shell and prints the matching env-var syntax. For reference:
PowerShell:
$env:OPENAI_BASE_URL = "http://127.0.0.1:PORT/openai/_phantom/TOKEN/"
$env:PHANTOM_PROXY_PORT = "PORT"
$env:PHANTOM_PROXY_TOKEN = "TOKEN"cmd.exe:
set OPENAI_BASE_URL=http://127.0.0.1:PORT/openai/_phantom/TOKEN/
set PHANTOM_PROXY_PORT=PORT
set PHANTOM_PROXY_TOKEN=TOKENGit Bash / WSL: use the export X=Y syntax from the main quick-start.
Notes:
PHANTOM_PROXY_TOKENis the proxy session authenticator. By default,phantom execandphantom startinclude it in local*_BASE_URLvalues as/_phantom/TOKEN/so unmodified SDKs work. Header-aware clients can setPHANTOM_PROXY_HEADER_AUTH_ONLY=1and sendx-phantom-proxy-token: $PHANTOM_PROXY_TOKENinstead.If
phantom.exefails to run with "Application Control policy has blocked this file," Windows Smart App Control is honoring the downloaded file's Mark-of-the-Web tag. One-time fix from PowerShell:Get-ChildItem "$env:USERPROFILE\.phantom-secrets\bin\*.exe" | Unblock-File.The pre-commit hook installed by
phantom initis a#!/bin/shscript. Native git from the command line invokes it via Git for Windows' bundledsh.exe, which is what the official Git for Windows installer ships. GUI clients (GitHub Desktop, some IDE integrations) may run with a stripped-downPATHthat lackssh.exeand silently skip the hook — for these, run commits from a terminal, or usephantom check --stageddirectly. CI is the durable safety net regardless.Windows-on-ARM64 not yet packaged — x64 only. Tracker: #1.
How It Works
.env file (safe to leak) OS Keychain / Vault
+--------------------------+ +---------------------+
| OPENAI_API_KEY=phm_a7f3 | ---> | sk-real-secret-key |
| STRIPE_KEY=phm_c9d1... | | sk_live_real-key... |
+--------------------------+ +---------------------+
| |
v v
AI Agent (Claude, Cursor) Phantom Proxy (127.0.0.1)
+--------------------------+ +------------------------------+
| Reads .env | | Intercepts HTTP requests |
| Sees only phm_ tokens | ---> | Replaces phm_ with real keys |
| Makes API calls to proxy | | Forwards over TLS to real API|
+--------------------------+ +------------------------------+phantom initreads.env, stores real secrets in the OS keychain, rewrites.envwithphm_tokensphantom exec -- claudestarts a local reverse proxy, sets SDK-compatible service base URLs such asOPENAI_BASE_URL=http://127.0.0.1:PORT/openai/_phantom/TOKEN/, exposesPHANTOM_PROXY_TOKENto the child process, and launches the commandAPI calls hit the proxy, which authenticates the local session, removes the local auth token before forwarding, replaces phantom tokens with real secrets, and forwards over TLS
When the session ends, the proxy shuts down and the proxy session token is invalid. Phantom tokens remain worthless placeholders outside an authenticated proxy session.
MCP Integration (Claude Code, Cursor, Windsurf, Codex)
Phantom ships an MCP server so AI coding tools can manage secrets directly -- without ever seeing real values.
Vault —
phantom_list_secrets,phantom_status,phantom_init,phantom_add_secret_interactive,phantom_add_secret(deprecated; refuses plaintext),phantom_remove_secret,phantom_rotate,phantom_copy_secretDetection + diagnostics —
phantom_doctor,phantom_why,phantom_check,phantom_envLocal-to-cloud —
phantom_wrap,phantom_unwrap,phantom_sync,phantom_cloud_push,phantom_cloud_pull,phantom_cloud_statusTeams —
phantom_team_list,phantom_team_create,phantom_team_members,phantom_team_invite,phantom_team_key_publish,phantom_team_vault_push,phantom_team_vault_pull
Mutating tools require an explicit confirm: true parameter so a prompt-injected agent can't silently mutate state. Real secret values are never accepted as MCP tool arguments; new secrets are entered out-of-band in a trusted terminal.
One command per AI client — Phantom writes the right config file in the right place:
phantom setup --client claude # .claude/settings.local.json (project)
phantom setup --client cursor # ~/.cursor/mcp.json
phantom setup --client windsurf # ~/.codeium/windsurf/mcp_config.json
phantom setup --client codex # ~/.codex/config.toml
phantom setup --client claude --print # snippet to stdout for any other clientIf phantom-mcp isn't on PATH, Phantom falls back to npx -y phantom-secrets-mcp so the config still works on a fresh machine. Restart the AI tool after running phantom setup so it picks up the new config.
Phantom works with any tool that supports the Model Context Protocol.
Cloud Sync + Dashboard
Sync vaults across machines with end-to-end encryption. The server never sees plaintext.
$ phantom login
# Opens GitHub OAuth (device code flow)
$ phantom cloud push
# Encrypted client-side, uploaded to phm.dev
$ phantom cloud pull # on another machine
# Downloaded and decrypted locally
$ phantom open
# Opens https://phm.dev/dashboard — read-only view of your projects,
# vault sizes, last sync, plan tier, and team membership.Cloud sync uses ChaCha20-Poly1305 with a client-side passphrase derived via Argon2id. The server stores only ciphertext.
Team vaults (Pro)
Multiple developers can share a single E2E-encrypted vault per project. Server only ever stores ciphertext + per-member ciphertext shares.
$ phantom team create "engineering"
# Creates a team; you become the owner.
$ phantom team invite <team_id> <github-username>
# Invites by GitHub login.
$ phantom team key-publish <team_id>
# Registers your X25519 public key on the team.
# (Run once per team; the private key stays in the OS keychain.)
$ phantom team vault-push <team_id>
# Encrypts the current project's vault with a fresh symmetric key,
# wraps that key (X25519 + ChaCha20-Poly1305) for every member that
# has a registered public key, then uploads.
$ phantom team vault-pull <team_id> # on a teammate's machine
# Pulls, decrypts the per-member share with their private key,
# decrypts the vault, writes secrets locally.Team memberships and member lists are visible in the read-only dashboard at phm.dev/dashboard/team.
Command Reference
Command | Description |
| Import |
| Start an authenticated proxy and run a command with secret injection |
| Manage proxy lifecycle (standalone/daemon mode) |
| Show secret names stored in vault (never values; |
| Add a secret. With no |
| Remove a secret from the vault |
| Print a secret value (or |
| Show proxy state, vault info, and mapped services |
| Regenerate all phantom tokens (old ones become invalid) |
| Check configuration and vault health ( |
| Emit a read-only AI-agent readiness report ( |
| Human-readable agent readiness view backed by the same policy engine |
| Preview or apply safe defaults for agent use ( |
| Scan for unprotected secrets (pre-commit hook, |
| Push secrets to Vercel / Railway ( |
| Pull secrets from Vercel / Railway into vault |
| Wire Phantom into an AI client. |
| Generate |
| Export vault to encrypted backup file ( |
| Import from encrypted backup ( |
| Print recent audit events ( |
| Follow the audit log live ( |
| Print the absolute path to the audit log file |
| Verify HMAC-SHA256 chain integrity; exits 1 if tampering detected |
| Authenticate with Phantom Cloud via GitHub OAuth |
| Clear cloud credentials |
| Push encrypted vault to Phantom Cloud |
| Pull and decrypt vault from Phantom Cloud |
| Wrap package.json scripts with |
| Restore original package.json scripts |
| Watch .env files and auto-detect new unprotected secrets |
| Explain why a key is or is not protected |
| Copy a secret to another project's vault |
| Team vault management |
| Register your X25519 pubkey on a team (once per team) |
| Push current project to shared team vault (E2E encrypted per-member) |
| Pull team vault into local vault |
| Open phm.dev pages in browser (dashboard, billing, team, docs, github, …) |
| Self-replace this binary with the latest GitHub release ( |
| Print a shell-completion script (bash, zsh, fish, powershell, elvish) |
Features
Encrypted vault -- OS keychain (macOS Keychain / Secure Enclave, Linux Secret Service, Windows Credential Manager) with encrypted file fallback for CI/Docker. Argon2id hardened to OWASP balanced (m=64 MiB, t=3, p=1)
Phantom tokens -- 256-bit CSPRNG
phm_placeholders in.env, rotatable on demandAuthenticated proxy sessions -- each proxy run generates a fresh
PHANTOM_PROXY_TOKEN; CLI-generated SDK URLs include it for compatibility, and header-aware clients can opt intox-phantom-proxy-tokenwithPHANTOM_PROXY_HEADER_AUTH_ONLY=1Streaming token replacement -- For
text/*andapplication/x-www-form-urlencodedrequest bodies, phantom tokens are replaced frame-by-frame without buffering the full payload; a 67-byte carry buffer handles tokens that straddle chunk boundaries. JSON bodies use a buffered path to preserve field-level F9 scoping.Full SSE/streaming support -- Response streaming preserved end-to-end for OpenAI, Anthropic, and other streaming APIs
Smart detection -- Heuristic engine distinguishes secrets (
*_KEY,*_TOKEN,sk-*,ghp_*) from config (NODE_ENV,PORT)Platform sync -- Push/pull secrets to Vercel and Railway
Pre-commit hook -- Blocks commits containing unprotected secrets
MCP server -- 25 tools for Claude Code, Cursor, Windsurf, and Codex to manage secrets without seeing values
Cloud sync -- E2E encrypted zero-knowledge vault sync across machines
Export/import -- Encrypted backup and restore (
--passphrase); plaintext JSON export to stdout (--json --allow-plaintext); import from Doppler, Infisical, dotenvx, 1Password, or plain.envvia--fromTamper-evident audit log --
PHANTOM_AUDIT=1writes vault events as JSONL to~/.phantom/audit.log. Each entry is chained with HMAC-SHA256;phantom audit verifydetects tampering.phantom audit show/tail/pathfor log access.Response scrubbing -- Prevents secrets from leaking in API responses back to the AI
Script wrapping --
phantom wrappatches package.json so every npm script runs through the proxyWatch mode --
phantom watchmonitors .env files for new unprotected secretsMulti-project scanner --
phantom init --all <DIR>protects every git repo with a.envunder<DIR>in one command (with--dry-run);--jobs Ncontrols parallelismMulti-IDE setup --
phantom setup --client claude|cursor|windsurf|codexwrites the right MCP config for each AI tool, or--printfor a generic snippetAgent readiness --
phantom agent doctorandphantom agent report --jsonanswer whether a repo is safe for Claude Code, Codex, Cursor, Windsurf, and other agentsEnriched diagnostics --
phantom doctorreports install source, vault backend, audit-log status, Argon2 params, and MCP wiring per clientSecret explainer --
phantom why <KEY>explains detection heuristicsCross-project copy --
phantom copyshares secrets between project vaultsTeam vaults -- Shared vaults with role-based access control
Built-in service routing -- OpenAI, Anthropic, Stripe, Supabase, and custom services via
.phantom.tomlThreat model -- See THREAT_MODEL.md for assets, actors, mitigations, and known gaps
Installation
npm (recommended)
$ npm install -g phantom-secretsOr use directly with npx:
$ npx phantom-secrets initClaude Code MCP
$ claude mcp add phantom-secrets-mcp -- npx phantom-secrets-mcpCargo
$ cargo install phantom-secretsArchitecture
5-crate Rust workspace + Next.js cloud backend:
Crate | Role |
| Config ( |
|
|
| HTTP reverse proxy on 127.0.0.1. Streaming token replacement for |
|
|
| MCP server binary ( |
apps/web -- Next.js backend at phm.dev for cloud vault sync, GitHub OAuth, and Stripe billing.
npm packages: phantom-secrets (CLI), phantom-secrets-mcp (MCP server).
CI runs the Rust test suite and clippy across the workspace before release.
Security
Secrets never on disk in your project directory -- real values live only in the OS keychain or encrypted vault
ChaCha20-Poly1305 encryption for file vault and cloud sync, Argon2id key derivation
Zero-knowledge cloud -- server stores only ciphertext; encryption key never leaves the client
256-bit CSPRNG tokens --
phm_prefix ensures they never collide with real API key formatsProxy binds 127.0.0.1 only -- never exposed to the network
Secrets zeroized from memory after injection via the
zeroizecrateAllowlist model -- proxy only injects secrets for explicitly configured service patterns
See SECURITY.md for the responsible disclosure policy and THREAT_MODEL.md for the full threat model (assets, actors, mitigations, known gaps, cryptography summary).
Pricing
Free | Pro | Enterprise | |
Local vaults | Unlimited | Unlimited | Unlimited |
Cloud vaults | 1 | Unlimited | Unlimited |
MCP server | Yes | Yes | Yes |
Cloud sync | Yes | Yes | Yes |
Team features | -- | -- | Yes |
Price | $0 | $8/mo | Contact us |
Links
phm.dev -- Cloud dashboard and account management
Contributing
We love PRs. Start with CONTRIBUTING.md, pick a good first issue, or open a discussion to talk through an idea. Be excellent to each other — see CODE_OF_CONDUCT.md.
Star history
If Phantom saves you from leaking a key — or even just from worrying about it — please star the repo ⭐. It's the single biggest signal we use to know what to build next.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceProvides AI coding agents with direct access to secrets management (get, set, list, delete secrets, and list environments) through the Model Context Protocol, enabling secure secret operations during development.Last updated9MIT

Kova Mind MCP Serverofficial
AlicenseAqualityDmaintenanceEnables AI memory persistence and secure credential management via vault tools for MCP-compatible clients like Claude Desktop, Cursor, and VS Code.Last updated1231MIT- Alicense-qualityCmaintenanceEnables AI agents to manage secrets and credentials from a secure vault via MCP tools over stdio.Last updatedMIT
- Alicense-qualityDmaintenanceEnables AI agents to securely manage API keys and secrets via the MCP protocol, with encrypted storage at rest and a simple CLI and Python SDK.Last updatedMIT
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Shared long-term memory vault for AI agents with 20 MCP tools.
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ashlrai/phantom-secrets'
If you have feedback or need assistance with the MCP directory API, please join our Discord server