{"id":9102,"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.","status":"active","version":"0.1.20","language":"en","source_language":"en","source_url":"https://github.com/grll/mcpadapt","tags":["agent","multi-agent","adapter","llm","framework","fastapi","crewai","smolagents","mcp"],"install":[{"cmd":"pip install mcpadapt","lang":"bash","label":"Install core library"},{"cmd":"pip install mcpadapt[crewai]","lang":"bash","label":"Install with CrewAI adapter dependencies"},{"cmd":"pip install mcpadapt[smolagents]","lang":"bash","label":"Install with SmolAgents adapter dependencies"}],"dependencies":[{"reason":"Core dependency for creating the web server endpoints.","package":"fastapi","optional":false},{"reason":"ASGI server for running the FastAPI application.","package":"uvicorn","optional":false},{"reason":"Used for data validation and settings management (>=2.0 required).","package":"pydantic","optional":false},{"reason":"For Server-Sent Events (SSE) support.","package":"sse_starlette","optional":false},{"reason":"For WebSocket transport support.","package":"websockets","optional":false}],"imports":[{"symbol":"MCPAdapt","correct":"from mcpadapt import MCPAdapt"},{"note":"Adapters are located in the `mcpadapt.adapters` submodule.","wrong":"from mcpadapt.crewai import CrewAIAdapter","symbol":"CrewAIAdapter","correct":"from mcpadapt.adapters.crewai import CrewAIAdapter"},{"note":"Adapters are located in the `mcpadapt.adapters` submodule.","wrong":"from mcpadapt.smolagents import SmolAgentsAdapter","symbol":"SmolAgentsAdapter","correct":"from mcpadapt.adapters.smolagents import SmolAgentsAdapter"}],"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."},"warnings":[{"fix":"Ensure your Python environment is version 3.12 or newer. Using `pyenv` or `conda` can help manage multiple Python versions.","message":"Python 3.12+ is required for `mcpadapt`.","severity":"breaking","affected_versions":"0.1.0+"},{"fix":"Pin `mcpadapt` to a specific minor version in your `requirements.txt` (e.g., `mcpadapt==0.1.20`) and review release notes for any breaking changes before upgrading.","message":"The library is in `0.x.x` versioning, implying potential API instability.","severity":"gotcha","affected_versions":"0.1.0+"},{"fix":"Ensure the version of your agentic framework (e.g., CrewAI, SmolAgents) is compatible with the `mcpadapt` adapter version you are using. Refer to `mcpadapt`'s documentation and the respective framework's documentation for compatibility guidance, as API changes in one can break the other.","message":"Adapter-specific framework version compatibility is crucial.","severity":"gotcha","affected_versions":"0.1.0+"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install `mcpadapt` along with its required dependencies explicitly: `pip install mcpadapt fastapi uvicorn pydantic sse_starlette websockets`. Alternatively, install an adapter-specific extra like `pip install mcpadapt[crewai]` which should pull in server dependencies too.","cause":"Core server dependencies like FastAPI, Uvicorn, or Pydantic are not installed.","error":"ModuleNotFoundError: No module named 'fastapi'"},{"fix":"Upgrade your Python environment to 3.12 or later. Verify your active Python version with `python --version` and switch environments if necessary.","cause":"Attempting to run `mcpadapt` with an unsupported Python version.","error":"RuntimeError: This application requires Python 3.12 or newer."},{"fix":"Review the function signature of your adapted agent and the expected input schema. Ensure all required parameters are provided, and their types match the agent's expectations defined by the adapter. Check server logs for more specific schema errors.","cause":"Input parameters provided to the MCPAdapt server via an agent client do not match the expected Pydantic schema of the adapted agent function.","error":"ValidationError: Field required [type=missing, input_value={'a': 10}, input_type=dict]"},{"fix":"Check `mcpadapt`'s release notes for updates specific to your agentic framework. If an updated adapter version isn't available, consider pinning the framework's version to a compatible one, or adapt your agent code to match the current `mcpadapt` adapter's expectations.","cause":"The underlying agentic framework (e.g., CrewAI) has changed its API, making the `mcpadapt` adapter version incompatible or requiring an update to `mcpadapt`.","error":"AttributeError: 'CrewAIAdapter' object has no attribute 'some_method_that_was_removed'"}]}