AetherServe
An operations layer for MCP servers that adds metrics, health checks, rate limiting, structured logging, and lifecycle hooks.
README
AetherServe
An operations layer for Model Context Protocol (MCP) servers.
AetherServe wraps an MCP server built with the official Model Context Protocol Python SDK and adds the operational concerns that matter once that server leaves a notebook and goes into a real deployment: metrics, health checks, rate limiting, structured logging, and lifecycle hooks.
It is a small, dependency-light middleware layer, not a fork of the protocol or the SDK. You keep writing tools the normal way; AetherServe observes and governs the calls around them.
Why
The MCP SDK gives you the protocol. It does not give you an answer to questions every production deployment eventually asks:
- Which tools are slow, and how slow, at the p50/p95/p99?
- Is this server healthy enough to keep receiving traffic?
- What stops one client from calling an expensive tool 500 times a second?
- How do I correlate a log line with the tool call that produced it?
- How do I run code exactly once at startup and exactly once at shutdown?
AetherServe answers all five with a small, composable API, without asking you to adopt a heavier framework or change how you write MCP tools.
Installation
pip install aetherserve
This pulls in the mcp package as its only required runtime dependency.
For the bundled examples (which use Starlette/Uvicorn to expose HTTP health and metrics endpoints):
pip install "aetherserve[examples]"
Quickstart
from mcp.server.fastmcp import FastMCP
from aetherserve import AetherServer, AetherServeConfig
raw_server = FastMCP("weather-server")
server = AetherServer(raw_server, AetherServeConfig(service_name="weather-server"))
@server.tool()
def get_forecast(city: str) -> str:
return f"Sunny in {city}"
if __name__ == "__main__":
server.run()
Every call to get_forecast is now timed, counted, rate-limited against
the server's default policy, wrapped in a trace span, and logged with a
correlation id — without a single line of that logic living in
get_forecast itself.
Core Concepts
| Concern | Module | What you get |
|---|---|---|
| Metrics | aetherserve.observability.metrics |
Counters, gauges, histograms; Prometheus text exposition |
| Logging | aetherserve.observability.logging_setup |
JSON or text logs, automatic request-id correlation |
| Tracing | aetherserve.observability.tracing |
Lightweight nested spans, pluggable exporter |
| Health | aetherserve.health |
Named checks, critical vs. degraded aggregation, HTTP-status mapping |
| Rate limiting | aetherserve.ratelimit |
Token-bucket limiter, global or per-client scope, per-tool overrides |
| Lifecycle | aetherserve.hooks.lifecycle |
startup / shutdown / before_tool_call / after_tool_call / tool_call_error events |
See ARCHITECTURE.md for how these pieces fit together
around the AetherServer wrapper, and docs/ for a deeper dive
into each subsystem.
Per-tool rate limits
from aetherserve.ratelimit.policies import RateLimitScope
server.set_rate_limit(
"generate_image",
capacity=2,
refill_rate=0.1, # ~1 token every 10 seconds
scope=RateLimitScope.PER_CLIENT,
)
@server.tool(client_key=lambda client_id, prompt: client_id)
def generate_image(client_id: str, prompt: str) -> str:
...
Health checks
def database_ping() -> None:
connection.execute("SELECT 1") # raises on failure
server.add_health_check("database", database_ping, critical=True)
server.health.run_all() aggregates every registered check into a single
healthy / degraded / unhealthy report; aetherserve.health.endpoint.health_response
maps that straight into an HTTP status code your framework of choice can
return.
Examples
examples/basic_server.py— the smallest possible AetherServe server.examples/rate_limited_server.py— a stricter, per-client policy on one expensive tool.examples/full_observability_demo.py— wiring/healthzand/metricsinto a Starlette app alongside the MCP tool server.
Development
git clone https://github.com/faizansiddiq/aetherserve.git
cd aetherserve
pip install -e ".[dev]"
pytest
mypy src/aetherserve
ruff check .
See CONTRIBUTING.md for the full workflow and
docs/testing.md for how the test suite is structured
(including the in-repo fake MCP server used so unit tests don't require a
live protocol connection).
Relationship to the MCP SDK
AetherServe is not a fork, rebrand, or replacement of the official
Model Context Protocol Python SDK. It is an independent project that
takes an mcp.server.fastmcp.FastMCP instance as a constructor argument
and wraps it, in the same sense that a WSGI middleware wraps a WSGI app.
Full attribution for the underlying SDK is in NOTICE.md.
License
MIT — see LICENSE. Copyright (c) 2026 Faizan Siddiq.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。