Skip to main content
Glama

@forgemeshlabs/x402-ads-mcp

M8ven Score mcpservers.org

Install one middleware. Monetize unused 402 responses with recommendations, discovery, and machine commerce analytics.

This is the MCP side of that network: what autonomous agents probe, want, and abandon across the x402 ecosystem — as tools for your agent.

Wraps the ForgeMesh x402 Ads & Intent Network. Paid tools settle per call in USDC on Base mainnet over the x402 protocol — no account, no API key; your wallet is the login. Publishers get reports on their own services free.

Install

{
  "mcpServers": {
    "intent": {
      "command": "npx",
      "args": ["-y", "@forgemeshlabs/x402-ads-mcp"],
      "env": {
        "WALLET_PRIVATE_KEY": "0x... (optional — enables paid analytics)",
        "X402_ADS_PUBLISHER_KEY": "pub_... (optional — free reports on your own services)"
      }
    }
  }
}

Both env vars are optional. With neither set, free tools work fully and paid tools return the x402 payment challenge (price, network, payTo) instead of settling — useful for inspection before spending anything.

Related MCP server: affiliate-router-mcp

Bonus: one-command publisher registration

This package doubles as the signup CLI for API operators (no MCP client needed):

# read the terms first: https://ads.forgemesh.io/terms
WALLET_PRIVATE_KEY=0xYOUR_WALLET npx -y @forgemeshlabs/x402-ads-mcp register \
  --url https://api.your-service.com --accept-terms

One $0.10 USDC payment on Base; the paying wallet becomes your identity and your publisher key is printed once. Invalid requests are rejected before payment — you can't pay for a doomed registration.

Tools

Tool

Price

What it returns

get_network_counters

free

Live network totals: 402s observed, agent-class requests, recommendations served

preview_recommendations

free

The exact recommendations block the middleware injects into a 402

get_terms

free

Canonical terms + complete data-collection disclosure

get_network_stats

$0.005

Network totals + monitor/indexer/agent classification split

get_intent_trends

$0.01

Top endpoints & categories autonomous agents request

get_category_demand

$0.02

Demand depth for one category: volume, buyer share, price points

get_intent_report

$0.05 / free*

Why-agents-didn't-buy funnel for one service

* get_intent_report is free with X402_ADS_PUBLISHER_KEY for services you contribute events to — the data co-op rule: your own data is free, forever.

Environment

Variable

Required

Purpose

WALLET_PRIVATE_KEY

no

Base mainnet wallet holding USDC; enables automatic settlement of paid tools

X402_ADS_PUBLISHER_KEY

no

Publisher key from ads.forgemesh.io; free lane for your own reports

X402_MAX_PRICE_USD

no

Per-call price cap in USD; can only LOWER the built-in cap ($0.05, or $0.10 for register)

X402_SESSION_BUDGET_USD

no

Cumulative cap per process; can only LOWER the built-in $10

The backend URL is fixed to https://ads.forgemesh.io (the publisher key is only ever sent there). The server refuses to sign for any payee other than the ForgeMesh Ads wallet, any network other than Base mainnet, any asset other than USDC, or any amount over the cap. Use a dedicated, low-balance wallet. The key never leaves your machine — payments are signed locally (EIP-3009) and settle on-chain.

Ready-made configs live in examples/: a Claude Desktop mcpServers block and a commented env-var template.

Testing (safe by construction)

npm test                # smoke: MCP boots over stdio and lists its 7 tools
npm run test:free       # free tools against the live network
npm run test:challenge  # every paid tool returns an x402 challenge — no wallet, nothing can spend
npm run test:all        # all of the above

No test settles a payment. The challenge test deletes the payment env vars before loading, so it cannot move funds even if your shell has a wallet configured.

The network in one sentence

We measure machine commerce, not API content — publishers running the @forgemeshlabs/x402-ads middleware contribute anonymized 402 probe metadata; this MCP sells the aggregate demand signal back to agents and builders.

Full disclosure of what publishers send (and never send): https://ads.forgemesh.io/terms

License

MIT © ForgeMesh

Available Tools

7 tools
get_category_demandGet Category DemandA

Paid, $0.02 USDC on Base via x402. Demand depth for one category: probe volume, distinct sources, buyer-class share, price points probed, daily series. Without WALLET_PRIVATE_KEY, returns the x402 payment challenge instead of settling.

NameRequiredDescriptionDefault
windowNoTime window: 24h, 7d, 30d, or all (default 30d)
categoryYesCategory to measure, e.g. finance, blockchain, images, tts
get_intent_reportGet Intent ReportA

Why-agents-didn't-buy funnel for one service: bounce funnel, traffic classes, top abandoned endpoints, retry signals. FREE with X402_ADS_PUBLISHER_KEY for your registered services (the service id is bound to your key at registration); otherwise $0.05 USDC on Base via x402. Without a publisher key or WALLET_PRIVATE_KEY, returns the x402 payment challenge.

NameRequiredDescriptionDefault
windowNoTime window: 24h, 7d, 30d, or all (default 30d)
serviceYesService identifier to report on
get_network_countersGet Network CountersB

Free. Live totals for the ForgeMesh machine-commerce network: 402 responses observed, agent-class requests, recommendations served, services reporting, and x402 services indexed.

NameRequiredDescriptionDefault

No parameters

get_network_statsGet Network StatsA

Paid, $0.005 USDC on Base via x402. Network-wide intent stats: total events, services, monitor/indexer/agent traffic classification split, and ad activity. Without WALLET_PRIVATE_KEY, returns the x402 payment challenge instead of settling.

NameRequiredDescriptionDefault

No parameters

get_termsGet Terms & Data DisclosureA

Free. The network's canonical terms of service and complete data-collection disclosure: exactly what the middleware sends and never sends.

NameRequiredDescriptionDefault

No parameters

preview_recommendationsPreview RecommendationsA

Free. See the exact typed recommendations block (sponsored + similar x402 services) that the @forgemeshlabs/x402-ads middleware would inject into a 402 response for a given endpoint and category.

NameRequiredDescriptionDefault
serviceNoYour service identifier, used only for self-exclusion in results
categoryNoCategory to match recommendations against, e.g. finance, blockchain, images
endpointNoThe probed endpoint path, e.g. /api/forecast

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.0.0
    • First observedget_category_demand
    • First observedget_intent_report
    • First observedget_intent_trends
    • First observedget_network_counters
    • First observedget_network_stats
    • First observedget_terms
    • First observedpreview_recommendations

TDQS

A3.8/5.0

Scored across 7 tools

Disambiguation4/5

Tools are mostly distinct: one for category demand, two for intent data (funnel vs trends), two for network-level stats (live counters vs detailed stats), plus terms and preview. Some overlap between get_network_counters and get_network_stats, but they target different aspects.

Naming Consistency4/5

Almost all tools use 'get_' prefix with underscore-separated nouns, consistent and readable. The exception is 'preview_recommendations' which uses 'preview' instead of 'get', but still follows the same structure.

Tool Count5/5

7 tools is well-scoped for an ads/marketplace analytics server. Each tool provides a distinct value without overwhelming the user.

Completeness4/5

Covers key analytics areas: demand, intent, network stats, terms, and ad preview. Minor gap: no tool for managing or creating ads, but that may be out of scope for this server's purpose.

Maintenance

ActivityActive
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers