MCP Config Generator and Validator
Build a working MCP config file for Claude Desktop, Cursor, VS Code, Claude Code, Windsurf or Codex, or paste the one you have and see exactly why it does not load.
The generator writes claude_desktop_config.json, mcp.json, .mcp.json or Codex's TOML config.toml with correctly escaped absolute paths. The validator reports the line and column of each problem and can rewrite the file for another host. Everything runs in your browser.
Generate an MCP config file
Validate and fix an MCP config
Where each host keeps its MCP config
The six hosts agree on the idea (a name, a command and its arguments) but not on the details. These are the differences the generator handles for you:
| Host | File | Top-level key | Remote server |
|---|---|---|---|
| Claude Desktop | claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\) | mcpServers | Not in this file: use Settings > Connectors, or npx mcp-remote |
| Cursor | ~/.cursor/mcp.json or .cursor/mcp.json | mcpServers | "url" plus optional "headers" |
| VS Code | .vscode/mcp.json or the user profile | servers | "type": "http" and "url" |
| Claude Code | .mcp.json in the project root | mcpServers | "type": "http" and "url" (a url without type is skipped) |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | mcpServers | "serverUrl" ("url" also accepted) |
| Codex (CLI, IDE extension, ChatGPT desktop app) | ~/.codex/config.toml or .codex/config.toml in a trusted project (TOML, not JSON) | [mcp_servers.<name>] tables | url plus bearer_token_env_var or http_headers |
VS Code also accepts comments and trailing commas in its file. The other JSON hosts read strict JSON, so a file that works in VS Code can fail when you copy it to Cursor. Use Fix & convert to move a config between hosts, including from JSON to Codex TOML and back.
Codex MCP config: config.toml instead of mcp.json
Codex stores MCP servers in TOML, in the same config.toml as its other settings. The CLI, the IDE extension and the ChatGPT desktop app share the file, so one entry works in all three. Pick Codex (config.toml) above and the generator writes this for a generated TypeScript project and a remote server with a token:
[mcp_servers.weather-helper]
command = "/Users/me/weather-helper/node_modules/.bin/tsx"
args = ["/Users/me/weather-helper/src/index.ts"]
[mcp_servers.weather-helper.env]
API_KEY = "your-key"
[mcp_servers.docs]
url = "https://mcp.example.com/mcp"
bearer_token_env_var = "DOCS_TOKEN"
Paste it into ~/.codex/config.toml (keep your other settings; the generator can merge into the file you paste in the optional box), start a new session and run /mcp. The CLI equivalent is codex mcp add weather-helper --env API_KEY=your-key -- /Users/me/weather-helper/node_modules/.bin/tsx /Users/me/weather-helper/src/index.ts, which writes the same tables.
mcp.json to config.toml: what changes
| JSON hosts (mcp.json) | Codex config.toml | Note |
|---|---|---|
"mcpServers": { "name": { ... } } | [mcp_servers.name] | snake_case; a [mcpServers.x] table is ignored |
"env": { "K": "v" } | [mcp_servers.name.env] with K = "v" | Values must be strings; a number stops Codex from loading the file |
"headers": { "Authorization": "Bearer ${env:TOKEN}" } | bearer_token_env_var = "TOKEN" | Other headers go in http_headers or env_http_headers; headers is silently ignored |
"type": "stdio" / "http" | (none) | Codex uses stdio when command is set and streamable HTTP when url is set |
"disabled": true | enabled = false | disabled is ignored |
"timeout" | startup_timeout_sec (default 10), tool_timeout_sec (default 60) | Numbers without quotes |
"C:\\Users\\me\\x.exe" | "C:\\Users\\me\\x.exe" or 'C:\Users\me\x.exe' | In double quotes \U starts a Unicode escape, so single backslashes fail |
Codex-only options such as enabled_tools, disabled_tools, default_tools_approval_mode (auto, prompt, writes or approve) and env_vars (forward variables from your shell instead of writing secrets into the file) are kept when you convert between Codex files and checked by the validator. Source: the Codex MCP documentation.
Tested 2026-10-23 with codex-cli 0.164.0: every config.toml in our test set loads with codex mcp list (generated stdio, Windows-path and remote entries, a merge into an existing file with other settings and comments, and JSON converted to TOML, including the broken example on this page). We also fed Codex the mistakes above. Duplicate tables, args as a string, command and url together, a quoted timeout, an unknown approval mode and a non-string env value each stopped Codex from loading the whole file. headers, disabled and a [mcpServers] table loaded without an error and did nothing. The validator reports all of them.
What the validator checks
- JSON syntax with line and column: trailing commas, comments, curly quotes, missing commas or braces, and single backslashes in Windows paths. It also catches
"C:\new", which is valid JSON but turns\ninto a line break. - Duplicate server names.
JSON.parsekeeps the last one without a warning, so an earlier server disappears. - Structure for the chosen host:
mcpServersversusservers, a bare server entry with no wrapper, a missingcommandorurl, and an unknowntype. - Launch problems: a whole shell line in
command,argswritten as a string,npxwithout-y, a barepythonthat may lack themcppackage,npm startbanners on stdout, relative script paths and~. - Values: non-string env values, empty or placeholder values such as
<your key>, and tokens that look real in files that usually get committed. - Codex config.toml: TOML syntax with the line number (duplicate tables and keys,
:instead of=, unquoted strings, bad escapes in Windows paths), JSON pasted where TOML is expected, keys Codex ignores (headers,type,disabled,serverUrl),commandandurltogether, and the types of timeouts,enabledanddefault_tools_approval_mode.
A clean result means the file is well formed and every entry can be launched as written. It cannot tell whether the program at that path exists on your machine. For that, run the server under the MCP Inspector first; the testing guide shows how.
How we tested the output
On 2026-10-19 we generated one TypeScript and one Python server with the MCP Server Generator, installed both, and produced configs for all five hosts with this page's code. Each config parsed with JSON.parse, passed the validator with zero errors, and launched its server from the exact command and args it contains; an MCP client then listed the tools and called them. We also ran 23 deliberately broken configs through the validator and each problem was reported; Fix & convert turned the broken example on this page into a file with zero errors for all five hosts.
Need a server to put in the config?
Describe your tools in a form and download a TypeScript or Python MCP server with typed parameters and a README. Free, no account, no OpenAPI.
FAQ
How do I write a Windows path in claude_desktop_config.json or mcp.json?
Double every backslash: C:\\Users\\me\\weather\\.venv\\Scripts\\python.exe. A single backslash either breaks the JSON or, in sequences such as \n and \t, silently becomes a line break or tab. Pick Windows in the generator and paste the folder as Explorer shows it; the output is escaped for you. Forward slashes (C:/Users/me/...) also work for most commands.
What is the difference between Cursor mcp.json and VS Code mcp.json?
Both are named mcp.json, but Cursor lists servers under mcpServers (in ~/.cursor/mcp.json or .cursor/mcp.json), while VS Code's .vscode/mcp.json uses a top-level servers object and a type on each entry. Copying one into the other is the most common reason a server silently does not load. The validator flags it and the converter rewrites it.
Why does my MCP config say invalid JSON?
The usual causes are a trailing comma after the last entry, a comment, curly quotes pasted from a document, or a Windows path with single backslashes such as C:\Users\me. JSON needs each backslash written as \\. Paste the file into the validator: it shows the line and column, and Fix & convert repairs all four.
Can I add a remote MCP server URL to Claude Desktop's config file?
claude_desktop_config.json launches local commands. Add remote servers in Claude Desktop under Settings > Connectors, or bridge the URL through a local command: npx -y mcp-remote https://example.com/mcp. The generator writes that bridge entry for you when you pick Claude Desktop and a remote URL.
Should I put API keys in mcp.json?
Only in files that stay on your machine. Project files such as .cursor/mcp.json, .vscode/mcp.json and .mcp.json are often committed to git. Reference an environment variable instead, for example ${env:API_TOKEN} in Cursor and VS Code or ${API_TOKEN} in Claude Code. The validator warns when a value looks like a real token.
Is anything I paste uploaded?
No. The generator and validator run as JavaScript in your browser. Nothing you paste is sent to a server, and there is no account or API key.
How do I add an MCP server to Codex?
Codex (the CLI, the IDE extension and the ChatGPT desktop app) reads MCP servers from ~/.codex/config.toml, or .codex/config.toml in a trusted project. Each server is a [mcp_servers.<name>] table with command and args for a local server, or url for a remote one. Pick Codex in the generator to get that block, or run codex mcp add <name> -- <command>. Then start a new session and run /mcp.
How do I convert mcp.json to Codex config.toml?
Paste the JSON into the validator and choose Codex under Fix & convert. Each entry under mcpServers or servers becomes a [mcp_servers.<name>] table, env becomes a sub-table, an Authorization: Bearer ${env:TOKEN} header becomes bearer_token_env_var = "TOKEN", other headers become http_headers, disabled becomes enabled = false, and type is dropped because Codex picks stdio or HTTP from command or url.
Why does Codex ignore my MCP server headers?
Codex does not read a headers key. Use http_headers for static values, env_http_headers to read values from environment variables, or bearer_token_env_var for an Authorization: Bearer token. In our test with codex-cli 0.164.0, a server with headers loaded without error but with no headers at all, so the mistake is silent. The validator flags it.