You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.1 KiB
1.1 KiB
MCP Integration Documentation
Overview
This implementation connects an agent with a Math Server using the Model Context Protocol (MCP). The system consists of:
- Math Server (math_server.py) - Handles mathematical calculations
- Test Integration (test_integration.py) - Client that connects to the math server
Key Components
Math Agent Setup
math_server = MCPServerSseParams(
url="http://0.0.0.0:6274",
headers={"Content-Type": "application/json"},
)
math_agent = Agent(
agent_name="Math-Agent",
system_prompt="You are a math assistant. Process mathematical operations.",
max_loops=1,
mcp_servers=[math_server]
)
Task Flow
- User inputs a math operation
- Math agent processes the request
- Request is sent to math server via MCP
- Result is returned through the agent
Testing
Run the integration test:
python examples/mcp_example/math_server.py # Start server
python examples/mcp_example/test_integration.py # Run client
Implementation Notes
- Server runs on port 6274
- Uses SSE (Server-Sent Events) for transport
- Handles basic math operations (add, subtract, multiply, divide)