MCPcopy Index your code
hub / github.com/bh-rat/asyncmcp

github.com/bh-rat/asyncmcp @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
883 symbols 3,529 edges 83 files 737 documented · 83%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

asyncmcp - Async transport layers for MCP

License Python Version Project Status: Alpha Documentation


📚 Documentation

View Full Documentation - Comprehensive guides, API reference, and examples


Overview

A regular MCP Server but working over queues :

https://github.com/user-attachments/assets/4b775ff8-02ae-4730-a822-3e1cedf9d744

Another MCP Server that sends async responses via Webhooks :

https://github.com/user-attachments/assets/22f15a96-13bf-4038-8e80-938d9ee490c9

Quoting from the official description :

MCP is an open protocol that standardizes how applications provide context to LLMs.

But a lot of this context is not always readily available and takes time for the applications to process - think batch processing APIs, webhooks or queues. In these cases with the current transport layers, the MCP server would have to expose a light-weight polling wrapper in the MCP layer to allow waiting and polling for the tasks to be done. Although SSE does provide async functionalities but it comes with caveats.

asyncmcp explores supporting more of the async transport layer implementations for MCP clients and servers, beyond the officially supported stdio and Streamable Http transports.

The whole idea of an MCP server with async transport layer is that it doesn't have to respond immediately to any requests. It can choose to direct them to internal queues for processing and the client doesn't have to stick around for the response.

Available Transports

Installation

# Using uv (recommended)
uv add asyncmcp

# Using pip
pip install asyncmcp

For detailed setup instructions and requirements, see the Installation Guide.

Quick Start

Check out the Quickstart Guide to get running in 5 minutes.

Examples

Complete working examples are available in the /examples directory and documented in the Examples Guide.

Contributing

We welcome contributions! Please see our Contributing Guide for details.

git clone https://github.com/bh-rat/asyncmcp.git
cd asyncmcp
uv sync

License

Apache License 2.0 - see LICENSE file for details.

Links

Core symbols most depended-on inside this repo

print_colored
called by 192
examples/shared.py
send
called by 55
src/asyncmcp/proxy/interceptor.py
validate_session_id
called by 32
src/asyncmcp/common/utils.py
aclose
called by 30
src/asyncmcp/proxy/interceptor.py
to_session_message
called by 21
src/asyncmcp/common/utils.py
connect
called by 19
src/asyncmcp/proxy/client.py
delete_sqs_message
called by 18
src/asyncmcp/common/aws_queue_utils.py
create_error_response
called by 17
src/asyncmcp/streamable_http_webhook/utils.py

Shape

Method 561
Function 210
Class 112

Languages

Python100%

Modules by API surface

tests/common/test_utils.py36 symbols
src/asyncmcp/streamable_http_webhook/client.py34 symbols
tests/streamable_http_webhook/test_comprehensive.py32 symbols
tests/sns_sqs/test_server_transport.py31 symbols
tests/streamable_http_webhook/test_basic_functionality.py26 symbols
tests/sqs/test_server_transport.py26 symbols
tests/sns_sqs/test_client_transport.py26 symbols
src/asyncmcp/streamable_http_webhook/server.py26 symbols
tests/webhook/test_server_transport.py25 symbols
tests/webhook/test_integration.py25 symbols
tests/sns_sqs/test_integration.py25 symbols
tests/sns_sqs/conftest.py23 symbols

For agents

$ claude mcp add asyncmcp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact