MCPAdapt

by grll

422 382 downloads Not rated yet MIT

About

Unlock 650+ MCP servers tools in your favorite agentic framework.

Details

License
MIT

Explore

- Adapts any MCP server tools into your agentic framework
- Supports Smolagents, LangChain, CrewAI, and Google GenAI
- Works with both local stdio and remote SSE MCP servers
- Allows multiple MCP servers in a single adapter
- Supports async operation where the framework supports it

⚠️ Security Warning: When using MCP servers, especially over SSE (Server-Sent Events), be extremely cautious and only connect to trusted and verified servers. Always verify the source and security of any MCP server before connecting.

...


MCP Adapt supports Smolagents, Langchain, CrewAI, google-genai [pydantic.dev, Llammaindex and more...].
coming soon.

Note: you can also specify multiple mcp servers as in:

python
from mcp import StdioServerParameters
from mcpadapt.core import MCPAdapt
from mcpadapt.smolagents_adapter import SmolAgentsAdapter

with MCPAdapt(
[
StdioServerParameters(command="uv", args=["run", "src/echo1.py"]),
StdioServerParameters(command="uv", args=["run", "src/echo2.py"]),
],
SmolAgentsAdapter(),
) as tools:

...
```

We also support async if the underlying agentic framework supports it.

See our examples for more details on how to use.

def async_adapt(
self,
afunc: Callable[[dict | None], Coroutine[Any, Any, mcp.types.CallToolResult]],
mcp_tool: mcp.types.Tool,
) -> YourFramework.Tool:

<p align="center">
MCPAdapt Logo
</p>

PyPI version
Python versions
Tests
License
PyPI downloads
GitHub Repo stars

For more context, guides and API references visit our new documentation.

Unlock 650+ MCP servers tools in your favorite agentic framework.

Model Context Protocol is an open-source protocol introduced by Anthropic which allows anyone to simply and quickly make tools and resources available as "MCP Servers".

Since its release more than 650 MCP servers have been created giving access to many data & tools to supported "MCP Client".

This project makes calling any MCP servers tools seemless from any agentic framework. Virtually providing your agentic worfklow access to 650+ MCP servers tools.

Look at glama.ai or smithery.ai to give you an idea of what your agent could access.

Installation Instructions

Smolagents

Smolagents 1.4.1 and above directly ships with mcpadapt integrated in their tool collections object.
It means you can directly use it from smolagents:

uv add smolagents[mcp]

Other Frameworks

Each agent framework has its own set of optional dependencies to not clutter with useless dependencies.
You choose the flavor you want by adding your framework in brackets in the installation command.

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about MCPAdapt

Relevant YouTube tutorials, setups, and demos