Token导航 LogoToken导航TokenDH.com
MCP Agentic Mesh logo
浏览器工具未说明官方级别未说明来源级核验

MCP Agentic Mesh

MCP Server

该项目展示了如何在四个不同服务器上使用代理网格(agentic Mesh)实现MCP和A2A协议,每个服务器负责特定领域(甜点、健身房、餐厅、瑜伽)的服务,支持独立或组合查询。

工具数

4

提示词数

0

GitHub Stars

6

资源数

0
HTMLClaude浏览器自动化Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

vishalmysore

提供方

vishalmysore

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

多服务器MCP和A2A的实现

该项目演示了如何在4台不同的服务器上使用代理Mesh来实现MCP和A2A协议。每个服务器负责一个特定的域,可以独立查询或与其他服务器组合查询。 它具有使用模型上下文协议(MCP)和代理到代理(A2A)通信协议的多服务器架构。它旨在处理各种领域,如甜点、健身房、餐厅和瑜伽服务。

实现四个独立的服务器:

  1. 甜品服务器(端口7863)
  2. 健身房服务器(端口7864)
  3. 餐厅服务器(端口7865)
  4. 瑜伽服务器(端口7866)

启动服务器

甜品服务器

要启动Dessert服务器,请运行:

mvn spring-boot:run -Pdessert 

Dessert服务器的应用程序属性:

spring.application.name=dessert-server
server.port=7863
a2a.persistence=cache
tools4ai.properties.path=tools4ai_dessert.properties

Dessert服务器将在端口7863上启动:http://localhost:7863

健身房服务器

要启动Gym服务器,请运行:

mvn spring-boot:run -Pgym 

Gym服务器的应用程序属性:

spring.application.name=gym-server
server.port=7864
a2a.persistence=cache
tools4ai.properties.path=tools4ai_gym.properties

Gym服务器将在端口7864上启动:http://localhost:7864

餐厅服务员

要启动Restaurant服务器,请运行:

mvn spring-boot:run -Prestaurant

Restaurant服务器的应用程序属性:

spring.application.name=restaurant-server
server.port=7865
a2a.persistence=cache
tools4ai.properties.path=tools4ai_restaurant.properties

Restaurant服务器将在端口7865上启动:http://localhost:7865

瑜伽服务器

要启动Yoga服务器,请运行:

mvn spring-boot:run -Pyoga 

Yoga服务器的应用程序属性:

spring.application.name=yoga-server
server.port=7866
a2a.persistence=cache
tools4ai.properties.path=tools4ai_yoga.properties

Yoga服务器将在端口7866上启动:http://localhost:7866

每台服务器都有自己的tools4ai属性文件,其中包含一个单独的action.packages.to.scan:

# Dessert Server
action.packages.to.scan=org.example.desert

# Gym Server
action.packages.to.scan=org.example.gym

# Restaurant Server
action.packages.to.scan=org.example.restaurant

# Yoga Server
action.packages.to.scan=org.example.yoga

MCP服务器和客户端示例

该服务器设计为同时作为A2A(代理到代理)和MCP(模型上下文协议)服务器:

  • A2A:AI代理间通信的Google代理对代理协议
  • MCP:用于与AI模型和工具交互的模型上下文协议

Claude Desktop Integration Claude Configuration Claude Desktop Configuration

使用curl命令进行测试

您可以使用curl命令测试所有服务器。每台服务器都有自己的一组服务,并在不同的端口上运行:

  • 甜品服务器(端口7863):通过以下方式提供与甜品相关的操作 DessertService
  • 健身房服务器(端口7864):通过以下方式提供与健身房相关的操作 GymService
  • 餐厅服务器(端口7865):通过以下方式提供与餐厅相关的操作 RestaurantService
  • 瑜伽服务器(端口7866):通过以下方式提供瑜伽相关动作 YogaService

获取工具列表

对于甜品服务器(端口7863):

curl -H "Content-Type: application/json" `
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":9}' `
http://localhost:7863/

对于健身房服务器(端口7864):

curl -H "Content-Type: application/json" `
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":9}' `
http://localhost:7864/

对于餐厅服务器(端口7865):

curl -H "Content-Type: application/json" `
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":9}' `
http://localhost:7865/

对于Yoga服务器(端口7866):

curl -H "Content-Type: application/json" `
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":9}' `
http://localhost:7866/

调用工具示例

示例:调用与甜点相关的工具(端口7863):

curl -H "Content-Type: application/json" `
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "findIndianSweets",
"arguments": {
"provideAllValuesInPlainEnglish": {}
}
},
"id": 25
}' `
http://localhost:7863/

示例:调用瑜伽相关工具(端口7866):

curl -H "Content-Type: application/json" `
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getBeginnerPoses",
"arguments": {
"provideAllValuesInPlainEnglish": {}
}
},
"id": 25
}' `
http://localhost:7866/

注意:确保您为要与之交互的服务器使用了正确的端口号。

连接到克劳德桌面

通过查找您的Claude配置文件来配置Claude桌面客户端:

C:\Users\\AppData\Roaming\Claude\claude_desktop_config.json

将任何服务器添加到您的配置中。例如,要添加Yoga服务器:

{
"mcpServers": {
"yogaserver": {
"command": "java",
"args": [
"-jar",
"PATH_TO_YOUR_JAR/mcp-connector-full.jar",
"http://localhost:7866"
],
"timeout": 30000
}
}
}

对于您需要执行此操作的所有4台服务器

 "yogaserver": {
        "command": "java",
        "args": [
            "-jar",
            "/work/a2a-mcp-bridge/target/mcp-connector-full.jar",
            "http://localhost:7864"
        ],
        "timeout": 30000
    }

,
     "RestaurantServer": {
        "command": "java",
        "args": [
            "-jar",
            "/work/a2a-mcp-bridge/target/mcp-connector-full.jar",
            "http://localhost:7865"
        ],
        "timeout": 30000
    }
	,
     "GymServer": {
        "command": "java",
        "args": [
            "-jar",
            "/work/a2a-mcp-bridge/target/mcp-connector-full.jar",
            "http://localhost:7862"
        ],
        "timeout": 30000
    }
	,
     "DessertServer": {
        "command": "java",
        "args": [
            "-jar",
            "/work/a2a-mcp-bridge/target/mcp-connector-full.jar",
            "http://localhost:7863"
        ],
        "timeout": 30000
    }

您可以下载 mcp-connector-full.jar这里. 这是一个强制性组件,它使您的客户端和服务器之间能够进行MCP协议的通信。对于A2A,这不是必需的。

Mesh客户端

AgentCatalog是一个类,它允许您连接到多个服务器并跨它们处理查询。下面的示例演示了如何使用AgentCatalog查询与甜点相关的信息。 您可以将其与AgentMesh结合使用,这将允许您连接到多个服务器,并以管道或并行方式处理它们之间的查询。

@Log
public class MeshClient {
    public static void main(String[] args) {
        AgentCatalog agentCatalog = new AgentCatalog();
        agentCatalog.addAgent("http://localhost:7862/");
        agentCatalog.addAgent("http://localhost:7863/");
        String answer = agentCatalog.processQuery("what is the receipe for Gulab Jamun").getTextResult();
        log.info("Answer: " + answer);
    }
}

目录标签

目录标签

HTMLClaude浏览器自动化本地部署多服务器架构代理通信领域服务AI模型交互协议实现

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP