Machine 2 Machine Protocol

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.

Category
Visit Server

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.

m22

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

  1. 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
  1. 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
  1. 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?

result

Implementation communication schema

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured