x402 Ads MCP
x402 Ads lets AI agents buy and verify ad placements with per-request USDC payments. Agents can discover inventory, submit campaign context, receive structured placement options, and pay through x402 without API keys or accounts. Built for autonomous promotion, attribution, and pay-per-action agent commerce.
README
@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.
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_ADS_BASE_URL |
no | Override the network base URL (default https://ads.forgemesh.io) |
BASE_RPC_URL |
no | Override the Base RPC (default https://mainnet.base.org) |
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 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。