← All case studies

Custom MCP Server | Forked & Rewritten for AI Agents (93 commits)

· Project on Upwork
The agent explaining why a Meta campaign generated no leads and recommending budget changes, next to a panel of ad sets and ad previews
The agent reads campaign performance back in plain language and says what to change.

A recruitment SaaS wanted one thing to work end to end: paste a job vacancy, and get a running ad campaign out the other side. The agent writes the copy, builds branded creatives, and launches with employment-category targeting locked in, which that platform requires for job ads.

The blocker was underneath. There was no official MCP server for the ad platform, and the third-party ones were built for humans clicking through a terminal rather than for an AI caller. So I forked one and rewrote it: 93 commits, Graph API v22 through v24, with tool definitions and structured outputs shaped for an agent instead of a person.

How it works

Why the existing servers did not work

A tool built for a human can afford to be vague. It can return a wall of JSON and let the reader figure out what matters. An agent cannot do that. It needs tool definitions with tight arguments, predictable output it can parse, and errors it can actually act on rather than a stack trace.

Rewriting meant reshaping every tool around what the agent needed to decide next, and carrying the API forward three versions while doing it.

The approval gates

Nobody wants an AI spending an ad budget unsupervised. A recruiter and a manager both approve over WhatsApp before anything goes live, and campaigns launch paused, so even a mistake that gets through cannot burn money on its own.

The orchestration layer handles the messy parts: tool calling, retries, partial failures where half a campaign got created, and the approval gates in between. Guardrails sit on every write.

What it looks like running

From the recruiter's side it is a chat. Pick the ad account, paste the vacancy, and watch the ad sets, creatives and targeting appear next to the conversation with live spend, clicks and cost per lead.

When a campaign underperforms, the agent reads the numbers back and says why, in plain terms: the spend was too thin to deliver, merge the ad sets, raise the daily budget to a level where the platform can actually distribute the ad.

Let's scope your AI feature

30-minute call. Free. You leave with an architecture, the cost at your scale, and a timeline for your specific feature - whether we work together or not.

Loading calendar...