---
title: "MCP Config Generator: mcp.json for Claude, Codex, Cursor"
description: "Free MCP config generator: enter one server and copy the mcp.json, claude mcp add command or config.toml for Claude, Codex, Cursor and VS Code."
url: https://adctrl.ai/tools/mcp-config-generator/
last_updated: 2026-11-30
---

# 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.

By [Kaan C.](https://adctrl.ai/#founder), Founder of AdCtrl · Updated 27 November 2026

## 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.

| Client | Where the server goes | Top-level key | Secret reference |
| --- | --- | --- | --- |
| Claude Code | `claude mcp add`, or `.mcp.json` in the project | `mcpServers` | `${NAME}` |
| Claude Desktop | `claude_desktop_config.json` (local), custom connector (remote) | `mcpServers` | the value itself |
| Codex | `~/.codex/config.toml` | `[mcp_servers.<name>]` | `env_vars`, `bearer_token_env_var` |
| Cursor | `.cursor/mcp.json` or `~/.cursor/mcp.json` | `mcpServers` | `${env:NAME}` |
| VS Code (Copilot) | `.mcp.json` in the workspace, or `~/.copilot/mcp-config.json` | `mcpServers` | `${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 space[1](https://adctrl.ai/tools/mcp-config-generator/#ref-1).

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.json`[1](https://adctrl.ai/tools/mcp-config-generator/#ref-1). 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 own[1](https://adctrl.ai/tools/mcp-config-generator/#ref-1). 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 saving[2](https://adctrl.ai/tools/mcp-config-generator/#ref-2).

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](https://adctrl.ai/tools/mcp-config-generator/#ref-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 one[3](https://adctrl.ai/tools/mcp-config-generator/#ref-3). 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 once[4](https://adctrl.ai/tools/mcp-config-generator/#ref-4). 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 variable[4](https://adctrl.ai/tools/mcp-config-generator/#ref-4). 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 project[5](https://adctrl.ai/tools/mcp-config-generator/#ref-5). 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 headers[5](https://adctrl.ai/tools/mcp-config-generator/#ref-5). 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 setups[6](https://adctrl.ai/tools/mcp-config-generator/#ref-6). 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 2027[7](https://adctrl.ai/tools/mcp-config-generator/#ref-7).

Google's README still points to `.vscode/mcp.json`[8](https://adctrl.ai/tools/mcp-config-generator/#ref-8). 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 available[6](https://adctrl.ai/tools/mcp-config-generator/#ref-6).

## 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_id`[1](https://adctrl.ai/tools/mcp-config-generator/#ref-1), [4](https://adctrl.ai/tools/mcp-config-generator/#ref-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 Ads MCP server preset

Google's Google Ads MCP server runs locally over stdio, or over Streamable HTTP on Cloud Run[9](https://adctrl.ai/tools/mcp-config-generator/#ref-9). 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 Code[8](https://adctrl.ai/tools/mcp-config-generator/#ref-8). 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](https://adctrl.ai/blog/google-ads-mcp/).

## 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-in[10](https://adctrl.ai/tools/mcp-config-generator/#ref-10). Meta's developer page adds a Claude Code command with `--client-id` for people who connect through their own Meta app[11](https://adctrl.ai/tools/mcp-config-generator/#ref-11). As of 27 November 2026, Meta's connectors are in open beta, and not every ad account has access yet[10](https://adctrl.ai/tools/mcp-config-generator/#ref-10). 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](https://adctrl.ai/blog/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 store[5](https://adctrl.ai/tools/mcp-config-generator/#ref-5), [6](https://adctrl.ai/tools/mcp-config-generator/#ref-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 keychain[12](https://adctrl.ai/tools/mcp-config-generator/#ref-12).

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 permissions[1](https://adctrl.ai/tools/mcp-config-generator/#ref-1), [7](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/blog/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](https://adctrl.ai/blog/claude-code-vs-codex-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](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-1), [2](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-6), [7](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/tools/mcp-config-generator/#ref-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](https://adctrl.ai/docs/#getting-started).

## Articles that use the MCP config generator for mcp.json and config.toml

[All articles](https://adctrl.ai/blog/)

- [**Google Ads MCP: official server vs hosted connectors (2026)** What Google's official Google Ads MCP server can and can't do, how to add it to Claude or ChatGPT, and when a hosted connector is simpler.](https://adctrl.ai/blog/google-ads-mcp/)
- [**Claude Code vs Codex for marketing: which job goes where** Codex for ad-account data and tracking, Claude Code for ad copy and landing pages, both working from saved rows, with MCP setup and dated prices.](https://adctrl.ai/blog/claude-code-vs-codex-marketing/)
- [**MCP vs API for ad accounts: what changes when AI connects** MCP doesn't replace the Google Ads or Meta API; it lets Claude or ChatGPT call it. When to script the API, when to use MCP, how changes stay safe.](https://adctrl.ai/blog/mcp-vs-api/)
- [**Claude connectors for marketing: Google Ads, Meta, GA4** Claude connectors for Google Ads, Meta, GA4 and HubSpot: what each can change, how to add one, and the setting that makes Claude ask first.](https://adctrl.ai/blog/claude-connectors-marketing/)
- [**Shopify MCP: which one connects your store to Claude** Store owners need Shopify's own connector for Claude or ChatGPT, not Dev MCP. What it reads, what it can't change, and how to set ad spend beside it.](https://adctrl.ai/blog/shopify-mcp/)
- [**Claude Cowork for Google and Meta ads: what it can do** Claude Cowork reads Google Ads and Meta Ads through a remote connector, on a schedule with your laptop shut. Which jobs suit it, and where changes go.](https://adctrl.ai/blog/claude-cowork-for-ads/)
- [**MCP security for ad accounts: is it safe to connect AI?** Is MCP safe for your ad account? The 4 real risks of connecting Claude or ChatGPT to Google Ads or Meta, and the control that limits each.](https://adctrl.ai/blog/mcp-security-ad-accounts/)
- [**Google Tag Manager MCP: server URL, setup and risks** Google hasn't published a Tag Manager MCP server. Copy a server URL into Claude or ChatGPT, check what it can publish, then audit read-only first.](https://adctrl.ai/blog/google-tag-manager-mcp/)

## More free tools

[All tools](https://adctrl.ai/tools/)

- [**Ad budget calculator** Budget = sales ÷ conv. rate × CPC](https://adctrl.ai/tools/ad-budget-calculator/)
- [**Ad preview tool** Headline ≤ 30 · description ≤ 90 characters](https://adctrl.ai/tools/ad-preview/)
- [**AI visibility checker** Brand + category → named in X of 6 AI answers](https://adctrl.ai/tools/ai-visibility/)
- [**CAC calculator** CAC = sales & marketing costs ÷ new customers](https://adctrl.ai/tools/cac-calculator/)
- [**Conversion rate calculator** Conversion rate = conversions ÷ clicks × 100](https://adctrl.ai/tools/conversion-rate-calculator/)
- [**CPA calculator** CPA = ad cost ÷ conversions](https://adctrl.ai/tools/cpa-calculator/)
- [**CPC calculator** CPC = ad cost ÷ clicks](https://adctrl.ai/tools/cpc-calculator/)
- [**CPM calculator** CPM = ad cost ÷ impressions × 1,000](https://adctrl.ai/tools/cpm-calculator/)
- [**CTR calculator** CTR = clicks ÷ impressions × 100](https://adctrl.ai/tools/ctr-calculator/)
- [**Keyword match type tool for Google Ads** Broad · Phrase · Exact · Negative](https://adctrl.ai/tools/keyword-match-type-tool/)
- [**llms.txt generator** # Name + > summary + ## link lists](https://adctrl.ai/tools/llms-txt-generator/)
- [**LTV calculator** LTV = order value × margin × orders](https://adctrl.ai/tools/ltv-calculator/)
- [**ROAS calculator** ROAS = ad revenue ÷ ad spend](https://adctrl.ai/tools/roas-calculator/)
- [**Tracking and pixel checker** Page link → GTM, GA4, Meta and TikTok IDs](https://adctrl.ai/tools/tracking-checker/)
- [**UTM builder** URL + utm_source, medium, campaign](https://adctrl.ai/tools/utm-builder/)

## Sources

1. [Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp), Anthropic (Claude Code Docs).
2. [Connect to local MCP servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers), Model Context Protocol.
3. [Get started with custom connectors using remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp), Claude Help Center.
4. [Model Context Protocol (Codex)](https://learn.chatgpt.com/docs/extend/mcp?surface=cli), OpenAI.
5. [Model Context Protocol (MCP)](https://cursor.com/docs/mcp), Cursor Docs.
6. [MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration), Visual Studio Code.
7. [Add and use MCP servers in VS Code](https://code.visualstudio.com/docs/agent-customization/mcp-servers), Visual Studio Code.
8. [Google Ads MCP Server (README)](https://github.com/googleads/google-ads-mcp), Google (googleads on GitHub).
9. [Google Ads MCP server: Developer integration guide](https://developers.google.com/google-ads/api/docs/developer-toolkit/mcp-server), Google for Developers.
10. [Meta ads MCP server: connect AI tools](https://www.facebook.com/business/tools/ads-mcp-server?locale=en_US), Meta for Business.
11. [Get started (ads MCP server)](https://developers.facebook.com/documentation/ads-commerce/ads-ai-connectors/ads-mcp-server/ads-mcp-server-get-started), Meta for Developers.
12. [Getting Started with Local MCP Servers on Claude Desktop](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop), Claude Help Center.
13. [AdCtrl docs: Google Ads and Meta Ads in Claude or ChatGPT](https://adctrl.ai/docs/), AdCtrl.

## Put your AI to work on your campaigns.

Connect your accounts once and you have an ad agency inside ChatGPT or Claude. Free for 3 days.

[Start free](https://app.adctrl.ai/app/signup)

No card needed

A product by mondaybrew ApS · CVR 45217779 · Vesterbrogade 74, 3. sal, 1620 København V, Denmark

Google, Meta, ChatGPT and Claude are trademarks of their respective owners. AdCtrl is an independent product by mondaybrew ApS.
