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.
aiomcp · Python MCP clients & servers
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
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.
Small API. Useful building blocks.
Expose existing Python code through the Model Context Protocol. Connect it to agents without building the client, server, and transport layers yourself.
Register functions, async functions, and methods directly. Type hints define the tool schema; Pydantic models add structure when you need it.
Use HTTP for network connections, stdio for local processes, or in-memory and direct transports for work within an application.
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
With Python 3.11 or later, install the package:
python -m pip install aiomcpSave this example as server.py, then run python server.py. It exposes an add tool at http://127.0.0.1:8000/mcp.
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
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
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_AngelesExplore the Time server Files & directories
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-directoryReplace 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