API keys out of VS Code’s mcp.json
VS Code has the best built-in answer of the lot: it asks for the key and stores it securely. Here’s how to use it, and when you need no key at all.
The problem
Workspace config is shared config
The solution
MoltenRock Connect
Prompted keys, or no key at all
The short answer
VS Code reads MCP servers from .vscode/mcp.json in a workspace or from your user profile. Its inputs array lets a server definition use ${input:id}: with type promptString and password: true, VS Code asks for the key the first time the server starts, hides what you type and stores it securely, so the file never holds it. envFile can also load variables from a file. For business platforms, an agent that can run commands on your Mac can use MoltenRock Connect, which holds the keys itself.
The problem
Where it goes wrong
- .vscode/mcp.json travelsA key written into a workspace config goes wherever the repository goes.
- envFile is still a fileA .env file keeps the key out of mcp.json, not off the disk.
- One key per serverEvery server is another secret to rotate and another package to trust.
The solution
MoltenRock Connect: Prompted keys, or no key at all
- Inputs with password: trueVS Code asks once, hides the value and stores it securely; mcp.json only names the input.
- Business tools through ConnectAn agent that can run commands on your Mac talks to MoltenRock Connect’s local socket: 30 platforms, no key.
- Answers, not keysConnect returns data, with customer names and addresses as tokens.
- Changes wait for youOn Stripe, Cloudflare and GitHub, the agent can only propose; you approve with Touch ID.
Side by side
Where a VS Code MCP key can live
| Option | What’s in mcp.json | Good for |
|---|---|---|
| The key in env or headers | The key itself, in plain text | A quick test, then remove it |
| An input with password: true | An input id; VS Code stores the value securely | Any MCP server in VS Code |
| envFile | A path to a .env file holding the key | Keys you already keep in .env |
| MoltenRock Connect | Nothing: the agent uses Connect’s local socket | Its 30 business platforms |
How it works
Clean up VS Code’s mcp.json
- 01Find the keysCheck .vscode/mcp.json in each workspace and the mcp.json in your user profile for env values and headers.
- 02Turn keys into inputsAdd an inputs entry with "type": "promptString" and "password": true, and use "${input:your-id}" where the key was.
- 03Point the agent at ConnectIn MoltenRock Connect → Settings → Agent Setup → Other agents, copy the note for your agent.
- 04Rotate what was in the fileAny key that sat in a config file may have been copied, synced or shared. Make a new one and revoke the old.
Straight answer
What this fixes, and what it doesn’t
Stays on your Mac
- Platform keys, in Connect or MoltenRock’s vault
- Other servers’ keys, in VS Code’s secure input storage
- An mcp.json with nothing secret in it
Leaves your Mac
- Connect’s calls from your Mac to each platform
- Answers, to your agent and its model
- MoltenRock Connect covers its 30 business platforms (Stripe, Shopify, WooCommerce, GitHub, Cloudflare and more). An MCP server for anything else still needs its own key: keep that one in the Keychain.
Questions
What people ask first
How do I keep an API key out of VS Code’s mcp.json?
Define an input with type promptString and password: true, and reference it as ${input:id}. VS Code asks the first time the server starts and stores the value securely.
Where is mcp.json in VS Code?
.vscode/mcp.json in a workspace, or in your user profile.
Can VS Code’s agent use MoltenRock Connect?
Connect’s documented routes are MCP for Claude Code, Claude Desktop and Cursor, and its local socket for any agent that can run commands on your Mac. Use the socket note from Agent Setup → Other agents.
What does it cost?
Connect is free for two platforms; one $9.99 unlock opens all 30, and MoltenRock Pro includes it.
Prompted keys, or none at all.
MoltenRock Connect is free for Mac.