Skip to main content

Adapt MCP servers to many agentic framework.

Project description

MCPAdapt

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 it's 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

# with uv
uv add mcpadapt

# or with pip
pip install mcpadapt

Usage

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

with MCPAdapt(
    # specify the command to run your favorite MCP server (support also smithery and co.)
    StdioServerParameters(command="uv", args=["run", "src/echo.py"]),

    # 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, [Pydantic.dev, Langchain, Llammaindex and more...]*.

*coming soon.

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 remote MCP Servers via SSE
  • support for jupyter notebook

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpadapt-0.0.3.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpadapt-0.0.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mcpadapt-0.0.3.tar.gz.

File metadata

  • Download URL: mcpadapt-0.0.3.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mcpadapt-0.0.3.tar.gz
Algorithm Hash digest
SHA256 507046d053c987ab3150d8565da6178ef6e17a8d25bbbbab5f572409a5cab98d
MD5 80c57f4c557f0945dd76d60c5363204f
BLAKE2b-256 8af8f64af8f157fdc9dcd55376f1776c113fc899e3dd86830e37777a4d014d33

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpadapt-0.0.3.tar.gz:

Publisher: release.yml on grll/mcpadapt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpadapt-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mcpadapt-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mcpadapt-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 09ebabc281b9c2ff44686baa9974ef9374cf7b2520b1b7bf2fdf7eaeb6f361c0
MD5 b5feba9e52ca23d53b0ae23e56c993f0
BLAKE2b-256 deac518fe8970db81e04bf78168b529186837a74243d77779552bd430c320c27

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpadapt-0.0.3-py3-none-any.whl:

Publisher: release.yml on grll/mcpadapt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page