{"library":"mcpadapt","title":"MCPAdapt: Multi-Agent Framework Adapter","description":"MCPAdapt is a Python library designed to bridge the gap between different multi-agent cooperative (MCP) servers and various agentic frameworks. It allows developers to integrate agent servers (e.g., those following the MCP specification) with popular AI agent frameworks like CrewAI and SmolAgents, abstracting away framework-specific communication details. The current version is 0.1.20, with frequent minor releases focusing on new adapter features and bug fixes.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install mcpadapt","pip install mcpadapt[crewai]","pip install mcpadapt[smolagents]"],"cli":null},"imports":["from mcpadapt import MCPAdapt","from mcpadapt.adapters.crewai import CrewAIAdapter","from mcpadapt.adapters.smolagents import SmolAgentsAdapter"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import uvicorn\nfrom fastapi import FastAPI\nfrom mcpadapt import MCPAdapt\nfrom mcpadapt.adapters.smolagents import SmolAgentsAdapter\n\n# Define a simple function for the agent\ndef add(a: int, b: int) -> int:\n    \"\"\"Adds two numbers.\"\"\"\n    return a + b\n\n# Initialize the SmolAgentsAdapter with the function\nsmolagents_adapter = SmolAgentsAdapter(\n    name=\"adder\",\n    description=\"An agent that adds two numbers.\",\n    func=add\n)\n\n# Create the MCPAdapt server\nmcp_server = MCPAdapt(\n    agent_id=\"adder_agent\",\n    adapter=smolagents_adapter,\n    server_params={\n        \"host\": os.environ.get('MCP_HOST', '127.0.0.1'), \n        \"port\": int(os.environ.get('MCP_PORT', '8000'))\n    }\n)\n\n# To run the server (this will block):\n# mcp_server.run()\n\n# Alternatively, integrate with an existing FastAPI app (recommended for production):\napp = FastAPI()\napp.include_router(mcp_server.router)\n\n# You can then run this FastAPI app using uvicorn:\n# uvicorn your_module_name:app --host 127.0.0.1 --port 8000\n# For testing, you could run:\n# if __name__ == \"__main__\":\n#     import os\n#     os.environ['MCP_HOST'] = '127.0.0.1'\n#     os.environ['MCP_PORT'] = '8000'\n#     mcp_server.run()\n","lang":"python","description":"This quickstart demonstrates how to set up an MCPAdapt server using the SmolAgentsAdapter. It wraps a simple Python function (`add`) into an agent service, making it accessible via the MCP specification. The server can be run standalone using `mcp_server.run()` or integrated into an existing FastAPI application.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}