Machine 2 Machine Protocol
Enables AI agents to autonomously request services from other specialized agents and compensate them via x402 micropayments. Demonstrates a Machine-to-Machine economy using A2A protocol for agent communication, MCP for context management, and blockchain-based payments on Base network.
README
Machine 2 Machine Protocol
This proof-of-concept (PoC) project demonstrates autonomous economic interactions between AI Agents, modeled as services. In this architecture, agents can request tasks from other agents based on their domain expertise and reword them via x402 payments. It is a practical implementation of a Machine-to-Machine (M2M) economy, where agents interact using emerging protocols like Google's Agent-to-Agent (A2A) and x402, running on top of MCP and Base network.

The implementation relies on the following technical stack:
A2A (Agent-to-Agent) Protocol
A2A is an open-source framework from Google that enables autonomous AI agents to discover, communicate, and collaborate securely. It provides a standardized protocol for agents, even those built on different platforms, to negotiate capabilities, delegate tasks, and coordinate actions. This creates an interoperable ecosystem where specialized agents can work together to automate complex workflows and solve problems more effectively.
MCP (Model Context Protocol)
MCP is an open standard from Anthropic that serves as the semantic backbone for AI systems. It standardizes how agents connect to external data sources and tools, acting as a universal "connector" that gives an agent secure, on-demand access to the context it needs—whether from a database, a file system, or a third-party API. MCP ensures that agents operate with a shared, coherent understanding of the information and capabilities required to execute tasks accurately.
x402 Payments Protocol
The x402 protocol is an open standard from Coinbase for internet-native payments, designed for both humans and autonomous AI agents. It leverages the standard HTTP 402 Payment Required status code to create a seamless, low-friction way to pay for API calls, data access, or services rendered by other agents. Built to be chain-agnostic and trust-minimizing, x402 enables on-chain micropayments without the overhead of traditional financial systems, paving the way for a programmable economy where agents can autonomously transact for services.
How to Setup
- Start the Gemini Agent that can provide fiat currency exchange:
cd agents/langgraph
create docker build:
docker build -t langgraph-a2a-server -f Containerfile .
run docker build:
docker run -p 10000:10000 -e GOOGLE_API_KEY=<your-gemini-api-key> langgraph-a2a-server
- Start the proxy middleware: Python implementation of x402 was released couple of days ago, we had to create a typescript wrapper to manage it.
In the main folder run:
npm instal
and
npm run dev
- Just use Claude or Cursor as the Second Agent/Chatbot that has to interact via the first Agent:
open claude_desktop_config.json and attach the mcp server via adding this configuration:
{
"mcpServers": {
"demo": {
"command": "/Users/your-user/.nvm/versions/node/v23.3.0/bin/npm",
"args": [
"--silent",
"run",
"dev",
"-C",
"/Users/your-user/m2m/mcp"
],
"env": {
"PRIVATE_KEY": "your-wallet-private-key",
"RESOURCE_SERVER_URL": "http://localhost:5000",
}
}
}
}
ask Claude about a currency exchange like: how much is 10 USD in EUR?

Implementation communication schema

Conclusions
This proof-of-concept demonstrates the viability of a fully autonomous Machine-to-Machine economy by combining the interoperable, lightweight, chain-agnostic x402 payments standard with A2A communication framework and the context-rich MCP connector. Through this implementation, AI agents can dynamically discover one another’s capabilities, delegate tasks based on domain expertise, and settle micropayments seamlessly—paving the way for a scalable ecosystem of specialized Agents that offer and consume services operating as autonomous economic participants.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。