MCP cover image

在您喜欢的代理框架中解锁650+ MCP服务器工具。

6

Github Watches

22

Github Forks

285

Github Stars

MCPAdapt

MCPAdapt Logo

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.

# with uv
uv add mcpadapt[langchain]

# or with pip
pip install mcpadapt[langchain]

Framework supported at the moment: smolagents, langchain, crewAI, google-genai.

You can also add multiple framework 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

Since mcpadapt is part of smolagents simple use tool collection from smolagents like:

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:
    ... # enjoy your tools!

Other Frameworks

MCPAdapt adapt any MCP servers into tools that you can use right in your agentic workflow:

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

with MCPAdapt(
    # specify the command to run your favorite MCP server (support also smithery and co.)
    StdioServerParameters(command="uv", args=["run", "src/echo.py"]),
    # or a dict of sse server parameters e.g. {"url": http://localhost:8000, "headers": ...}

    # specify the adapter you want to use to adapt MCP into your tool in this case smolagents.
    SmolAgentsAdapter(),
) as tools:
    # enjoy your smolagents tools as if you wrote them yourself
    ...

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:

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 of tools from the 2 MCP servers.
    ...

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

See our examples for more details on how to use.

Contribute

If your favorite agentic framework is missing no problem add it yourself it's quite easy:

  1. create a new module in src/mcpadapt/{name_of_your_framework}_adapter.py:
class YourFrameworkAdapter(ToolAdapter):
    def adapt(
        self,
        func: Callable[[dict | None], mcp.types.CallToolResult],
        mcp_tool: mcp.types.Tool,
    ) -> YourFramework.Tool:
        # HERE implement how the adapter should convert a simple function and mcp_tool (JSON Schema)
        # into your framework tool. see smolagents_adapter.py for an example
    
    def async_adapt(
        self,
        afunc: Callable[[dict | None], Coroutine[Any, Any, mcp.types.CallToolResult]],
        mcp_tool: mcp.types.Tool,
    ) -> YourFramework.Tool:
        # if your framework supports async function even better use async_adapt.
  1. and that's it, test that your adapter is working and send us a PR to share it with the world.

Roadmap

  • initial framework for anyone to start 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

We acknowledge the work and thanks every contributors and maintainers for their contributions.

Core Maintainers:

Contributors:

相关推荐

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • Beria Joey
  • 你的职业规划师,不走弯路就问我。Sponsor:小红书“ ItsJoe就出行 ”

  • Benedikt Ess
  • FindetundanalysiertOnlineProdukteeinschlielichAmazonnachVolumenBewertungenundPreis

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • Azure
  • 该存储库用于开发Azure MCP服务器,将Azure的功能带给您的代理商。

    Reviews

    2 (1)
    Avatar
    user_CAbXm6QF
    2025-04-17

    I've been using mcpadapt for a while now, and I'm thoroughly impressed with its functionality and ease of use. This adaptation tool by grll is incredibly efficient and intuitive, making my workflows much smoother. Highly recommend to anyone in need of a reliable MCP application! Check it out: https://github.com/grll/mcpadapt