Skip to main content

Adapt MCP servers to many agentic framework.

Project description

MCPAdapt

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

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...]*.

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.

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.2.tar.gz (61.8 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.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcpadapt-0.0.2.tar.gz
  • Upload date:
  • Size: 61.8 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.2.tar.gz
Algorithm Hash digest
SHA256 eddff2c989e3c270d41349c08db6f156e6e8aed64c210e291b105d2a9a458af8
MD5 3b6340263930cb23b61ebe29ba9b0d92
BLAKE2b-256 25c4a8a4e88ca80cbc9aad0d385458dff3582c0e612a3de5abdf5e209a093064

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpadapt-0.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: mcpadapt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f4db90263d25629ebedf192871be9118f0b8d3204c486eca8b8c6c21e033ddc
MD5 e9e37980cb25e27adfa6ad160dc630c3
BLAKE2b-256 5adcee2be5634656801c5b664531c54da4669f58e8ed3059d4cd97cbc0cd65e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpadapt-0.0.2-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