# MCP (Model Context Protocol) Examples This directory contains examples demonstrating MCP integration and usage patterns in Swarms. ## Agent Examples - [agent_mcp_old.py](agent_examples/agent_mcp_old.py) - Legacy MCP agent implementation - [agent_multi_mcp_connections.py](agent_examples/agent_multi_mcp_connections.py) - Multi-connection MCP agent - [agent_tools_dict_example.py](agent_examples/agent_tools_dict_example.py) - Agent tools dictionary example - [mcp_exampler.py](agent_examples/mcp_exampler.py) - MCP example implementation ## MCP Agent Tool - [mcp_agent_tool.py](mcp_agent_tool.py) - Core MCP agent tool implementation ## MCP Utils - [client.py](mcp_utils/client.py) - MCP client implementation - [mcp_client_call.py](mcp_utils/mcp_client_call.py) - Client call examples - [mcp_multiple_servers_example.py](mcp_utils/mcp_multiple_servers_example.py) - Multiple server connections - [multiagent_client.py](mcp_utils/multiagent_client.py) - Multi-agent client - [singleagent_client.py](mcp_utils/singleagent_client.py) - Single agent client - [test_multiple_mcp_servers.py](mcp_utils/test_multiple_mcp_servers.py) - Multi-server testing ### Utils Subdirectory - [find_tools_on_mcp.py](mcp_utils/utils/find_tools_on_mcp.py) - Tool discovery on MCP - [mcp_execute_example.py](mcp_utils/utils/mcp_execute_example.py) - MCP execution examples - [mcp_load_tools_example.py](mcp_utils/utils/mcp_load_tools_example.py) - Tool loading examples - [mcp_multiserver_tool_fetch.py](mcp_utils/utils/mcp_multiserver_tool_fetch.py) - Multi-server tool fetching ## Multi-MCP Examples - [multi_mcp_example.py](multi_mcp_example.py) - Multi-MCP integration example ## Multi-MCP Guide - [agent_mcp.py](multi_mcp_guide/agent_mcp.py) - MCP agent implementation - [mcp_agent_tool.py](multi_mcp_guide/mcp_agent_tool.py) - MCP agent tool - [okx_crypto_server.py](multi_mcp_guide/okx_crypto_server.py) - OKX crypto server integration ## Servers - [mcp_agent_tool.py](servers/mcp_agent_tool.py) - Server-side MCP agent tool - [mcp_test.py](servers/mcp_test.py) - MCP server testing - [okx_crypto_server.py](servers/okx_crypto_server.py) - OKX crypto server - [test.py](servers/test.py) - Server testing utilities ## Utilities - [utils.py](utils.py) - General MCP utilities