PyMCP Kit
A capability-first MCP server toolkit for FastAPI that supports Streamable HTTP and stdio transports, with registries for tools, prompts, and resources, plus optional auth hooks and task management.
README
PyMCP Kit
Documentation | Quick Start | Tasks | Security | Middleware
PyMCP Kit is a capability-first MCP server toolkit for FastAPI. It keeps the built-in transport surface small, supports Streamable HTTP and stdio, and ships app-scoped registries, roots, tasks, and optional auth hooks without pulling in a larger framework.
Quick Start
Install from PyPI:
pip install pymcp-kit
For local development from this repo:
pip install -e .
Register tools, prompts, and resources, then build an app:
from pymcp import (
CapabilitySettings,
ServerSettings,
create_app,
prompt_registry,
resource_registry,
tool_registry,
)
@tool_registry.register
def add(a: float, b: float) -> str:
return str(a + b)
@prompt_registry.register(description="Create a release summary prompt.")
def summarize_release(topic: str) -> str:
return f"Summarize the release impact for {topic}."
@resource_registry.register(
uri="memo://release-plan",
name="release_plan",
description="Latest release checklist",
mime_type="text/markdown",
)
def release_plan() -> str:
return "# Release Plan\n- freeze API\n- tag build\n"
app = create_app(
server_settings=ServerSettings(
name="demo-server",
version="0.1.0",
capabilities=CapabilitySettings(
advertise_empty_prompts=False,
advertise_empty_resources=False,
),
)
)
The HTTP transport is mounted at /mcp. For local-process integrations, use run_stdio_server(app).
Hosted documentation is built from docs/ with MkDocs Material and published to GitHub Pages.
Features
- Streamable HTTP transport for networked MCP servers
- Stdio transport for local-process MCP hosts
- Tool, prompt, and resource registries
- Roots, resource subscriptions, and app-scoped session lifecycle
- Task-aware tool execution with progress, cancellation, and result polling
- Optional authentication and authorization hooks
- Capability advertising through
CapabilitySettings - FastAPI middleware integration through
MiddlewareConfig - Small surface area focused on practical MCP server builds
Supported MCP Methods
initialize,ping,notifications/initialized, andnotifications/cancelledtools/listandtools/callprompts/listandprompts/getresources/list,resources/read,resources/subscribe, andresources/unsubscriberoots/listtasks/list,tasks/get,tasks/cancel, andtasks/result
Example Server
Run the bundled example server:
python example/run_server.py
That starts a FastAPI app on http://127.0.0.1:8088 with the MCP endpoint mounted at http://127.0.0.1:8088/mcp.
Stdio Transport
from pymcp import create_app, run_stdio_server
app = create_app()
run_stdio_server(app)
Middleware
Middleware stays separate from capability registration. Use MiddlewareConfig to control CORS, compression, logging, auth hooks, and custom ASGI middleware, then pass it into create_app(). See the hosted Middleware guide for examples.
Scope
- Prompts and resources are advertised only when registered by default
- Registries are copied into an app-scoped manager when
create_app()runs - Streamable HTTP and stdio are the only built-in transports
- Extra transports such as SSE and HTTP NDJSON are intentionally not shipped in
pymcp-kit
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.