MCP config generator
Enter an MCP server once and get the file path, the exact JSON or TOML, and the add command for Claude Code, Claude Desktop, Cursor, Codex, Windsurf, VS Code, GitHub Copilot CLI, OpenCode, and Pi. You can also paste an existing mcpServers snippet and convert it. Formats are checked against each vendor’s documentation as of 13 October 2026, and the tool runs in your browser.
Worked example
{
"name": "filesystem",
"transport": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
],
"env": [],
"clients": [
"claude",
"cursor",
"codex",
"vscode",
"opencode"
],
"scope": "both"
}MCP server: filesystem (stdio)
Checked against vendor documentation on 2026-10-13. Client formats change, so if a client rejects this output, compare it with the documentation linked below.
Checks (3)
- Note: A path in the command or arguments points into a home folder. It will not exist on a teammate machine, so replace it before you commit a project-scope file.
- Note: Project-scope files (.mcp.json, .cursor/mcp.json, .codex/config.toml, .vscode/mcp.json, opencode.json) are usually committed to git, so everyone who clones the repository gets these servers. Add a file to .gitignore if it should stay private.
- Note: Commands use POSIX shell quoting (macOS, Linux, WSL, Git Bash). PowerShell and cmd.exe quote differently.
== Claude Code ==
File, user scope: ~/.claude.json. Top-level mcpServers key. The file also holds other Claude Code state.
File, project scope: .mcp.json. At the project root. Claude Code asks you to approve its servers.
{
"mcpServers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
]
}
}
}
Equivalent command, user scope:
claude mcp add --transport stdio --scope user filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/projects
Equivalent command, project scope:
claude mcp add --transport stdio --scope project filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/projects
- Note: Merge the entry into the top-level mcpServers key of ~/.claude.json and keep the rest of that file.
- Note: The default scope of claude mcp add is local: private to you and stored in ~/.claude.json under the current project. The commands here pass --scope user or --scope project, so they write the files listed above.
- Note: An entry that has a url and no type is read as a stdio server and fails, so the type field is always written.
Documentation: https://code.claude.com/docs/en/mcp
== Cursor ==
File, user scope: ~/.cursor/mcp.json
File, project scope: .cursor/mcp.json. At the project root.
{
"mcpServers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
]
}
}
}
- Note: No add command is documented for Cursor, so edit the file.
- Note: Cursor merges both files, and the project entry wins when the same server name appears in both.
- Note: Cursor resolves ${env:NAME}, ${userHome}, and ${workspaceFolder} in command, args, env, url, and headers.
Documentation: https://cursor.com/docs/mcp
== Codex ==
File, user scope: ~/.codex/config.toml
File, project scope: .codex/config.toml. Read only for trusted projects.
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
Equivalent command:
codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/projects
Adds the server through the Codex CLI. Run codex mcp list to confirm it, and check the entry in the config file.
- Note: The top-level table is mcp_servers, not mcpServers.
- Note: Codex reads project configuration only for trusted projects. The Codex app, CLI, and IDE extension share this configuration.
Documentation: https://developers.openai.com/codex/mcp
== VS Code ==
File, user scope: mcp.json in your VS Code user profile folder. Run MCP: Open User Configuration from the Command Palette. The location depends on your operating system and profile, so no fixed path is given.
File, project scope: .vscode/mcp.json. In the workspace folder.
{
"servers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
]
}
}
}
Equivalent command:
code --add-mcp '{"name":"filesystem","command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/Users/you/projects"]}'
The documentation says this adds the server to your user profile or to a workspace.
- Note: VS Code uses the root key servers, not mcpServers.
- Note: VS Code can prompt for a secret when the server first starts and then store it. Add an inputs entry with type promptString and password set to true, and reference it as ${input:id}.
Documentation: https://code.visualstudio.com/docs/agents/reference/mcp-configuration
== OpenCode ==
File, user scope: ~/.config/opencode/opencode.json
File, project scope: opencode.json. At the project root.
{
"mcp": {
"filesystem": {
"type": "local",
"command": [
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
],
"enabled": true
}
}
}
- Note: No add command is documented for OpenCode, so edit the file.
- Note: This is the layout in the main OpenCode documentation, with servers directly under mcp and the arguments inside the command array. The v2 documentation pages show servers under mcp.servers and use disabled in place of enabled, so check which version you run.
Documentation: https://opencode.ai/docs/mcp-servers/The input is a generic filesystem server started with npx, written for five clients at both scopes. Each client gets its own shape.
Claude Code writes type: "stdio" under mcpServers, and the two commands differ only in --scope. Cursor uses the same root key and has no add command. Codex writes TOML tables named mcp_servers. VS Code uses the root key servers. OpenCode folds the arguments into a command array and adds enabled.
The checks list at the top is worth reading. The path /Users/you/projects points into a home folder, so it would not exist on a teammate’s machine, and the project-scope files are usually committed to git. Change the path before you commit anything.
How to use it
Choose the transport
Pick stdio when the client starts the server as a local program, such as
npxoruvx. Pick HTTP when the server already runs at a URL. Claude Desktop has no HTTP output, because its documented file is for local servers.Describe the server
Give it a short name using letters, digits, hyphens, and underscores. For stdio, enter one executable in the command field and the arguments in the arguments box, one per line or separated by spaces. For HTTP, enter the URL and any headers.
Reference secrets, do not paste them
Write
${GITHUB_TOKEN}where a token belongs. The tool rewrites the reference into each client’s own syntax where the documentation gives one, and warns where it does not. Set the variable in your shell or your client’s environment.Select clients and scope
Choose the clients you use. User scope is a personal file in your home folder. Project scope is a file inside the repository, which teammates get when they clone it. Choose both to see every path.
Paste the snippet or run the command
Merge the snippet into the file shown, keeping any servers already there, or run the add command where one is offered. Restart the client, then check that it lists the server and can start it.
Convert an existing snippet
In convert mode, paste JSON that uses
mcpServers,servers, ormcp, then choose the target clients. Read the notes for fields that were not converted before you copy the result.
How it works
Every client entry was checked against that vendor’s documentation as of 13 October 2026. Client formats change, so if a client rejects a snippet, treat the documentation page listed under Sources as the authority. These are the rules, in order.
- Root keys.
mcpServersfor Claude Code, Claude Desktop, Cursor, Windsurf, Copilot CLI, and Pi.serversfor VS Code.mcpfor OpenCode. Codex uses TOML tables namedmcp_servers. - Stdio entries. Claude Code, Cursor, and VS Code write
type: stdio. Copilot CLI and OpenCode writetype: local, and OpenCode puts the arguments inside acommandarray besideenabled. Copilot CLI addstoolsset to*. Windsurf, Claude Desktop, Pi, and Codex write no type. - HTTP entries. Claude Code and VS Code write
type: http, Copilot CLI writestype: httpwithtools, and OpenCode writestype: remote. Cursor and Pi writeurl, Windsurf writesserverUrl, and Codex writesurl. Claude Desktop is not offered HTTP. - References.
${NAME},${env:NAME}, and{env:NAME}are read from your input. Output uses${NAME}for Claude Code and for Pi env and headers,${env:NAME}for Cursor and Windsurf, and{env:NAME}for OpenCode. For Codex,Authorization: Bearer ${NAME}becomesbearer_token_env_varand a header whose whole value is a reference becomesenv_http_headers. Elsewhere the text is left as typed, with a warning. - Add commands. Only documented forms are printed:
claude mcp add,codex mcp add,copilot mcp add,pi mcp add, andcode --add-mcpfor stdio servers without env. Values use POSIX shell quoting. - Secret checks. A value is flagged when it matches a token prefix that GitHub, GitLab, Slack, AWS, Stripe, Google, npm, or Anthropic documents (
ghp_,github_pat_,glpat-,xox,AKIA,sk_live_,AIza,npm_,sk-ant-), the generalsk-shape, a JSON Web Token, a Bearer or Basic credential, a hexadecimal string of 32 or more characters, a random-looking string of 40 or more that mixes upper case, lower case, and digits, or a value under a name such as token, secret, or password. URLs are checked for embedded credentials and secret-named query parameters. This is a heuristic, not a vendor rule. References and placeholders are skipped, and warnings name the key, never the value. - Names and paths. Names outside letters, digits, hyphen, and underscore get a warning. That rule is this tool’s own caution, not a vendor rule. A command that is a relative path, or an argument that starts with
./,../, or~, gets a warning because a client may start the server from an undefined working directory. - Convert. JSON is read with a strict reader that also accepts comments and trailing commas, each reported as a warning. Unknown fields are listed, never guessed, and SSE servers are skipped.
Limitations
- Client formats change. The output was checked against vendor documentation on 13 October 2026, so a later release can make a snippet stale. If a client rejects it, compare it with the documentation page for that client.
- It writes configuration text only. It does not start the server, test a connection, or check that a command or package exists.
- Only stdio and streamable HTTP are covered. SSE, OAuth settings, tool allow lists, timeouts, and other client extras are not generated, and convert mode lists them as not converted.
- Some formats are partial on purpose. Windsurf shows no project file because none is documented, VS Code gives no fixed user path, and Claude Desktop gets no HTTP snippet.
- Secret detection is a heuristic. It misses some secrets and flags some harmless values, so read your output before you commit it.
Practical applications
Use it whenever the same server has to work in more than one client, or when you cannot remember which file a client reads.
- Setting up a new machine. List the servers once and write the user-scope file for every client you use.
- Sharing a server with a team. Generate the project-scope file, replace secrets with references, and commit it.
- Switching editors. Paste your working
mcpServerssnippet and convert it into the shape the new client expects. - Debugging a rejected config. Compare your file with the generated one, such as
serversagainstmcpServersor a missingtype. - Writing docs. Produce exact, consistent snippets for a README instead of copying from several vendor pages.
Common mistakes
- Pasting a real token into env or headers and committing the project file. Use an environment variable reference, and keep personal tokens in user-scope files.
- Using the wrong root key. VS Code expects servers, OpenCode expects mcp, Codex expects mcp_servers, and most others expect mcpServers.
- Putting the whole command line in the command field. The field takes one executable, and the arguments belong in the arguments list.
- Leaving the type off in Claude Code. An entry that has a url and no type is read as a stdio server and fails.
- Using a relative path such as ./server for the command. A client may start the server from a different working directory, so use an absolute path.
Frequently asked questions
Where does each client store its MCP config?
Claude Code uses ~/.claude.json and a .mcp.json file in the project. Cursor uses ~/.cursor/mcp.json and .cursor/mcp.json. Codex uses ~/.codex/config.toml and .codex/config.toml. VS Code uses .vscode/mcp.json in a workspace and a profile file you open with MCP: Open User Configuration. Copilot CLI uses ~/.copilot/mcp-config.json. OpenCode uses ~/.config/opencode/opencode.json and opencode.json. Pi uses ~/.pi/agent/mcp.json and .pi/mcp.json. Windsurf documents ~/.codeium/windsurf/mcp_config.json and also names ~/.config/devin/mcp_config.json. Claude Desktop uses claude_desktop_config.json in ~/Library/Application Support/Claude on macOS and in %APPDATA%\Claude on Windows. The tool lists the paths for each client you select.
What is the difference between a stdio and an HTTP MCP server?
A stdio server is a program the client starts and talks to through standard input and output, so the config holds a command, arguments, and environment variables. An HTTP server is already running at a URL, so the config holds that URL and any headers. Use stdio for local tools and HTTP for hosted or shared servers.
How do I keep a token out of a committed MCP file?
Write a reference to an environment variable and set the variable on your machine. Claude Code and Pi read ${NAME}, Cursor and Windsurf read ${env:NAME}, and OpenCode reads {env:NAME}. Codex has bearer_token_env_var for HTTP servers, and VS Code can prompt for a secret through an inputs entry. If a token has already been committed, treat it as exposed and rotate it.
Why does VS Code use servers and the others use mcpServers?
Each client defines its own schema, and VS Code documents servers as its root key, with an optional inputs list. OpenCode uses mcp and Codex uses TOML tables. The generator follows each vendor’s documentation, which is why one server produces differently shaped files.
Does this tool send my configuration anywhere?
No. The generator is plain code that runs in your browser and makes no network request. Even so, avoid typing real tokens into any web page. Use a reference such as ${GITHUB_TOKEN}, which the tool needs only as text.
What does convert mode do with fields it does not recognise?
It lists them as not converted and leaves them out. Fields such as autoApprove or timeout may mean something in the source client and nothing in the target, so the tool does not guess. A server marked disabled in the source is written enabled, and a separate warning says so.
Sources
- Connect Claude Code to tools via MCP
- Cursor: Model Context Protocol (MCP)
- Codex: Model Context Protocol
- Codex: Configuration reference
- Windsurf: Cascade MCP integration
- VS Code: MCP configuration reference
- VS Code: add and manage MCP servers
- GitHub Docs: adding MCP servers for Copilot CLI
- OpenCode: MCP servers
- OpenCode: config and variable substitution
- Pi: MCP servers
- Model Context Protocol: connect to local MCP servers
Let Rig write its own MCP entry for you
On a Mac, Rig’s Link action writes its own MCP entry into the config files of eight clients. Project links use their own token, and Rig will not write a project file that git already tracks. The docs explain the setup.