MCP Config Generator
Pick MCP servers and get correct config JSON for Claude Code, Cursor and OpenCode.
Servers (3 selected)
Edit the path arg to the directory the agent may touch.
Env values stay in this tab — they are never put in the share link.
Save as .mcp.json in your project root.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/dir"
]
},
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
},
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}⚠ Placeholder values emitted for: GITHUB_PERSONAL_ACCESS_TOKEN — replace before use.
How it works
This generator builds a correct MCP configuration for the client you actually use. Tick the servers you want, fill in any environment variables they need, and the JSON re-renders instantly for Claude Code, Cursor or OpenCode. Everything runs locally — your tokens never leave the browser, and we recommend pasting placeholders anyway.
The reason this tool exists is mundane but real: the three major clients all speak MCP, yet each wraps the same server definition in a different JSON shape. Claude Code expects an mcpServers object in .mcp.json; Cursor uses the same key but lives at .cursor/mcp.json; OpenCode nests servers under an mcp key inside opencode.json with a type and an enabled flag, and uses a single command array rather than command-plus-args. Hand-translating between them is where most "server won't connect" bugs are born.
The twelve servers offered here are the ones that show up in real projects again and again: filesystem and memory for local capability, github / postgres / sqlite for the development loop, puppeteer and fetch for web access, and slack, sentry, stripe, brave-search and google-maps for the services teams wire in next. Servers that need credentials show an env-var field with a placeholder; the output flags any you left unfilled so a missing token fails loudly at config time instead of mysteriously at runtime.
One piece of advice from running agent fleets in production: keep MCP configs project-scoped and minimal. Every server you connect adds its tool schemas to the model's context window on every single request — twelve idle servers can quietly burn thousands of tokens per call and make the model worse at picking the right tool. Generate the config for what this repo needs, commit the placeholder version, and inject real secrets from the environment. Your future self debugging a 429 at 2am will thank you. And when a server refuses to connect, test its command standalone in a terminal first — if it starts and waits on stdio, the bug is in the config shape, which is precisely the part this tool generates correctly.
Frequently asked questions
What is MCP and why do I need a config file?
The Model Context Protocol (MCP) is an open standard that lets AI coding agents talk to external systems — filesystems, databases, GitHub, Slack — through small server processes. Each client (Claude Code, Cursor, OpenCode) launches the servers listed in its config file at session start. The config declares the command to run, its arguments, and any environment variables like API tokens the server needs.
Where does each client's config file live?
Claude Code reads .mcp.json in the project root (or user scope via claude mcp add). Cursor reads .cursor/mcp.json in the project or ~/.cursor/mcp.json globally. OpenCode declares servers under the mcp key of opencode.json in the project root or ~/.config/opencode/. The JSON shapes differ slightly between clients — same servers, different wrapper keys — which is exactly what the tabs above handle for you.
How should I handle secrets and API tokens in MCP configs?
Never commit real tokens. Config files frequently end up in version control, so use placeholder values and inject real secrets from your shell environment or a secrets manager. Most clients expand env vars at launch, and many servers read directly from the process environment if the config omits the value. Treat any token an MCP server holds as having the full power of that account — scope tokens narrowly.
Why does my MCP server fail to connect?
The usual suspects, in order: the command isn't installed (npx fetches on first run, which can be slow or blocked offline), a required env var is missing or empty, the JSON has a trailing comma or wrong nesting for your client, or the server crashed at startup — check the client's MCP logs. Test the command standalone in a terminal first; if it starts and waits on stdio, the config is the problem, not the server.
Do more MCP servers make my agent better?
Not automatically. Every connected server adds its tool definitions to the model's context on every request, which costs tokens and dilutes attention across more tools. Connect the servers you actually use in a project and prune the rest — three relevant servers beat twelve idle ones. Project-scoped configs (rather than global) keep each repo's tool surface tight.
Built by FORG — AI cost observability for agentic coding. Free tools, no signup, nothing leaves your browser.
Learn about FORG