aiomcp · Python MCP clients & servers

MCP made simple.
Built to perform.

High performance, proven in production. Exceptionally easy to use. Turn ordinary Python functions into tools your agents can call, with a small, familiar async API.

Open source · Python 3.11+ · Built on asyncio

Your function → an MCP toolPython
async def add(a: int, b: int) -> int:
    return a + b

# Inside your async application
server = McpServer("my-tools")
await server.register_tool(add)
await server.host(
    "http://127.0.0.1:8000/mcp"
)

Keep your Python. Let aiomcp handle the MCP connection.

Easy from the first functionRegister callables. Use your type hints.
Performance for real workloadsAsync execution and lightweight transports.
One library, both sidesBuild MCP servers and the clients that call them.

Small API. Useful building blocks.

Spend your time on the tool.

Expose existing Python code through the Model Context Protocol. Connect it to agents without building the client, server, and transport layers yourself.

Ordinary Python goes a long way.

Register functions, async functions, and methods directly. Type hints define the tool schema; Pydantic models add structure when you need it.

Choose how you connect.

Use HTTP for network connections, stdio for local processes, or in-memory and direct transports for work within an application.

Grow beyond the first example.

Use built-in OAuth support, rich tool results, and configurable session limits as your integration grows. The same library supports the client and server.

From Python to MCP

A real server.
A few lines.

With Python 3.11 or later, install the package:

python -m pip install aiomcp

Save this example as server.py, then run python server.py. It exposes an add tool at http://127.0.0.1:8000/mcp.

See client examples & full documentation
server.pyComplete example
import asyncio
from aiomcp import McpServer


async def add(a: int, b: int) -> int:
    return a + b


async def main() -> None:
    server = McpServer("my-tools")
    await server.register_tool(add)
    await server.host("http://127.0.0.1:8000/mcp")


if __name__ == "__main__":
    asyncio.run(main())

aiomcp catalog

Useful tools.
Ready to connect.

Ready-made Python MCP servers powered by aiomcp. Start with time and timezone conversion, or give an agent access to directories you choose.

Time & timezones

Time server

Get the current time in an IANA timezone and convert times between zones. Override the local timezone to suit your environment.

python -m pip install aiomcp-server-time
aiomcp-server-time --local-timezone America/Los_Angeles
Explore the Time server

Files & directories

Filesystem server

Read, write, edit, search, and organize files within explicitly allowed directories. You choose the directories when launching the server.

python -m pip install aiomcp-server-filesystem
aiomcp-server-filesystem /path/to/allowed-directory

Replace the example path with a directory you want to allow. Access is configured at launch; dynamic MCP Roots updates are not supported.

Explore the Filesystem server