Skip to main content

MCPEasy 🚀

The simplest way to use Model Context Protocol in Python

A high-level, easy-to-use wrapper around the official Anthropic MCP SDK.

PyPI version Python 3.10+ License: MIT

Why MCPEasy?

The official MCP SDK is powerful but low-level. MCPEasy makes it dead simple to:

  • ✅ Connect to any MCP server with one line of code
  • ✅ Call tools without worrying about async complexity
  • ✅ Handle subprocess management automatically
  • ✅ Get started in seconds, not hours

Installation

pip install mcpeasy

Quick Start

import asyncio
from mcpeasy import connect

async def main():
    # Connect to any MCP server
    client = connect("python -m my_mcp_server")
    
    # List available tools
    tools = await client.list_tools()
    print(f"Available tools: {[t.name for t in tools.tools]}")
    
    # Call a tool
    response = await client.call("my_tool", {"arg": "value"})
    
    if response.success:
        print(response.content)
    else:
        print(f"Error: {response.error}")
    
    # Clean up
    await client.close()

asyncio.run(main())

That's it! 🎉

Comparison: Official SDK vs MCPEasy

Official MCP SDK (Low-level)

from mcp import ClientSession
from mcp.client.stdio import stdio_client, StdioServerParameters

async def use_mcp():
    server_params = StdioServerParameters(
        command="python",
        args=["-m", "my_mcp_server"],
        env=os.environ.copy()
    )
    
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            result = await session.call_tool("tool_name", {})
            # ... handle result

MCPEasy (High-level) ✨

from mcpeasy import connect

client = connect("python -m my_mcp_server")
result = await client.call("tool_name", {})

90% less code!

Features

  • 🎯 Simple API - Just connect() and call()
  • 🔄 Async/Await - Built on Python's asyncio
  • 🛠️ Tool Discovery - List all available tools
  • 🐛 Error Handling - Clear error messages
  • 📦 Process Management - Automatic subprocess handling
  • 🔌 Works with ANY MCP server - SQLite, web search, custom servers

Examples

Example 1: SQLite MCP Server

from mcpeasy import connect

# Connect to SQLite MCP server
client = connect("python -m mcp_servers.sqlite_server")

# Get database statistics
response = await client.call("get_memory_stats", {})
print(response.content)

# Run SQL query
response = await client.call("query_memories", {
    "sql": "SELECT * FROM memories WHERE category = 'personal'"
})
print(response.content)

await client.close()

Example 2: Web Search MCP Server

from mcpeasy import connect

# Connect to DuckDuckGo MCP server
client = connect("python -m mcp_servers.duckduckgo_server")

# Search the web
response = await client.call("web_search", {
    "query": "Python programming",
    "count": 5
})
print(response.content)

await client.close()

Example 3: Custom MCP Server

from mcpeasy import connect

# Connect to your custom server
client = connect("python -m my_custom_server")

# List what it can do
tools = await client.list_tools()
for tool in tools.tools:
    print(f"📌 {tool.name}: {tool.description}")

# Call your custom tool
response = await client.call("custom_tool", {"param": "value"})

await client.close()

API Reference

connect(command: str) -> MCPClient

Create an MCP client.

Parameters:

  • command (str): Command to start the MCP server (e.g., "python -m my_server")

Returns:

  • MCPClient: Ready-to-use client instance

MCPClient.call(tool: str, args: dict) -> MCPResponse

Call a tool on the MCP server.

Parameters:

  • tool (str): Name of the tool to call
  • args (dict): Arguments to pass to the tool

Returns:

  • MCPResponse: Object with .success, .content, and .error attributes

MCPClient.list_tools() -> ListToolsResult

List all available tools.

Returns:

  • ListToolsResult: Object with .tools list

MCPClient.close() -> None

Close the client and clean up resources.

Requirements

  • Python 3.10+
  • Official MCP SDK (mcp package)

Development

# Clone the repository
git clone https://github.com/yourusername/mcpeasy.git
cd mcpeasy

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Build package
python -m build

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Built on top of the official Anthropic MCP SDK
  • Inspired by the need for simpler MCP tooling

Links

Star History

If you find this useful, please ⭐ star the repository!


Made with ❤️ for the MCP community

Metadata

Release files for mcpeasy 0.1.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 mcpeasy 0.1.0
File Size Uploaded Provenance
mcpeasy-0.1.0.tar.gz 8.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 15.3 kB

Release files / mcpeasy-0.1.0.tar.gz

Download URL mcpeasy-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a7e4e3f1323037c3a64744e39efe3620eacf80b9224cdcd726289342a49ab5f6
BLAKE2b-256 checksum
How to use checksums
154a868dbed90fe285403bb02a6fba112a0a07de5215ef946d22a0c3f06e2afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / mcpeasy-0.1.0-py3-none-any.whl

Download URL mcpeasy-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eea1583496e144fbd86c3776549d58acfe204e7d4dc9d3f58643b384530a8689
BLAKE2b-256 checksum
How to use checksums
23b4d4a49f65eff9331b881142b651225024cf0aa6dafbe5401fb4ba3ec14770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for mcpeasy 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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