A simple stateful mcp server example. Clone and modify to make any stateful mcp server.
Overview
what is MCP Stateful Example?
MCP Stateful Example is a minimal, fully MCP-compliant server and client setup designed for exploring and validating session-based tool invocation workflows using the Model Context Protocol (MCP).
how to use MCP Stateful Example?
To use MCP Stateful Example, clone the repository, install the necessary dependencies, set up the environment variables, and start the development server. You can also run unit and integration tests to validate the server behavior.
key features of MCP Stateful Example?
- Implements a minimal stateful MCP server with session handling.
- Includes test tools like
imagineandisLessThanfor testing session state. - Provides integration tests for validating server behavior and session persistence.
- Features a built-in
/healthendpoint for monitoring server status.
use cases of MCP Stateful Example?
- Developing and testing stateful applications using the Model Context Protocol.
- Validating session-based workflows in server-client interactions.
- Learning and experimenting with MCP server implementations.
FAQ from MCP Stateful Example?
- What are the prerequisites for running this project?
You need Node.js 18+, Python 3.8+, and npm or yarn installed.
- How do I run the tests?
You can run unit tests with
npm testand integration tests withnpm run itest.
- What is the purpose of the
/healthendpoint?
The
/healthendpoint is used to check the server's status.