aiohttp-tiny-mcp¶
aiohttp-tiny-mcp turns an aiohttp service into a remote MCP server. Declare
Python handlers as tools, resources, or prompts; the library exposes them over
Streamable HTTP or stdio.
It is designed for services behind a load balancer. A later request from one MCP client may reach another process, so sessions and events live in backends shared by all workers. For one process, the included memory backends are used automatically.
Start here¶
Quickstart — run a server and call a tool.
Tools, resources, and prompts — choose what to expose.
How the server fits together — understand
Exchange,SessionStore, andHubbefore deploying more than one worker.Authentication — configure Basic, Bearer, custom policies, and permissions through
Registry(auth=...).
The library supports 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25,
and 2026-07-28 from one set of handlers. Use the
compatibility table for protocol differences.
Already use the official Python SDK? Read how it compares before choosing a framework. For local benchmark methodology and results, see What it costs.
Getting started
Writing handlers
- Tools
- Resources
- Extensions and skills
- Extension compatibility through resources
- Dynamic skills
- Prompts
- Completion
- Using Exchange
- Dependencies
- Authentication
- Policies and token verifiers
- Choose an integration
- Basic authentication
- Custom authentication
- Multiple authentication methods
- Principal and storage namespaces
- Handler permissions
- Sending credentials
- Console authentication
- OAuth provider adapters
- GitHub sign-in
- Mapping accounts and roles
- Application token handling
- OAuth Bearer authentication
- Where the metadata has to be served
- Optional application middleware
- Testing a server
- Asking the user
- Notifications
- Sessions and state
Calling and running a server