Skip to main content
Glama

A2A MCP Server

A2A ⚡ MCP Agents

This project demonstrates two different approaches to agent communication:

  1. Master Control Program (MCP) - A centralized server-based approach where agents communicate through a central server
  2. Agent-to-Agent (A2A) - A decentralized peer-to-peer approach where agents communicate directly with each other

Installation

  1. Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

MCP Server and Agents

  1. Start the MCP server:
python cli.py run-mcp-server
  1. In separate terminals, start one or more MCP agents:
python cli.py run-mcp-agent --agent-id agent1 python cli.py run-mcp-agent --agent-id agent2

The MCP server will track all connected agents and their status. You can view the status by opening http://localhost:5000 in your browser.

A2A (Agent-to-Agent) Network

  1. Start the first A2A agent:
python cli.py run-a2a-agent --agent-id a2a1 --port 5001
  1. Start additional A2A agents, connecting them to existing agents:
python cli.py run-a2a-agent --agent-id a2a2 --port 5002 --peer localhost:5001 python cli.py run-a2a-agent --agent-id a2a3 --port 5003 --peer localhost:5001 --peer localhost:5002

A2A agents will automatically discover other agents through their initial peers. You can type messages in any agent's terminal to broadcast them to all connected agents.

Architecture

MCP (Master Control Program)

  • Centralized server that tracks all agents
  • Agents register with the server and maintain connection through heartbeats
  • Server provides a web interface to monitor agent status
  • Simple and reliable but has a single point of failure

A2A (Agent-to-Agent)

  • Decentralized peer-to-peer network
  • Agents connect directly to each other
  • Messages are flooded through the network
  • More resilient but requires more complex coordination
  • No single point of failure

Project Structure

a2a_mcp/ ├── agents/ # Agent implementations │ ├── mcp_agent.py # MCP-based agent │ └── a2a_agent.py # Peer-to-peer agent ├── mcp/ # MCP server implementation │ └── server.py # Flask-based MCP server ├── cli.py # Command-line interface └── requirements.txt # Python dependencies

Contributing

Feel free to submit issues and pull requests to improve the demonstration.

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

A centralized server that tracks and manages connected agents, providing a web interface to monitor their status while enabling agent communication through a central point.

  1. Installation
    1. Usage
      1. MCP Server and Agents
      2. A2A (Agent-to-Agent) Network
    2. Architecture
      1. MCP (Master Control Program)
      2. A2A (Agent-to-Agent)
    3. Project Structure
      1. Contributing

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          A server for task orchestration and coordination, facilitating task management with dependencies, multi-instance collaboration, and persistent task tracking.
          Last updated -
          7
          17
          JavaScript
          MIT License
        • -
          security
          F
          license
          -
          quality
          A server that enables AI systems to browse, retrieve content from, and interact with web pages through the Model Context Protocol.
          Last updated -
        • -
          security
          F
          license
          -
          quality
          A specialized MCP server that enables AI agents to interact with Reddit, including reading posts, creating content, and managing subreddit configurations.
          Last updated -
          71
          5
          TypeScript
        • -
          security
          F
          license
          -
          quality
          A powerful server that enables AI agents to interact with MySQL databases, execute SQL queries, and manage database content through a simple interface.
          Last updated -
          25
          4
          JavaScript
          • Apple

        View all related MCP servers

        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/khulnasoft-com/a2a-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server