fastmcp/fastmcp_events
marvin-context-protocol[bot] 4d4c91bc95 Publish FastMCP v4.2.6 docs
2026-11-25 02:55:23 +00:00
..
fastmcp_events Publish FastMCP v4.2.6 docs 2026-11-25 02:55:23 +00:00
pyproject.toml Publish FastMCP v4.2.6 docs 2026-11-25 02:55:23 +00:00
README.md Publish FastMCP v4.2.6 docs 2026-11-25 02:55:23 +00:00

fastmcp-events

Events for FastMCP servers and clients: the io.modelcontextprotocol/events extension defined in SEP-3415, with poll and push delivery.

Experimental: the API may change in any release without a deprecation period.

pip install "fastmcp[events]"
# with the Redis-backed log, through Docket
pip install "fastmcp[events]" "fastmcp-events[docket]"
from pydantic import BaseModel

from fastmcp import FastMCP
from fastmcp_events import EventsExtension

mcp = FastMCP("alerts")
events = EventsExtension()
mcp.add_extension(events)


@events.event("alert.fired")
class AlertFired(BaseModel):
    """An alert fired."""

    project: str


# later, in a tool or webhook handler:
# await events.emit(AlertFired(project="api"))

See the Events docs.