Easy-to-use MCP server framework specialized for SSE.
Project description
ezmcp
A FastAPI-style framework for using MCP (Model Context Protocol) with Server-Sent Events (SSE).
Overview
ezmcp is a lightweight framework that makes it easy to create MCP-compatible servers using a FastAPI-like syntax. It provides a simple decorator-based API for defining tools that can be called by MCP clients.
Features
- FastAPI-style decorator API for defining MCP tools
- Automatic parameter validation and type conversion
- Automatic generation of tool schemas from function signatures
- Built-in support for SSE transport
- Easy integration with existing Starlette applications
- Interactive documentation page for exploring and testing tools
Installation
pip install ezmcp
Quick Start
from ezmcp import ezmcp, TextContent
# Create an ezmcp application
app = ezmcp("my-app")
# Define a tool
@app.tool(description="Echo a message back to the user")
async def echo(message: str):
"""Echo a message back to the user."""
return [TextContent(type="text", text=f"Echo: {message}")]
# Run the application
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
Once the server is running, you can:
- Access the interactive documentation at
http://localhost:8000/docs - Connect to the SSE endpoint at
http://localhost:8000/sse
Documentation
For more detailed documentation, see the ezmcp/README.md file.
License
MIT
commands
- install for test
pdm install -G test - install for dev
pdm install -G dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezmcp-0.0.0.tar.gz.
File metadata
- Download URL: ezmcp-0.0.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.3 CPython/3.13.2 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aae7b0dc6f21dc6e93216b4025d28dc1e5b2d7f9c3fc88e9c1b9fd21b69598b
|
|
| MD5 |
10412600d00fbb2bbca6b9f239848dc5
|
|
| BLAKE2b-256 |
a87ff310ed1e5daeb3029805221d6903e6f842232b17e2ec5541a16497770f6e
|
File details
Details for the file ezmcp-0.0.0-py3-none-any.whl.
File metadata
- Download URL: ezmcp-0.0.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.3 CPython/3.13.2 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef85e340e47ae3867ca4415419bc5c5d434c0dd1ea1ca58c98c2ea25a6c1990
|
|
| MD5 |
6738714e90f5a83314e2e3b7920245cd
|
|
| BLAKE2b-256 |
0fa5a490f1ef60c3668ba934a41419b29353acff6cf3b5c0b567bfb8afdad892
|