Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezmcp-0.0.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezmcp-0.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file ezmcp-0.0.1.tar.gz.

File metadata

  • Download URL: ezmcp-0.0.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.3 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for ezmcp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 95a055b182140726785714004106a5bf79d6134074c9ae2764794e0acf8eaa9b
MD5 64a31ef4294b01a042c6708dacd4e77a
BLAKE2b-256 0c1807e31f3ef00329980fa2b4a975dc6018bd1ec81f8eaaa71afe672c44981e

See more details on using hashes here.

File details

Details for the file ezmcp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ezmcp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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

Hashes for ezmcp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64f780b1351bc40f1a1e525fb7c0435741b4b36627b4b317faa4b9c8fe3784e5
MD5 278406c2514a716f4c8e0c4d5c62be02
BLAKE2b-256 36ba21b7904792ab57efcd18ec1ae1a6e5c9e5ce6dadf9fc75ff50e025c0f570

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page