MCP HubMCP Hub
grll

mcpadapt

by: grll

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

295created 11/01/2025
Visit
framework
tools

📌Overview

Purpose: MCPAdapt aims to facilitate seamless access to over 650 MCP servers tools from various agentic frameworks, enhancing the capabilities of applications using the Model Context Protocol (MCP).

Overview: MCPAdapt is an open-source framework designed to integrate MCP servers into agentic workflows effortlessly. By leveraging the Model Context Protocol introduced by Anthropic, it allows developers to easily utilize a diverse range of tools and resources encapsulated in MCP servers. This adaptability prompts a significant increase in the operational efficiency and effectiveness of agentic applications.

Key Features:

  • Seamless Integration: MCPAdapt simplifies the interaction with MCP servers, allowing users to execute server tools directly within their preferred agentic frameworks like Smolagents, Langchain, and CrewAI.

  • Broad Compatibility: The framework supports multiple agent frameworks and offers the flexibility to install dependencies tailored to specific frameworks, ensuring a clean setup without unnecessary bloat.

  • Extensible Architecture: MCPAdapt provides an easy mechanism for developers to create custom adapters for new frameworks, thus enhancing its extensibility and community contributions.


MCPAdapt

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 (MCP) 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 and tools to supported "MCP Clients".

This project makes calling any MCP servers tools seamless from any agentic framework, virtually providing your agentic workflow access to 650+ MCP servers tools.

Look at glama.ai or smithery.ai to get 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. You can directly use it from smolagents:

uv add smolagents[mcp]

Other Frameworks

Each agent framework has its own set of optional dependencies to avoid unnecessary clutter. You can add your desired framework in brackets in the installation command:

# with uv
uv add mcpadapt[langchain]

# or with pip
pip install mcpadapt[langchain]

Supported frameworks currently: smolagents, langchain, crewAI, google-genai.

You can also add multiple frameworks, comma separated if needed.

Usage

⚠️ 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.

Smolagents Usage

Since mcpadapt is part of smolagents, you can easily use the tool collection:

from mcp import StdioServerParameters
from smolagents.tools import ToolCollection

serverparams = StdioServerParameters(command="uv", args=["run", "src/echo.py"])

with ToolCollection.from_mcp(serverparams) as tool_collection:
    # Use your tools here
    ...

Other Frameworks Usage

MCPAdapt adapts any MCP servers into tools usable within your agentic workflow:

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

with MCPAdapt(
    StdioServerParameters(command="uv", args=["run", "src/echo.py"]),
    SmolAgentsAdapter(),
) as tools:
    # Use your adapted tools here
    ...

MCPAdapt supports Smolagents, Langchain, CrewAI, Google GenAI, and soon more like pydantic.ai, Llamaindex.

You can specify multiple MCP servers as follows:

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:
    # tools is now a flattened list from the two MCP servers
    ...

Async usage is supported if your underlying agentic framework supports it.

See examples for more details.

Contribute

To add support for your favorite agentic framework:

  1. Create a new module in src/mcpadapt/{your_framework}_adapter.py:
class YourFrameworkAdapter(ToolAdapter):
    def adapt(
        self,
        func: Callable[[dict | None], mcp.types.CallToolResult],
        mcp_tool: mcp.types.Tool,
    ) -> YourFramework.Tool:
        # Implement how to convert a function and mcp_tool (JSON Schema) into your framework tool.
    
    def async_adapt(
        self,
        afunc: Callable[[dict | None], Coroutine[Any, Any, mcp.types.CallToolResult]],
        mcp_tool: mcp.types.Tool,
    ) -> YourFramework.Tool:
        # Optional: implement async adaptation if your framework supports async functions.
  1. Test your adapter and submit a PR.

Roadmap

  • Initial framework for creating adapters
  • Support for smolagents
  • Support for pydantic-ai
  • Support for langchain
  • Support for llamaindex
  • Support for swarm
  • Support for crewAI
  • Support for google genai
  • Support for remote MCP Servers via SSE
  • Support for jupyter notebook
  • Add tests

Contributors

Thanks to all contributors and maintainers.

Core Maintainers:

Contributors: