Secret written in the config
High secret-in-config
A value in env, headers, args or the URL looks like an API key or token. Config files get committed, synced, pasted into chats and read by every tool on the machine; a key written in them is as exposed as the file.
Why it matters
MCP clients start each local server with the environment variables and arguments written in the config, so it is tempting to paste an API key straight into "env". The config file then holds a live credential. It ends up in dotfile repositories, in project folders committed to Git (.mcp.json, .cursor/mcp.json and .vscode/mcp.json are meant to be shared), in screenshots and in support chats. Any extension or tool that can read your home folder can read it too.
How to fix it
Reference an environment variable (or your client's input or secret store) instead of the value, and rotate the key if the file was ever committed or shared.
Most clients can read a value from the environment or prompt for it: Claude Code expands ${VAR} in .mcp.json, VS Code supports ${env:VAR} and "inputs" that prompt once and store the value securely, and remote servers increasingly use OAuth so no token is written at all. If a key was ever committed, rotate it: removing it from the file does not remove it from the history.
Before
"env": { "GITHUB_TOKEN": "ghp_1a2b3c..." }
After
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
Applies to every MCP client that reads a JSON config: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and others.
Other checks
Related free tools
Published ; awaiting review.