From f854c8a81e6fb637cedf8547be62dcd4447ff72d Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Thu, 17 Apr 2025 17:03:01 +0000 Subject: [PATCH] docs: add README for MCP integration and implementation summary - Added `README.md` outlining how MCP integration was achieved - Includes details to communicate implementation decisions and task fulfillment --- examples/mcp_example/README.md | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 examples/mcp_example/README.md diff --git a/examples/mcp_example/README.md b/examples/mcp_example/README.md new file mode 100644 index 00000000..55fe1e74 --- /dev/null +++ b/examples/mcp_example/README.md @@ -0,0 +1,43 @@ + +# MCP Integration Documentation + +## Overview +This implementation connects an agent with a Math Server using the Model Context Protocol (MCP). The system consists of: + +1. Math Server (math_server.py) - Handles mathematical calculations +2. Test Integration (test_integration.py) - Client that connects to the math server + +## Key Components + +### Math Agent Setup +```python +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 +1. User inputs a math operation +2. Math agent processes the request +3. Request is sent to math server via MCP +4. Result is returned through the agent + +## Testing +Run the integration test: +```bash +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)