Skip to main content
Glama

A2A MCP Server

A2A ⚡ MCP 特工

该项目演示了两种不同的代理通信方法:

  1. 主控制程序 (MCP) - 一种基于集中式服务器的方法,代理通过中央服务器进行通信
  2. 代理对代理(A2A) ——一种去中心化的点对点方法,代理之间可以直接通信

安装

  1. 创建并激活虚拟环境:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. 安装依赖项:
pip install -r requirements.txt

用法

MCP 服务器和代理

  1. 启动 MCP 服务器:
python cli.py run-mcp-server
  1. 在单独的终端中,启动一个或多个 MCP 代理:
python cli.py run-mcp-agent --agent-id agent1 python cli.py run-mcp-agent --agent-id agent2

MCP 服务器会追踪所有已连接的代理及其状态。您可以在浏览器中打开http://localhost:5000查看状态。

A2A(代理到代理)网络

  1. 启动第一个 A2A 代理:
python cli.py run-a2a-agent --agent-id a2a1 --port 5001
  1. 启动其他 A2A 代理,并将它们连接到现有代理:
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 代理将通过其初始同伴自动发现其他代理。您可以在任何代理的终端中输入消息,以将其广播给所有连接的代理。

建筑学

MCP(主控制程序)

  • 跟踪所有代理的集中式服务器
  • 代理向服务器注册并通过心跳维持连接
  • 服务器提供Web界面来监控代理状态
  • 简单可靠,但存在单点故障

A2A(代理对代理)

  • 去中心化的点对点网络
  • 代理之间直接连接
  • 信息在网络上泛滥
  • 更具弹性,但需要更复杂的协调
  • 无单点故障

项目结构

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

贡献

请随意提交问题并请求改进演示。

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

跟踪和管理已连接代理的集中式服务器,提供 Web 界面来监控其状态,同时支持代理通过中心点进行通信。

  1. 安装
    1. 用法
      1. MCP 服务器和代理
      2. A2A(代理到代理)网络
    2. 建筑学
      1. MCP(主控制程序)
      2. A2A(代理对代理)
    3. 项目结构
      1. 贡献

        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