Cover image
Try Now
2025-03-08

Framework de serveur MCP facile à utiliser spécialisé pour SSE.

3 years

Works with Finder

1

Github Watches

6

Github Forks

17

Github Stars

ezmcp

Easy-to-use MCP server framework specialized for 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
  • FastAPI-style middleware support
  • Easy integration with existing Starlette applications
  • Interactive documentation page for exploring and testing tools

docs_image

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

Middleware

ezmcp supports middleware similar to FastAPI, allowing you to add behavior that is applied across your entire application.

from starlette.requests import Request

from ezmcp import TextContent, ezmcp

app = ezmcp("my-app")

@app.middleware
async def process_time_middleware(request: Request, call_next):
    """Add a header with the processing time."""
    import time
    start_time = time.perf_counter()
    response = await call_next(request)
    process_time = time.perf_counter() - start_time
    response.headers["X-Process-Time"] = str(process_time)
    return response

@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}")]

For more information on middleware, see the middleware documentation.

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • OffchainLabs
  • Aller la mise en œuvre de la preuve de la participation Ethereum

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

    Reviews

    2 (1)
    Avatar
    user_DaoQO8tR
    2025-04-15

    As a dedicated MCP application user, I find the Mifos X - AI - Model Context Protocol (MCP) for Apache Fineract® by openMF to be incredibly efficient and user-friendly. It seamlessly integrates advanced AI capabilities, enhancing the operational workflows and decision-making processes. Highly recommended for organizations looking to leverage AI in their financial services. Check it out here: https://mcp.so/server/mcp-mifosx/openMF