multi-agent-mcp
An MCP server that exposes web lookup, save note, and list notes tools for a router-research-writer agent pipeline, enabling coordinated multi-agent workflows via the Model Context Protocol.
README
multi-agent-mcp — a 3-agent team coordinated over a custom MCP server
Built by Luis Monsalve · NovAIFlow — Applied AI Engineer (Multi-Agent · MCP · Voice AI)
A router → research → writer agent pipeline, where the agents don't call ad-hoc functions — they call tools exposed by a custom Model Context Protocol server. The same MCP server could be mounted in Claude Desktop or ChatGPT; here it's driven by a local orchestrator so you can see the whole loop in one process.
Why this exists: most "multi-agent" demos wire agents to each other with bespoke glue. That glue is exactly what MCP standardizes. This repo shows the pattern that survives production: agents are model-agnostic callers, capabilities live behind a versioned tool boundary (MCP), and the orchestrator only decides who runs when. Swap the transport from stdio to HTTP+OAuth and the same tools are consumable by any MCP client.
How it works
flowchart TD
Q[User task] --> O{Orchestrator}
O -->|1. classify| RT[Router agent]
RT -->|route decision| O
O -->|2. gather| RS[Research agent]
O -->|3. compose| WR[Writer agent]
subgraph MCP["Custom MCP server (tool boundary)"]
T1[[tool: web_lookup]]
T2[[tool: save_note]]
T3[[tool: list_notes]]
end
RS -.calls.-> T1
RS -.calls.-> T2
WR -.reads via.-> T3
WR --> A[Final answer]
- Orchestrator (
src/orchestrator.ts) owns control flow only: it runs the router, then research, then writer. It holds no domain logic. - Router agent classifies the task and returns a structured route (
research_heavy|direct|creative) — a pure decision the orchestrator acts on. - Research agent is allowed to call MCP tools (
web_lookup,save_note) to gather grounded material. - Writer agent reads the notes the researcher saved and composes the final answer.
- The MCP server (
src/mcp-server.ts) is the one place tools are defined. Agents never import tool code directly — they call it across the MCP boundary, exactly as an external client (Claude, ChatGPT) would.
Why MCP matters here (the differentiator)
MCP is the emerging standard for letting an LLM act — call tools, read resources — behind an authenticated, versioned boundary instead of hand-rolled function calls. Building agents on top of a real MCP server (rather than raw function dispatch) means:
- the same tools work from your orchestrator and from Claude Desktop / ChatGPT with zero rewrite;
- capabilities are versioned and permissioned at one boundary (add OAuth 2.1 for remote);
- you can reason about, log, and rate-limit every action in one place.
This is production-grade MCP work as a public reference — the pattern behind shipping remote MCP OAuth 2.1 connectors, shown here without any private/client code.
Quickstart
git clone https://github.com/luissalve/multi-agent-mcp
cd multi-agent-mcp
cp .env.example .env # add ANTHROPIC_API_KEY
npm install
# run the orchestrated 3-agent pipeline on a task
npm run demo -- "Summarize the tradeoffs of RAG vs long-context for support bots"
# or run the MCP server standalone (mount it in an MCP client)
npm run mcp
Environment variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
yes | Claude API key used by all three agents |
MODEL |
no (default claude-sonnet-5) |
Model id for the agents |
MCP_TRANSPORT |
no (default stdio) |
stdio for local; http is the production/remote path (see ARCHITECTURE) |
Copy .env.example to .env and fill real values — never commit .env.
Demo scope / roadmap — real vs. simplified
This is a v1 scaffold that proves the architecture, not a hardened product. Honestly:
Real / wired to a real integration point:
- A working MCP server (
@modelcontextprotocol/sdk) exposing three tools (web_lookup,save_note,list_notes) over stdio. - An orchestrator that runs router → research → writer using the Anthropic SDK's tool-use loop.
- A clean agent boundary: agents call tools through MCP, not direct imports.
Out of scope for v1 (explicitly not attempted):
- Real web search behind
web_lookup— it returns a stubbed result with a clear TODO (swap in a search API). - Remote transport + OAuth 2.1 authentication (the production path; noted in ARCHITECTURE, not implemented here).
- Persistence beyond an in-memory note store, retries, cost accounting, and observability (see
ai-engineering-cookbook'sobservabilityrecipe). - Parallel/graph agent execution — this is a linear pipeline on purpose.
A production version of this pattern — remote MCP with OAuth 2.1, many tools, operating against live business data — has been built for a client under NDA. Ask for a live walkthrough in an interview.
Tests
npm test
One real unit test covers the pure route-selection helper in src/lib/pure.ts. Starting point, not a coverage claim.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。