DEV Community

Nicolas Fainstein
Nicolas Fainstein

Posted on

How I Monetized My MCP Server — And What the $0.21 First Commission Means

The test ran. The money landed.

On March 2, 2026, I ran a full end-to-end validation of an affiliate layer I built for MCP servers. Here is what the log looked like:

Step 1: POST /api/register → publisher_id returned ✅
Step 2: POST /api/campaigns → campaign_id returned ✅
Step 3: search_ads(query: "CI/CD tool") → sponsored result returned ✅
Step 4: Organic + sponsored displayed, user picks sponsored ✅
Step 5: report_event(click) → event recorded ✅
Step 6: Commission: $0.21 earned on $0.30 CPC (70/30 split) ✅
Step 7: On-chain settlement: USDC.e on Base, real wallet ✅
Enter fullscreen mode Exit fullscreen mode

Seven steps. All passed. $0.21 landed in a real wallet.

This is not a demo. It is not a prototype. The system is live at https://agentic-ads-production.up.railway.app. The test suite has 270 tests, all passing.

This is the story of how it works - and how you can monetize your MCP server today.


The Problem: 16,000+ MCP Servers. Almost None Make Money.

I have been building MCP tools since early 2025. Every Discord I joined, every GitHub thread I read, every developer coffee chat I had - same conversation:

"How do you monetize this?"

Nobody had a good answer. The four standard options all fail for MCP:

Usage-based billing - Requires auth infrastructure, billing systems, payment processing. If you are a solo dev maintaining an open-source MCP server, this is months of work that has nothing to do with your actual tool.

Sponsorships - Works great for the top 0.1% of repos with massive followings. Caps out at a few hundred dollars for everyone else. Not a business model.

Commercial licenses - Works for enterprise tools. Does not work if your users are AI agents and there is no human signing a contract.

Freemium - No natural upgrade path in a tool-call model. What exactly is the premium version of a weather tool?

The MCP ecosystem is at an inflection point: tens of thousands of servers being built, developers pouring real time into them, and almost no path to revenue.


The Insight: Your Recommendations Are Already Worth Money

Here is the thing nobody was saying out loud: MCP servers that make recommendations are already delivering enormous commercial value - they are just not capturing any of it.

When your tool says "use GitHub Actions" - you just sent GitHub a qualified user.
When your tool says "try PlanetScale for this" - you just sent PlanetScale a potential customer.
When your travel tool says "book through Booking.com" - that is a conversion, for free.

If you had written a blog post saying the same thing, you would have included an affiliate link. That blog post would pay you.

Why should a programmatic recommendation pay you less than a blog post?

It should not. And now it does not.


What I Built: Affiliate Marketing, Programmatic and Real-Time

I built agentic-ads - an affiliate recommendation marketplace for MCP servers. Here is the canonical flow:

1. User asks agent: "I need a CI/CD tool"
2. MCP server does normal research → GitHub Actions, CircleCI, Jenkins
3. MCP server calls search_ads(query: "CI/CD tool for monorepo")
   → Returns: "BuildKite – fast CI for monorepos, free for open source"
4. Server presents: [organic results] + [Sponsored: BuildKite]
5. User picks BuildKite → developer earns commission ($0.21 per click at $0.30 CPC)
6. User picks GitHub Actions → no revenue, correct info delivered
Enter fullscreen mode Exit fullscreen mode

The key mechanics:

  • You choose when to call search_ads() - it is opt-in per query type
  • Sponsored results sit alongside organic - never replacing them
  • Labeling is explicit - always marked [Sponsored]
  • No relevant sponsor? API returns { "ads": [] } - nothing shown, tool unaffected
  • You earn only when the user acts - commission on action, not on impression

This is affiliate marketing. The model is identical to a developer blogger including referral links in a "best tools for X" post. We just make it programmatic and real-time.


The Integration: Step by Step

The integration uses the @modelcontextprotocol/sdk package directly - the same SDK you already use to build your MCP server. No additional npm package required.

Step 1: Register and get your API key

Option A - Web UI (easiest): Go to https://agentic-ads-production.up.railway.app/dev/register - instant API key, no code required.

Option B - API:

curl -X POST https://agentic-ads-production.up.railway.app/api/register \
  -H "Content-Type: application/json" \
  -d '{"name": "My MCP Server", "email": "you@example.com"}'
Enter fullscreen mode Exit fullscreen mode

Response:

{ "api_key": "aa_dev_0d932be31...", "mcp_url": "https://agentic-ads-production.up.railway.app/mcp" }
Enter fullscreen mode Exit fullscreen mode

Option C - MCP Registry: Install io.github.nicofains1/agentic-ads directly in Claude Desktop, Cursor, or any MCP-compatible client.

Save api_key as the environment variable AGENTIC_ADS_KEY.

Step 2: Connect the MCP client (one-time setup)

This goes in your server initialization, before you start handling tools:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const adsClient = new Client({ name: "my-server", version: "1.0" }, {});
await adsClient.connect(
  new StreamableHTTPClientTransport(
    new URL("https://agentic-ads-production.up.railway.app/mcp"),
    { requestInit: { headers: { Authorization: `Bearer ${process.env.AGENTIC_ADS_KEY}` } } }
  )
);
Enter fullscreen mode Exit fullscreen mode

Step 3: Call search_ads inside your tool handler

server.tool("recommend_tool", async ({ query }) => {
  const organicResults = await yourExistingResearch(query);

  const result = await adsClient.callTool("search_ads", {
    query,
    max_results: 1,
  });
  const { ads } = JSON.parse(result.content[0].text);

  let response = organicResults.join("\n");

  if (ads.length > 0) {
    const ad = ads[0];
    await adsClient.callTool("report_event", {
      ad_id: ad.ad_id,
      event_type: "impression",
    });
    response += `\n\n⭐ ${ad.creative_text}${ad.link_url} [Sponsored]`;
  }

  return { content: [{ type: "text", text: response }] };
});
Enter fullscreen mode Exit fullscreen mode

Step 4: Check your earnings

const earnings = await adsClient.callTool("get_developer_earnings", {});
// → { total_earnings: 0.21, last_24h: 0.21, total_clicks: 1 }
Enter fullscreen mode Exit fullscreen mode

That is the entire integration. Your existing tool logic is unchanged. The ad fetch is additive. If the ad network is unreachable or returns no match, your tool response is unaffected.


Available MCP Tools

The ad network exposes six tools via the MCP protocol:

Tool Purpose
search_ads Fetch a relevant sponsored result for a query
report_event Record impression or click events
get_developer_earnings Check your current earnings balance
register_wallet Set your USDC payout wallet address
request_withdrawal Request a payout
get_ad_guidelines Retrieve display rules and compliance requirements

Display Rules

The get_ad_guidelines tool returns these requirements - follow them to stay in the program:

  • Always label ads as [Sponsored]
  • Show a maximum of 1-2 sponsored options per response
  • Only show ads that are relevant to the query context
  • Respect user opt-out if the end user requests no sponsored content

The rationale is the same as Google's sponsored search results: organic results are present, sponsored results are present, labels are clear, the user chooses. That transparency is what makes it acceptable rather than deceptive.


What This Is Not

I want to be direct about this because the framing matters to a lot of developers:

This is not adware. You write the search_ads() call. Nothing happens to your responses without your code. You decide which tools participate. You can disable it by removing the call.

This is not banner ads. There are no popups, no images, no interstitials. One line of text, clearly labeled [Sponsored], sitting alongside your organic results.

This is not injection. Nothing enters your response without your explicit code path.

The right mental model: a developer blog post with affiliate links. The content is useful and honest. The recommendation is genuine. The author gets compensated for a referral that converts. Same thing, programmatic.


The Revenue Numbers

Here is what the math looks like at different scale levels:

Monthly Tool Calls Conservative Strong
1,000 $7 $42
10,000 $70 $420
100,000 $700 $4,200
1,000,000 $7,000 $42,000

Based on 70% publisher share, $0.30 CPC baseline, realistic fill rates. Conservative assumes low fill rates (new marketplace). Strong assumes mature advertiser pool.

Per-event breakdown:

Event Typical CPC Your cut (70%)
Click $0.30 $0.21
Conversion $2.00 $1.40

The 70/30 split is competitive - Google AdSense gives publishers 68%.


Founding Publisher Program: 90/10 for the First 10

Right now, 10 slots are open for Founding Publishers who integrate before the marketplace fills out.

What you get:

  • 90% revenue share for 3 months from your integration date (standard is 70%)
  • Named in public launch materials as an original integrator
  • Direct line to the team for integration questions

What qualifies:

  1. Register at the API endpoint above
  2. Make at least one real search_ads() call from a production MCP server
  3. Email nicolas@agentic-ads.xyz with "Founding Publisher" when done

No application. No approval process. First 10 to integrate, in.

Why is 90% available at all? Early publishers are taking on real risk - fill rates will be lower while the advertiser side grows. The 90% rate compensates for that gap while it exists. When the marketplace matures, the standard 70% becomes more valuable in absolute dollar terms because fill rates are higher. Early publishers should be compensated for the bet they are making.


Why USDC on Base?

Two reasons:

Instant settlement. No net-30 invoicing. No payment processor delays. No $100 minimum withdrawal threshold. You earn $0.21, you can withdraw $0.21.

No friction for international developers. Base is a global L2. A developer in Lagos earns the same as a developer in San Francisco, with the same settlement speed. No bank account required, no SWIFT fees, no currency conversion delays.

If you are not into crypto: think of it as a fast direct deposit that works globally. You can convert USDC to fiat through Coinbase or any major exchange.


Technical Architecture

  • Backend: Railway, persistent SQLite - stable after migrations from two prior providers
  • Payment: USDC.e on Base - instant settlement, no payment processor fees
  • Matching: Keyword and context scoring against active campaigns
  • Protocol: Standard MCP (Model Context Protocol) - uses the same SDK you already have
  • Test suite: 270 tests, all passing
  • E2E validation: 7/7 steps passed on 2026-03-02
  • MCP Registry: io.github.nicofains1/agentic-ads

Health endpoint: https://agentic-ads-production.up.railway.app/health


The Bigger Picture

The MCP ecosystem has over 16,000 servers. AWS is building an AI agent marketplace. Cursor, Windsurf, and Codeium all support one-click MCP installation. Gartner predicts 40% enterprise adoption of multi-agent systems by 2027.

Developers are building real infrastructure. Tools that save time, prevent incidents, eliminate manual work. That value is already flowing - to GitHub, to PlanetScale, to every company that gets recommended through an agent. The developers doing the recommending are not capturing any of it.

The monetization layer for MCP is missing. That is what I am building.

If you are maintaining an MCP server, you are already in the recommendation business. You might as well get paid for it.


Getting Started

  1. Register: Self-serve web registration or POST /api/register

  2. Or install via MCP Registry: io.github.nicofains1/agentic-ads

  3. Connect the MCP client using @modelcontextprotocol/sdk (see Step 2 above)

  4. Add search_ads() to one tool handler (see Step 3 above)

  5. Deploy

The platform is live. The API is open. The $0.21 in the test wallet proves the end-to-end works.


Questions?

Drop them in the comments or open a GitHub Discussion: https://github.com/nicofains1/agentic-ads/discussions

If you build MCP tools: what is your biggest objection to integrating this? I want to hear the real concerns - every one of them is worth working through in public.

Top comments (0)