agent-hub

agent-hub

MCP server for universal multi-agent communication, enabling agents to register, send/receive messages, manage tasks, and coordinate via role-based routing with project isolation.

Category
Visit Server

README

Agent Hub - 通用多Agent通信中间件

任何项目、任何 agent 接入即用的消息/任务通信枢纽。

快速开始

服务端

cd ~/agent-hub
npm install
npm start          # 或 pm2 start ecosystem.config.js

默认端口 8100,修改 config.yaml 调整。

Agent 接入(任何语言、任何框架)

所有交互都是 HTTP REST,两种调用方式:

方式一:REST API(推荐,最通用)

# 1. 注册
curl -X POST http://你的服务器:8100/api/register \
  -H 'Content-Type: application/json' \
  -d '{"name":"后端Hermes","role":"backend","project":"yiyuan","capabilities":"Node.js,API"}'
# → 返回 { "code":0, "data":{ "agent_id":"xxx" } }
# 存下 agent_id,后续所有调用都用它

# 2. 拉取消息
curl http://你的服务器:8100/api/messages/你的agent_id

# 3. 发消息给前端
curl -X POST http://你的服务器:8100/api/send_message \
  -H 'Content-Type: application/json' \
  -d '{"from_id":"你的agent_id","to_role":"frontend","content":"接口好了"}'

# 4. 查分配给自己的任务
curl "http://你的服务器:8100/api/tasks?project=yiyuan&assigned_role=backend"

# 5. 更新任务状态
curl -X PUT http://你的服务器:8100/api/tasks/任务id \
  -H 'Content-Type: application/json' \
  -d '{"from_id":"你的agent_id","status":"completed","result":"已实现,接口地址/api/member/info"}'

# 6. 查看所有在线agent
curl http://你的服务器:8100/api/agents

方式二:MCP 协议(Hermes 等支持 MCP 的客户端)

GET  /mcp/tools              # 列出所有工具
POST /mcp/tools/{tool_name}  # 调用工具,body 传参数

API 速查

方法 路径 说明
POST /api/register 注册/上线
GET /api/messages/:agent_id 拉取消息(?all=true含已读)
POST /api/send_message 发消息(to_id或to_role)
POST /api/tasks 创建分配任务
GET /api/tasks 查任务(可过滤)
PUT /api/tasks/:task_id 更新任务状态
GET /api/agents 查在线agent(?project=xxx)
POST /api/offline/:agent_id 下线
GET /health 健康检查

角色设计

角色完全自由,常见角色:

role 职责
manager 项目经理,分配任务
frontend 前端开发
backend 后端开发
qa 测试

可自定义任何角色,如 devops/designer/reviewer 等。

项目隔离

注册时指定 project,消息和任务按 project 隔离。不同项目的数据互不干扰。

Agent 替换机制

同 project + role 的 agent 重新注册时:

  1. 旧 agent 自动下线
  2. 旧 agent 的未读消息自动转移给新 agent
  3. 新 agent 立即接管该角色

心跳保活

Agent 应定期(建议30秒~1分钟)调用:

POST /mcp/tools/heartbeat { "from_id": "你的agent_id" }

超过5分钟未心跳自动标记 offline。

典型工作流

项目经理 → assign_task(to_role="backend", "实现登录接口")
后端     ← 收到消息通知 + 任务出现在任务列表
后端     → update_task(status="completed", result="接口好了")
前端     ← 收到消息通知(如果PM同时通知了前端)
前端     → 开始对接接口
测试     → assign_task(to_role="qa", "测试登录流程")
测试     → update_task(status="completed", result="通过")

安全

生产环境在 config.yaml 设置 auth_token,所有请求需带 x-auth-token 头。

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
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
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
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

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