Agent Router (MCP Client)
This agent demonstrates Agent Orchestration using the Model Context Protocol (MCP). It acts as a router that receives natural language queries and delegates the actual work to other specialized agents.How it Works
- The Brain: Uses Anthropic’s Claude (via SDK) to understand user intent.
- The Tools: It connects to the
calculator-pythonagent via its auto-generated MCP endpoint. - The Flow:
- User asks: “Calculate 25 * 4”
- Router Agent sees it has a
calculatortool. - Router Agent calls
calculator-pythonvia MCP (tools/call). - Calculator returns
100. - Router Agent responds: “The result is 100.”
Configuration
Requires anOPENAI_API_KEY or ANTHROPIC_API_KEY and the URL of the target agent.
For local development, you must use ngrok to expose the target agent’s MCP endpoint so the LLM provider can reach it.
Source Code
- agent.yaml
- agent.js

