How to keep your API key out of mcp.json
Leave the key out of the file. Either run npx @clearrun/cli login once, which the MCP server reads, or reference an environment variable. In VS Code, use "${env:CLEARRUN_API_KEY}".
Last updated
Steps
Save the key with the CLI
npx @clearrun/cli loginThe MCP server reads the same
~/.config/clearrun/config.json.Drop the env block
{ "mcpServers": { "clearrun": { "command": "npx", "args": ["-y", "@clearrun/mcp"] } } }Or, in VS Code, reference the variable
"env": { "CLEARRUN_API_KEY": "${env:CLEARRUN_API_KEY}" }
Also
Use the user-level config (such as ~/.cursor/mcp.json) for anything with a key in it, and keep the project file key-free.