Open-source Claude Code kit

Connect your Facebook Ads to Claude and just ask.

“What's my cost per lead this month?” Claude pulls the real number straight from the Meta Marketing API and answers. No dashboards, no CSV exports, no MCP server to run. Just your own Meta account, one access token, and curl.

What Nexus for Meta does

Meta's Ads Manager is built for people who live in it. Most firm owners do not. They want three numbers and a straight answer, and instead they get a reporting UI with forty column options.

Nexus for Meta removes the UI. You clone the repo, paste one Meta system-user token, and then talk to Claude about your marketing the way you would talk to an analyst who already has the tab open. Claude calls the Graph API directly and answers from live data.

It reads by default. It only creates, edits or pauses anything when you ask for that specific change, and it tells you the exact action and dollar amounts before it runs.

Things you can ask

How did my ads perform last month? Spend, leads, cost per lead.

Break performance down by campaign, then by ad.

Which ad is my best? Give me the Instagram link.

How many leads came in this week, and from which form?

How are my Page and Instagram accounts growing?

Draft a new campaign for X. Build it paused so nothing spends.

How to connect Facebook Ads to Claude

You need the Claude Code CLI or the Claude desktop app, and a Meta system-user access token for your business. Getting the token takes a few minutes and it never expires. SETUP.md walks through two ways to create one.

Then paste this to Claude:

Clone https://github.com/redwoodmeridian/nexus-for-meta, open it,
read its README and follow the setup to connect my Meta account.
I already have my system-user token ready to paste.

Claude clones the repo, creates your .env, asks for the token, writes it for you, and runs the connection check. If your ad account and Page come back, you are live.

Prefer to drive it yourself?

git clone https://github.com/redwoodmeridian/nexus-for-meta
cd nexus-for-meta
cp .env.example .env      # paste your token after META_TOKEN=
./scripts/verify

What's inside the repo

FileWhat it does
CLAUDE.mdTells Claude how to operate the kit and stay inside the safety rules.
.claude/skills/nexus-for-meta/The recipe library Claude reads for every request.
scripts/metaAuthenticated Graph API caller — loads your token, handles nested fields, pretty-prints.
scripts/verifyToken health check. Shows exactly which accounts and Pages the token can reach.
scripts/doctorDiagnoses a broken connection and tells you which fix applies.
SETUP.mdTwo ways to get a Meta system-user token.
examples/Real transcripts of the kit answering real questions.
.env.exampleWhere your token goes. Copy to .env, which is git-ignored.

Frequently asked questions

How do I connect my Facebook Ads account to Claude?

Create a Meta system-user token in Business Settings with your ad account, Page and Instagram assigned, then clone Nexus for Meta in Claude Code and paste the token into the chat. Claude writes it to a local .env file and verifies the connection. Setup takes about ten minutes and the token does not expire.

Is there a Meta Ads MCP server for Claude?

Nexus for Meta deliberately does not use MCP. There is no server to install, run or keep alive. Claude calls the Meta Graph API directly with curl using your access token. That means nothing to maintain, no extra process, and no third party sitting between your ad data and Claude.

Do I need to build my own Meta app to use the Marketing API?

You can, but you do not have to. Nexus for Meta supports two paths: request access to an existing shared app, or create your own Business-type app in the Meta developer console. Your own app stays in Development mode and needs no App Review, because you are only ever accessing accounts you own.

Can Claude create or pause my Facebook campaigns?

Yes, but only when you explicitly ask for that specific change. The kit defaults to read-only. Every write is described in plain language with the exact dollar amounts before it runs, and new campaigns are always created paused so nothing can start spending by accident.

Is it safe to give Claude my Meta access token?

The token is stored only in a local .env file that is git-ignored and never leaves your machine. Requests go straight from your computer to graph.facebook.com. Nothing routes through any third-party server. The token does carry ads_management, so it can spend money, which is why the kit defaults to read-only and confirms every write.

What Meta permissions does the token need?

ads_read, ads_management, pages_show_list, pages_read_engagement, pages_manage_metadata, pages_manage_posts, instagram_basic, instagram_manage_insights, leads_retrieval and business_management. Grant only the ones you need; ads_read alone is enough for reporting.

Why do I get error 190 on Page posts or lead forms?

Page-level endpoints need a Page access token, not the user token. Fetch it with me/accounts?fields=name,access_token and use the token belonging to the Page you want. Ad-account reads do not need this. Claude already knows the rule and handles it for you.

Which Meta Graph API version does it use?

v25.0, the current version, set in .env as META_API_VERSION so you can pin a different one without touching any code.

What does Nexus for Meta cost?

Nothing. It is open source under the MIT License. You need a Claude subscription and your own Meta ad account; there are no other costs and no hosted service.

Who made Nexus for Meta?

Irfad Imtiaz, Director of Technology at My Legal Academy, built and maintains it. My Legal Academy publishes it.

Who built Nexus for Meta

Irfad Imtiaz built and maintains Nexus for Meta. He is Director of Technology at My Legal Academy, which publishes this kit and uses it with the law firms it works with. My Legal Academy trains firm owners to run their practice with AI through its AI Labs program and done-for-you build engagements.

Find him at irfad.me, LinkedIn and GitHub.

More open-source kits by Irfad Imtiaz