Streamable HTTP Calculator
Demonstrates building a stateful Model Context Protocol server with Streamable HTTP, featuring persistent sessions, full connection resumability, and an in-memory event store.
This repository provides a reference implementation of a stateful Model Context Protocol (MCP) calculator server using the Streamable HTTP transport. Engineered to demonstrate an enterprise-grade, session-based architecture, it features persistent state, event replay for full stream resumability, and support for complex, multi-step workflows, making it a robust solution for resilient client-server applications.
Key Features
01Implements an in-memory event store for audit trails and resumability
02Utilizes a single, consistent `/mcp` endpoint for all communication
030 GitHub stars
04Maintains persistent server-side state for each client session (30-minute inactivity timeout)
05Enables full connection resumability using `Last-Event-Id` with event replay
06Provides comprehensive calculator functionalities with session-scoped history and interactive tutoring
Use Cases
01Building enterprise APIs requiring robust state management
02Developing complex interactive workflows with guaranteed message delivery
03Creating financial applications needing resilient communication