Skip to main content

EasyMCP

EasyMCP is a complete rewrite of the model context protocol (MCP) in Python.

Installation

uv add easymcp

Usage

The high level API exposes a ClientManager class that can be used to manage multiple MCP servers.

import asyncio
from easymcp.client.ClientManager import ClientManager
from easymcp.client.transports.stdio import StdioServerParameters

mgr = ClientManager()

searxng = StdioServerParameters(
    command="uvx",
    args=["mcp-searxng"],
)

timeserver = StdioServerParameters(
    command="uvx",
    args=["mcp-timeserver"],
)

servers = {
    "searxng": searxng,
    "timeserver": timeserver,
}

async def main():
    # initialize the client manager
    await mgr.init(servers=servers)

    # list servers
    print(mgr.list_servers())

    # remove a server
    await mgr.remove_server("searxng")

    # add a server
    await mgr.add_server("searxng", searxng)

    # list tools - these are namespaced by server name automatically
    # {server name}.{tool name}
    print(await mgr.list_tools())

    # call tool
    print(await mgr.call_tool("timeserver.get-current-time", {}))

    # list resources - these are namespaced by server name automatically
    # mcp-{server name}+{resource uri}
    print(await mgr.list_resources())

    # read resource
    print(await mgr.read_resource("mcp-timeserver+datetime://Africa/Algiers/now"))

    await asyncio.Future()

asyncio.run(main())

Core Features

  • list tools/resources/prompts caching out of the box
  • automatic cache invalidation on tool/resource/prompt change notifications
  • out of the box support for parallel requests to servers
  • full lifecycle management of servers
  • dynamic server addition/removal
  • namespaced tools/resources/prompts
  • lightweight asyncio native implementation

Why namespace tools?

Namespaced tools remove need to perform a lookup to find the correct tool. This means:

  • faster tool calls
  • tool calls can be routed across many MCP hosts at scale
  • mcp servers do not need globally unique tool names

Why namespace resources?

Resources are namespaced in a way that makes it easy to make a resource URI to a specific server. You can:

  • check if a URL needs to be resolved via mcp by checking if it starts with mcp
  • check what server to resolve the URI with
  • ingest resources into a search system like elastic search without having to store metadata about the server
  • completely eliminate the need to map URIs to servers via a database or lookup table

Comparison of classes to other MCP libraries

easyMCP modelcontextprotocol/python-sdk
ClientManager manages multiple MCP servers
ClientSession ClientSession manages a single MCP server
StdioTransport stdio_client raw subprocess transport

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for easymcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easymcp 0.4.0
File Size Uploaded Provenance
easymcp-0.4.0.tar.gz 178.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for easymcp 0.4.0
File Interpreter ABI Platform
easymcp-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 197.0 kB

Release files / easymcp-0.4.0.tar.gz

Download URL easymcp-0.4.0.tar.gz
Size 178.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c8eae857c1fcbe96969c54d347aa5d3827c7b3b08bde73ba6a59732826ab09e6
BLAKE2b-256 checksum
How to use checksums
ee8da8ad48517bccfe2bc7e2f5fb2bca8c71be8cf421ae4b8107804d7bf89dd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.18

Release files / easymcp-0.4.0-py3-none-any.whl

Download URL easymcp-0.4.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
123eb407b700df09cd8142e2153e1a8d060e14f584d0dd5683617c352cf86861
BLAKE2b-256 checksum
How to use checksums
bde2e18966fc9dd862bea375409517f9e1118e92b155f5867783b404ad532d51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.18

Security for easymcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page