Start free

Free tool

MCP config generator for mcp.json and config.toml

Enter one MCP server and copy the exact setup for each client: the claude mcp add command or .mcp.json to add an MCP server to Claude Code, a custom connector or claude_desktop_config.json for Claude Desktop, ~/.codex/config.toml for Codex, and the mcp.json files Cursor and VS Code read.

Server
Client

Enter variable names only, never keys or tokens. Claude Code, Codex, Cursor and VS Code read the values from your environment. In Claude Desktop you type the values in yourself: in the config file for a local server, or under Request headers for a connector.

Claude Code Config ready
Terminal

claude mcp add --transport http meta-ads https://mcp.facebook.com/ads

.mcp.json in the project root

{ "mcpServers": { "meta-ads": { "type": "http", "url": "https://mcp.facebook.com/ads" } } }

If the server asks you to sign in, run /mcp in Claude Code or claude mcp login meta-ads. Saved for this project only: --scope user adds it everywhere, --scope project writes .mcp.json (in interactive sessions Claude Code asks before using it). Meta's Claude Code steps add --client-id with your own Meta app ID. Without an app, Meta says to enter the URL and sign in with Facebook.

The ad agency inside your AI: add AdCtrl to Claude or ChatGPT, no config file

Start free

3-day free trial · no card needed

MCP JSON: where each client keeps its MCP config

An MCP config tells an AI app how to reach one MCP server: a URL for a remote server, or a command the app starts on your computer for a local one. Claude Code, Claude Desktop, Cursor and VS Code keep it in a JSON file under an mcpServers key, which is why people search for "mcp json". Codex keeps it in TOML. Past that, the clients disagree on the file and on how you point to a secret, so a block copied from one client's docs often needs changes before another client accepts it.

ClientWhere the server goesTop-level keySecret reference
Claude Codeclaude mcp add, or .mcp.json in the projectmcpServers${NAME}
Claude Desktopclaude_desktop_config.json (local), custom connector (remote)mcpServersthe value itself
Codex~/.codex/config.toml[mcp_servers.<name>]env_vars, bearer_token_env_var
Cursor.cursor/mcp.json or ~/.cursor/mcp.jsonmcpServers${env:NAME}
VS Code (Copilot).mcp.json in the workspace, or ~/.copilot/mcp-config.jsonmcpServers${NAME}

Each row comes from that vendor's MCP docs, read on 27 November 2026. The sections below quote and link the page for each client.

Formula: server name + URL or command → each client's config

Worked example

Say you want Meta's ads MCP server in Claude Code. The server is remote, at https://mcp.facebook.com/ads, and you call it meta-ads. The generator writes claude mcp add --transport http meta-ads https://mcp.facebook.com/ads and the same server as a .mcp.json entry with "type": "http" and that URL. If you connect through your own Meta app, type its app ID and the command gains --client-id, the form Meta's developer page shows for Claude Code.

The values are the generator's Meta Ads preset. Meta's sign-in decides which ad accounts the server can reach.

Claude Code MCP: claude mcp add or .mcp.json

Claude Code adds a remote server with claude mcp add --transport http <name> <url> and a local one with claude mcp add [options] <name> -- <command> [args...]. The -- matters: everything after it goes to the server untouched, so a flag like -y reaches npx and Claude Code doesn't try to read it. Server names can only use letters, numbers, hyphens and underscores, so the generator refuses a name with a space1.

That command saves the server for the current project only, in ~/.claude.json. Add --scope user to load it in every project, or --scope project to write a .mcp.json at the project root that you can commit for your team. Claude Code asks for approval in interactive sessions before it uses servers from a project's .mcp.json1. For Claude Code, the Claude MCP config file is one of those two.

For keys, write ${API_KEY} where the value would go and Claude Code fills it from your environment. The generator wraps those parts of the command in single quotes, so your shell leaves the reference alone and Claude Code expands it later. One catch for remote servers: Claude Code reads its own and your cloud provider's credentials as empty in a remote server's URL and headers, so Bearer ${ANTHROPIC_API_KEY} arrives blank. Copy the value into a variable with a name of your own1. For a server that signs you in with OAuth, run /mcp inside Claude Code or claude mcp login <name> in your shell.

Claude Desktop MCP: claude_desktop_config.json and connectors

Claude Desktop has two routes. A local server goes in claude_desktop_config.json under the same mcpServers key. The file sits at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows and ~/.config/Claude/claude_desktop_config.json on Linux. The Edit Config button in Claude Desktop's developer settings opens it, and you quit and restart the app after saving2.

A remote server goes in as a custom connector, under Customize > Connectors. Claude then connects to it from Anthropic's cloud, and the Help Center calls the local config file "a separate mechanism"3. So for a remote server in Claude Desktop the generator gives you the URL and the connector steps, and no JSON. Some other generators wrap the URL in a community bridge package inside claude_desktop_config.json. We left that out, since Anthropic's pages don't describe it.

As of November 2026, custom connectors work on Free, Pro, Max, Ultra, Team and Enterprise plans, and Free plans get one3. A token or API key goes under Request headers in the connector form. So your Claude Desktop MCP config is either a JSON entry or a connector, depending on where the server runs.

Codex MCP: ~/.codex/config.toml

Codex keeps MCP servers in TOML. The default file is ~/.codex/config.toml, and a .codex/config.toml inside a trusted project scopes a server to that project. The ChatGPT desktop app, Codex CLI and IDE extension share the same file, so you set a server up once4. Each server is one [mcp_servers.<name>] table.

A Codex MCP config points to secrets by name. env_vars lists variables to pass to a local server, bearer_token_env_var names the variable that holds a bearer token, and env_http_headers maps a header to a variable4. The generator never needs a value for any of them. When a local server has no variables, you also get the one-line codex mcp add <name> -- <command> form, and codex mcp login <name> signs you in to a server that uses OAuth.

TOML has its own quoting. The generator escapes quotes and doubles backslashes, so a Windows path like C:\tools\server.exe comes out as "C:\\tools\\server.exe" and Codex reads it back as you typed it.

Cursor MCP: .cursor/mcp.json

Cursor reads .cursor/mcp.json inside a project and ~/.cursor/mcp.json for every project5. A local server takes "type": "stdio" with command, args and env. A remote one takes url and, if needed, headers. Cursor fills ${env:NAME} from your environment in the command, args, env, URL and headers5. That covers the whole Cursor MCP config for one server, and Cursor runs the OAuth sign-in itself when a remote server asks for it.

VS Code MCP server config: .mcp.json and the older .vscode/mcp.json

VS Code changed where MCP servers go. Its configuration reference now tells Copilot users to use .mcp.json at the workspace root, or ~/.copilot/mcp-config.json for every workspace, both with a top-level mcpServers object, and to stop using .vscode/mcp.json for new setups6. That older file uses servers as its key and ${env:NAME} for variables. It belongs to the Local harness, which VS Code will remove in February 20277.

Google's README still points to .vscode/mcp.json8. This one gives you the current file first and the .vscode/mcp.json version second, for teams still on the Local harness. The current format takes ${NAME} references and a tools list, where ["*"] makes every tool from the server available6.

Remote MCP servers, tokens and OAuth

A remote MCP server is a URL. If it uses OAuth, you add the URL and the client runs the sign-in, usually in your browser, the first time it connects. Others want a fixed token in a header. Type the name of the variable that holds the token, such as MY_TOKEN, and the generator writes Authorization: Bearer with a reference to it in each client's syntax. If the server needs a pre-registered OAuth app, add its client ID: Claude Code takes --client-id and Codex takes an oauth table with client_id1, 4.

The generator refuses a URL that carries a key, such as ?api_key=, or a username and password. Plain http:// is allowed for localhost and gets a warning anywhere else.

Google's Google Ads MCP server runs locally over stdio, or over Streamable HTTP on Cloud Run9. Its README gives one mcpServers block for local use: pipx runs the server from Google's GitHub repository, with GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT in env. The preset copies that block word for word in Claude Desktop, with Google's PATH_TO_CREDENTIALS_JSON and YOUR_PROJECT_ID placeholders. In the other clients, the two values become references to variables in your environment. The same README names ~/.claude/settings.json for Claude Code and .vscode/mcp.json for VS Code8. The generator follows each client's own docs there, so Claude Code gets .mcp.json or claude mcp add and VS Code gets its current file. Credentials, read-only mode and Cloud Run are covered in our Google Ads MCP guide.

Meta ads MCP server preset

Meta's ads MCP server is remote, at https://mcp.facebook.com/ads, and Meta says to use that URL with every supported agent. Standard setup is the URL plus a Facebook sign-in10. Meta's developer page adds a Claude Code command with --client-id for people who connect through their own Meta app11. As of 27 November 2026, Meta's connectors are in open beta, and not every ad account has access yet10. Meta's pages don't cover Codex, Cursor or VS Code, so the preset uses each client's general remote format there. What the server can read and change is in Meta Ads MCP.

Keep keys out of the file

The generator asks for variable names and refuses NAME=value. Cursor says to use environment variables for secrets and never hardcode them, and VS Code says a personal configuration file is not a secret store5, 6. Claude Desktop is the exception: its local config takes the values themselves, so type them in on your own computer and keep the file out of shared folders. For a local server you install as a desktop extension, Claude Desktop keeps fields marked sensitive in the system keychain12.

Check a server before you add it. Claude Code's docs say to verify you trust each server, and VS Code warns that local servers can run code on your machine with your permissions1, 7. A config only tells the app how to start or reach a server. It says nothing about what the server does once it's connected. If you're still deciding whether an MCP server is the right route for an ad account, MCP vs API compares it with scripts and hosted connectors. And for how Claude Code and Codex handle approvals once a server is connected, see Claude Code vs Codex for marketing.

MCP config FAQ

What is an MCP JSON file?

It's the MCP config JSON a client reads to find its servers. Each server sits under a key such as mcpServers, with either a url or a command, args and env. Claude Code, Claude Desktop, Cursor and VS Code use JSON, and Codex uses TOML.

How do I add an MCP server to Claude Code?

Run claude mcp add --transport http <name> <url> for a remote server, or claude mcp add <name> -- <command> [args...] for a local one. Add --scope project to share it with your team in .mcp.json.1

Where is the Claude MCP config file?

For Claude Code, your own servers live in ~/.claude.json and shared ones in .mcp.json at the project root. For Claude Desktop it's claude_desktop_config.json, in ~/Library/Application Support/Claude on macOS and %APPDATA%\Claude on Windows.1, 2

Where is the Codex config.toml file?

At ~/.codex/config.toml by default, or .codex/config.toml inside a trusted project. Each MCP server is an [mcp_servers.<name>] table.4

Does VS Code still use .vscode/mcp.json?

Not for new setups. For Copilot, VS Code's reference uses .mcp.json at the workspace root or ~/.copilot/mcp-config.json, with mcpServers as the key. .vscode/mcp.json is the Local harness's format. Copilot doesn't read it directly, though it can forward eligible entries, and VS Code removes the Local harness in February 2027.6, 7

Can Claude Desktop use a remote MCP server?

Yes, as a custom connector under Customize > Connectors. Claude connects to it from Anthropic's cloud, and claude_desktop_config.json stays for local servers.3

Should I put my API key in the MCP config?

No. Use a reference such as ${API_KEY} in Claude Code and VS Code, ${env:API_KEY} in Cursor, or env_vars in Codex, and keep the value in your environment.5

Do I need a config file to use AdCtrl?

No. AdCtrl's docs cover Claude and ChatGPT: in Claude you open the AdCtrl listing, select Add and connect, and in ChatGPT you install the plugin.13

Is this MCP config generator free?

Yes. It builds the config in your browser from the names and URLs you type, and it never asks for a key or token.

AdCtrl adds Google Ads, Meta Ads and GA4 to Claude or ChatGPT as a connector, with no config file to write.

Sources

  1. Connect Claude Code to tools via MCP, Anthropic (Claude Code Docs).
  2. Connect to local MCP servers, Model Context Protocol.
  3. Get started with custom connectors using remote MCP, Claude Help Center.
  4. Model Context Protocol (Codex), OpenAI.
  5. Model Context Protocol (MCP), Cursor Docs.
  6. MCP configuration reference, Visual Studio Code.
  7. Add and use MCP servers in VS Code, Visual Studio Code.
  8. Google Ads MCP Server (README), Google (googleads on GitHub).
  9. Google Ads MCP server: Developer integration guide, Google for Developers.
  10. Meta ads MCP server: connect AI tools, Meta for Business.
  11. Get started (ads MCP server), Meta for Developers.
  12. Getting Started with Local MCP Servers on Claude Desktop, Claude Help Center.
  13. AdCtrl docs: Google Ads and Meta Ads in Claude or ChatGPT, AdCtrl.