All guides
Get started

Connect Facebook Ads to Cursor with AdChat (mcp.json Setup)

Add AdChat to Cursor by pasting a few lines into mcp.json. Ask about your Meta ads, build reports and scripts right inside your editor.

Updated October 24, 2026

Cursor is an AI code editor, and it can connect to MCP servers. With AdChat added, you can ask Cursor's agent about your Facebook and Instagram ads, pull live numbers into a dashboard you're building, or write a script that reports on your campaigns. Setup takes a minute: you paste a small block of JSON into a config file.

What you need

  • Cursor installed.
  • An AdChat account. Sign up. You can connect Facebook now or when you sign in from Cursor.

Step 1: Copy the JSON config

On your AdChat dashboard home page, open Use AdChat inside Claude or ChatGPT and expand JSON config. Click Copy config. It looks like this. There's no key in it, because you sign in instead:

json
{
  "mcpServers": {
    "adchat": {
      "url": "https://mcp.adchat.app"
    }
  }
}

Step 2: Pick where to put it

Cursor reads MCP servers from two places:

  • Global: ~/.cursor/mcp.json in your home folder. AdChat is then available in every project. This is the best choice for most people.
  • Project: .cursor/mcp.json inside a project folder. AdChat is only available in that project.

If the file doesn't exist, create it and paste the config. If it already has other servers, add the adchat entry inside the existing mcpServers object, like this:

json
{
  "mcpServers": {
    "some-other-server": { "url": "https://example.com/mcp" },
    "adchat": {
      "url": "https://mcp.adchat.app"
    }
  }
}

Check the commas between entries. A missing comma is the most common reason the file doesn't load.

Step 3: Sign in

Open Cursor's settings and find the MCP section (in recent versions it's called Tools & MCP). AdChat should be listed there. If it's switched off, turn it on. If you just edited the file, restarting Cursor helps.

The first time, Cursor asks you to sign in. A browser window opens. Sign in to AdChat, connect Facebook if you haven't yet, and click Allow. AdChat then shows its tools. You only do this once. Cursor stays connected as long as you use AdChat at least once every 90 days.

Step 4: Ask a question

Open the agent chat in Cursor and try:

Using AdChat, show me my active Facebook campaigns with spend, CTR and cost per result for the last 14 days.

Or put it to work on code:

Use AdChat to fetch daily spend for my account over the last 30 days, then write a small script that turns it into a chart.

Cursor asks before running tools, depending on your settings. For more prompts, see Your first 10 questions to ask.

Can't sign in? Use your key as a header

Signing in is the way to go. If it doesn't work in your setup, you can send your AdChat key as a header instead. Your key is in the dashboard and starts with adchat_:

json
{
  "mcpServers": {
    "adchat": {
      "url": "https://mcp.adchat.app",
      "headers": {
        "Authorization": "Bearer ${env:ADCHAT_KEY}"
      }
    }
  }
}

Set ADCHAT_KEY in your shell profile (for example export ADCHAT_KEY=adchat_... in ~/.zshrc) and restart Cursor. Don't paste the key itself into a mcp.json that gets committed to git. If it ever leaks, roll it in the dashboard and the old key stops working.

Troubleshooting

AdChat doesn't appear in Cursor. Make sure the file is named exactly mcp.json and sits in ~/.cursor/ or your project's .cursor/ folder. Then check the JSON is valid (no trailing commas, matching braces) and restart Cursor.

AdChat shows an error or zero tools. Check the URL is exactly https://mcp.adchat.app. The old AdChat address no longer works. Update the URL, restart Cursor and sign in again. If you use the header instead, the value must be Bearer followed by a key that starts with adchat_.

"Write access is not enabled". AdChat is read-only until you turn on Write Access in your dashboard. See Turn on write access.

FAQ

Is this the same config as Claude Desktop or other apps? The mcpServers format is shared by many apps, so the same block often works elsewhere. See Use AdChat with any MCP client.

Will Cursor change my ads? Only if you turn on write access and ask it to. New campaigns, ad sets and ads are created paused by default.

Try it

Try it free for 7 days. No credit card needed. Questions? Email [email protected].

Try it on your own ad account

Connect your Meta ads to Claude, ChatGPT or our built-in chat in about a minute.

Start free for 7 daysNo credit card needed. Then $19/month. Cancel anytime.

Questions? Email me at [email protected]