# MCP config generator

Describe an MCP server once and get the exact config, file path and install command for Claude Desktop, Claude Code, Codex, VS Code and Cursor. It runs in your browser, needs no signup and stores nothing.

Use the tool: https://agentshandbook.com/tools/mcp-config-generator (runs in the browser).

## How to use it

1. **Describe the server.** Pick a preset, or enter a name and either the command that starts a local server or the URL of a remote one. Write secrets as ${NAME} and they stay out of the file.
2. **Copy it into your client.** Pick your client. Copy or download the block and save it at the path shown, or run the command, or click the install link.
3. **Restart and check.** Quit the client fully and open it again. Then check the server list: /mcp in Claude Code, codex mcp list in Codex, MCP: List Servers in VS Code, the MCP settings in Cursor.

## Questions

### Where is the Claude Desktop MCP config file?

On macOS it is ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows it is %APPDATA%\Claude\claude_desktop_config.json. Open it from Claude Desktop with Settings, Developer, Edit Config. Local servers go under the mcpServers key, and you must quit and reopen Claude after each change. Remote servers do not go in this file: add them under Customize, Connectors, Add custom connector.

### How do I add an MCP server to Claude Code globally?

Run claude mcp add with --scope user, for example: claude mcp add --scope user --transport http sentry https://mcp.sentry.dev/mcp. The default scope is local (this project, only you). --scope project writes .mcp.json at the repo root so your team gets the server too.

### What is the difference between mcp.json in VS Code and in Cursor?

VS Code's .vscode/mcp.json puts servers under the key servers and needs a type (stdio or http) on each one. Cursor's .cursor/mcp.json and ~/.cursor/mcp.json use mcpServers. A file copied from one to the other loads no servers and shows no error.

### How do I add an MCP server to Codex?

Codex reads TOML from ~/.codex/config.toml, or .codex/config.toml in a trusted project. Each server is a [mcp_servers.name] table with command and args, or url for a remote server. You can also run codex mcp add name -- command args. There is no type field: url means HTTP, command means stdio.

### How do I keep API keys out of my MCP config?

Reference an environment variable instead of pasting the key. Claude Code reads ${NAME} in .mcp.json. Cursor reads ${env:NAME}. VS Code can prompt once with ${input:id} and store the value. Codex forwards variables listed in env_vars and reads bearer tokens with bearer_token_env_var. Claude Desktop does not expand variables, so its file holds the value itself.

### Why does my MCP server fail with spawn npx ENOENT?

The client cannot find npx. Desktop apps start without your shell PATH, so a command that works in your terminal can fail there. Run which npx and put that full path in command. On native Windows, Claude Code needs cmd /c in front of npx.

### My config looks right, so why do no MCP servers load?

Usually the JSON does not parse. One trailing comma or curly quote makes the client skip every server in the file. Paste the file into the checker on this page. The other common causes are the wrong top-level key for the client and not quitting the app fully before you test.

## Sources

- [Connect to local MCP servers (Claude Desktop)](https://modelcontextprotocol.io/docs/develop/connect-local-servers) (checked 2026-10-30)
- [Custom connectors with remote MCP (Claude Help Center)](https://support.claude.com/en/articles/11175166) (checked 2026-10-30)
- [Connect to remote MCP servers (Claude)](https://modelcontextprotocol.io/docs/develop/connect-remote-servers) (checked 2026-10-30)
- [Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp) (checked 2026-10-30)
- [Codex: Model Context Protocol](https://developers.openai.com/codex/mcp) (checked 2026-10-30)
- [VS Code: MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) (checked 2026-10-30)
- [VS Code: MCP install links (developer guide)](https://code.visualstudio.com/api/extension-guides/ai/mcp) (checked 2026-10-30)
- [Cursor: Model Context Protocol](https://cursor.com/docs/context/mcp) (checked 2026-10-30)
- [Cursor: MCP install links](https://cursor.com/docs/mcp/install-links) (checked 2026-10-30)

## Related playbooks

- [Test your local web app in a real browser and fix console errors in one loop](https://agentshandbook.com/p/test-local-web-app-in-browser-and-fix-console-errors.md)
- [Triage a production error from Sentry or logs into a tested fix pull request](https://agentshandbook.com/p/triage-production-error-into-a-fix-pr.md)
- [Move pages that rank on page two of Google onto page one with Search Console data](https://agentshandbook.com/p/move-pages-from-page-two-onto-page-one.md)
- [Run a weekly SEO agent that checks your site and opens fixes for you to review](https://agentshandbook.com/p/run-a-weekly-seo-agent-that-proposes-fixes.md)
- [Build a small internal automation with n8n's AI builder and test it before it goes live](https://agentshandbook.com/p/build-an-internal-automation-with-n8n-ai.md)
- [Do a literature review with an agent that finds, screens and summarises real papers](https://agentshandbook.com/p/do-a-literature-review-of-papers-on-a-topic.md)

## Lessons

- [Scheduled agents break quietly when a connector or node version changes](https://agentshandbook.com/lessons/connector-updates-silently-break-scheduled-agents.md)

More free tools: https://agentshandbook.com/tools.md