Registry / llm-agents / mcpadapt

mcpadapt

JSON →
library0.1.20pypypi✓ verified 84d ago

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.

pip install mcpadapt
INSTALL
IMPORT
SIG · MCPADAPT
M
mcpadapt
llm-agentspythonv0.1.20
Install
17.2s avg
Import
Disk
813MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.19 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/6 runs
✓ 21.07s
py 3.11
4/6 runs
✓ 17.73s
py 3.12
4/6 runs
✓ 14.78s
py 3.13
4/6 runs
✓ 15.27s
py 3.9
✕ build_error
✕ build_error
813MB installed
● package 813MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MCPAdapt
import mcpadapt
from mcpadapt import MCPAdapt

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.

import uvicorn from fastapi import FastAPI from mcpadapt import MCPAdapt from mcpadapt.adapters.smolagents import SmolAgentsAdapter # Define a simple function for the agent def add(a: int, b: int) -> int: """Adds two numbers.""" return a + b # Initialize the SmolAgentsAdapter with the function smolagents_adapter = SmolAgentsAdapter( name="adder", description="An agent that adds two numbers.", func=add ) # Create the MCPAdapt server mcp_server = MCPAdapt( agent_id="adder_agent", adapter=smolagents_adapter, server_params={ "host": os.environ.get('MCP_HOST', '127.0.0.1'), "port": int(os.environ.get('MCP_PORT', '8000')) } ) # To run the server (this will block): # mcp_server.run() # Alternatively, integrate with an existing FastAPI app (recommended for production): app = FastAPI() app.include_router(mcp_server.router) # You can then run this FastAPI app using uvicorn: # uvicorn your_module_name:app --host 127.0.0.1 --port 8000 # For testing, you could run: # if __name__ == "__main__": # import os # os.environ['MCP_HOST'] = '127.0.0.1' # os.environ['MCP_PORT'] = '8000' # mcp_server.run()
Debug
Known issues
breakingPython 3.12+ is required for `mcpadapt`.
fix
Ensure your Python environment is version 3.12 or newer. Using `pyenv` or `conda` can help manage multiple Python versions.
affects: 0.1.0+
gotchaThe library is in `0.x.x` versioning, implying potential API instability.
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.
affects: 0.1.0+
gotchaAdapter-specific framework version compatibility is crucial.
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.
affects: 0.1.0+
Upgrade
Version history
0.1.20latest on PyPI · released Oct 24, 2025
Audit
Dependencies
fastapirequiredCore dependency for creating the web server endpoints.
uvicornrequiredASGI server for running the FastAPI application.
pydanticrequiredUsed for data validation and settings management (>=2.0 required).
sse_starletterequiredFor Server-Sent Events (SSE) support.
websocketsrequiredFor WebSocket transport support.
Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
mcpadapt — pip install mcpadapt · libregistry