x402 Ads MCP
@forgemeshlabs/x402-ads-mcp
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-termsOne $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 |
| free | Live network totals: 402s observed, agent-class requests, recommendations served |
| free | The exact recommendations block the middleware injects into a 402 |
| free | Canonical terms + complete data-collection disclosure |
| $0.005 | Network totals + monitor/indexer/agent classification split |
| $0.01 | Top endpoints & categories autonomous agents request |
| $0.02 | Demand depth for one category: volume, buyer share, price points |
| $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 |
| no | Base mainnet wallet holding USDC; enables automatic settlement of paid tools |
| no | Publisher key from ads.forgemesh.io; free lane for your own reports |
| no | Override the network base URL (default |
| no | Override the Base RPC (default |
Use a dedicated hot wallet holding only small working balances. 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 aboveNo 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 toolsget_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.
| Name | Required | Description | Default |
|---|---|---|---|
| window | No | Time window: 24h, 7d, 30d, or all (default 30d) | |
| category | Yes | Category to measure, e.g. finance, blockchain, images, tts |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the payment mechanism ($0.02 USDC via x402) and the fallback behavior without WALLET_PRIVATE_KEY. However, it does not describe the response structure, error handling, or side effects, leaving gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no fluff. The first sentence states core functionality, the second adds critical behavioral context. Information is front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (payment, multiple metrics, no output schema), the description is adequate but incomplete. It lists returned data dimensions but not their format, lacks error scenarios, and does not clarify how the payment challenge works in detail. Sibling tools are not referenced for context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters. The description repeats the schema examples without adding new meaning. Baseline 3 is appropriate as the description adds no semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: retrieving demand depth for a category, listing specific metrics (volume, sources, buyer-class share, price points, daily series). It uses a specific verb+resource pattern and distinguishes from siblings like get_intent_reports and get_network_stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when category demand data is needed but lacks explicit when-to-use or when-not-to-use guidance. It mentions payment requirements but does not compare with sibling tools or provide exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| window | No | Time window: 24h, 7d, 30d, or all (default 30d) | |
| service | Yes | Service identifier to report on |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden. It discloses key behaviors: returns a funnel report for a service, and without proper authentication/payment returns a challenge. It does not detail output format but is sufficiently transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, dense sentence that efficiently conveys purpose and payment model. No unnecessary words, well-structured with front-loaded action description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given only two parameters and no output schema, the description adequately covers what the tool does, its prerequisites (key or payment), and the fallback behavior. It could mention return format but is complete enough for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents both parameters. The description adds no additional semantic detail about the 'service' or 'window' parameters beyond what is in the schema, just pricing context about the key binding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: generating an intent report funnel for a specific service, listing components like bounce funnel, traffic classes, etc. It distinguishes from siblings like get_intent_trends by focusing on a single service's funnel.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use the tool based on payment model (free with key, otherwise paid) and mentions the alternative of returning a payment challenge without proper credentials. It does not explicitly compare to siblings, but the context is clear enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_intent_trendsGet Intent TrendsA
Paid, $0.01 USDC on Base via x402. Google-Trends-for-agents: top requested x402 endpoints and categories by autonomous agents, split by traffic class. Without WALLET_PRIVATE_KEY, returns the x402 payment challenge instead of settling.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows, 1-100 (default 20) | |
| window | No | Time window: 24h, 7d, 30d, or all (default 7d) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description discloses critical behavior: payment required ($0.01 USDC on Base via x402) and conditional response (payment challenge vs. settled data). This goes beyond the schema but could mention rate limits or failure handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two clear sentences front-loading the critical payment behavior, with no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters, no output schema, and no nested objects, the description explains purpose and unique behavior. It hints at output (top endpoints/categories) but could be more explicit about response structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with adequate parameter descriptions (limit, window with default and enum). The description adds no extra parameter meaning, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the resource ('top requested x402 endpoints and categories by autonomous agents') and the action ('get'), with specific detail about splitting by traffic class. This distinguishes it from sibling tools like 'get_category_demand' and 'get_intent_report'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context through payment requirements (with or without key) but does not explicitly state when to use this tool over alternatives or provide when-not scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries full burden. It mentions 'Live' totals and 'Free', but does not disclose idempotency, authentication needs, rate limits, or other behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short but includes a specific number ('402 responses observed') that may be confusing as a static example rather than a live value. It could be more general.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Without an output schema, the description should explain the return structure. It lists counters but does not clarify if these are all fields or just a sample, leaving ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has zero parameters, so the description adds value by listing the specific counters returned (responses observed, agent-class requests, etc.), providing context beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it provides 'live totals for the ForgeMesh machine-commerce network' and lists specific counters, distinguishing it from sibling tools like get_network_stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The only contextual clue is 'Free', but no mention of recommended use cases or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so description carries full burden. It discloses the paid nature ($0.005 USDC via x402) and the conditional behavior that without WALLET_PRIVATE_KEY it returns a payment challenge instead of data. This is valuable beyond basic stats listing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first covers payment and stats content, second explains alternative behavior. No redundant information, every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no nested objects, description adequately covers the key aspects: payment, data content, and conditional behavior. Misses rate limits or update frequency, but overall complete for a simple read operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has zero parameters with 100% coverage, so baseline is 4. Description adds meaning by stating it returns 'network-wide' stats, confirming no filtering parameters are needed. No additional parameter details required.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it retrieves network-wide intent stats including total events, services, traffic classification, and ad activity. While it doesn't explicitly differentiate from sibling tools like get_category_demand or get_intent_report, the specific resource 'network stats' and mention of payment model make the purpose distinct enough.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. It mentions payment and behavior without wallet key, but does not specify context prerequisites or scenarios for choosing this over sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries full burden. It mentions the tool is free and returns canonical terms and complete disclosure. However, it lacks details on authentication, rate limits, or response format. Adequate for a simple read-only tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences (20 words) with no filler. Front-loaded with 'Free.' First sentence gives core info, second adds precision. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool is extremely simple (0 params, no output schema, no annotations). Description fully captures what it does. Could hint at response format, but is complete enough for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has no properties (100% coverage by default). Description adds no parameter details, but none are needed. Per calibration, high coverage gives baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'get' and resource 'terms of service and complete data-collection disclosure'. It distinguishes itself from sibling tools like 'get_category_demand' and 'get_network_stats' by focusing on legal/informational content.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Although no explicit alternatives or exclusions are mentioned, the tool's unique purpose (terms & data disclosure) makes its usage self-evident. The 'Free.' tag hints at no cost for invocation. Sibling tools are clearly different in domain.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| service | No | Your service identifier, used only for self-exclusion in results | |
| category | No | Category to match recommendations against, e.g. finance, blockchain, images | |
| endpoint | No | The probed endpoint path, e.g. /api/forecast |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description only mentions 'Free.' and the output composition ('sponsored + similar x402 services'). It does not disclose behavioral traits such as side effects, authorization needs, rate limits, or read-only nature. This is insufficient for a tool with no annotation support.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, consisting of two sentences that front-load the key information (free, purpose, inputs). Every word earns its place; no redundant or vague phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has full schema coverage, no output schema, and no annotations, the description provides sufficient clarity on purpose and inputs. It mentions the output composition but lacks details on the exact format. It is adequate for a low-complexity tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with each parameter described. The description adds context beyond the schema (e.g., self-exclusion for service, sponsored + similar for category/endpoint). It slightly improves the understanding of parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool's purpose: to preview the recommendations block for the x402-ads middleware. It specifies the action ('See'), the resource ('typed recommendations block'), and the inputs ('endpoint and category'). It distinguishes itself from sibling tools which are analytics/reporting tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when wanting to preview recommendations, but does not provide explicit guidance on when to use this tool versus alternatives (e.g., get_category_demand). No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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.
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.
7 tools is well-scoped for an ads/marketplace analytics server. Each tool provides a distinct value without overwhelming the user.
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
Related MCP Connectors
AI agents publish bounties for real-world tasks. Gasless USDC payments via x402.
Give your AI agent an x402 wallet: discover and pay for services in USDC, or earn from your own.
x402 toolkit for AI agents: paid web, AI, and Base chain tools per call in USDC. Free tools too.
Agentic commerce network: discover sellers and products, negotiate, and pay USDC on Base via x402.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to discover and pay for x402-enabled services using natural language, with multi-chain support for Solana and EVM payments.161MIT
- AlicenseAqualityBmaintenanceVendor-neutral MCP server that discovers, routes, and attributes revenue across paid APIs, referral links, and affiliate programs for agent tools.8259MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to make micropayments using USDC on Solana via the x402 protocol, supporting payment requests, on-chain verification, and revenue tracking.MIT

@coinbase/payments-mcpofficial
AlicenseNot gradedqualityFmaintenanceCombines wallets, onramps, and payments via x402 to enable AI agents to autonomously discover and pay for services without API keys or complex setup.6958Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/forgemeshlabs/x402-ads-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server