ezmcp
by jujumilk3
ezmcp is a lightweight framework that simplifies the creation of MCP-compatible servers using a FastAPI-like syntax. It provides a decorator-based API for defining tools callable by MCP clients, with built-in support for SSE transport.
Last updated: N/A
What is ezmcp?
ezmcp is an easy-to-use MCP server framework specialized for SSE. It allows you to create MCP-compatible servers with a FastAPI-like syntax, providing a simple way to define tools that can be called by MCP clients.
How to use ezmcp?
Install ezmcp using pip install ezmcp. Then, create an ezmcp application instance and define tools using the @app.tool decorator. Run the application using app.run(host='0.0.0.0', port=8000). Access the interactive documentation at http://localhost:8000/docs and connect to the SSE endpoint at http://localhost:8000/sse.
Key features of ezmcp
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
FastAPI-style middleware support
Easy integration with existing Starlette applications
Interactive documentation page for exploring and testing tools
Use cases of ezmcp
Building MCP servers for real-time communication
Creating interactive tools for MCP clients
Developing applications that require server-sent events
Implementing custom middleware for request processing
FAQ from ezmcp
What is MCP?
What is MCP?
MCP stands for Minecraft Protocol. However, in this context, it refers to a more general message communication protocol.
What is SSE?
What is SSE?
SSE stands for Server-Sent Events, a server push technology enabling real-time data streaming from a server to a client.
How do I define a tool?
How do I define a tool?
Use the @app.tool decorator to define a function as a tool. The function's arguments will be automatically validated and converted based on their type hints.
How do I add middleware?
How do I add middleware?
Use the @app.middleware decorator to define a middleware function. Middleware functions can modify requests and responses.
Where can I find more documentation?
Where can I find more documentation?
Refer to the ezmcp/README.md file for more detailed documentation.