MCP Stateful Example
About
A simple stateful mcp server example. Clone and modify to make any stateful mcp server.
Details
- Author
- stevemadere
- Downloads
- 132
- Categories
- Other
Jump to
- Implements a minimal MCP server with session handling
- Includes imagine and isLessThan test tools
- Python‑based integration tests for validating server behavior
- Built‑in /health endpoint for monitoring server status
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Stateful ExampleCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Clone the repository, install Node.js dependencies with npm install and Python dependencies for integration tests with pip install -r test/integration/requirements.txt. Create a .env.test file with PORT=3088, then start the development server with npm run dev.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp stateful example": {
"mcp-stateful-example": {
"command": "python",
"args": [
"test_initialize.py"
]
}
}
}
}
McpServers
{
"mcp-stateful-example": {
"command": "python",
"args": [
"test_initialize.py"
]
}
}
MCP Stateful Example
A minimal, fully MCP-compliant server and client setup for exploring and validating session-based tool invocation workflows using the Model Context Protocol (MCP).
Features
- Toy Stateful MCP Server: Implements a minimal MCP server with session handling
- Test Tools: Includes imagine and isLessThan tools for testing session state
- Integration Tests: Python-based tests for validating server behavior and session persistence
- Health Check: Built-in /health endpoint for monitoring server status
Prerequisites
- Node.js 18+
- Python 3.8+ (for integration tests)
- npm or yarn
Getting Started
1. Clone the repository
2. Install Node.js dependencies:
npm install
3. Install Python dependencies for integration tests:
pip install -r test/integration/requirements.txt
4. Create a
.env.test file in the project root with the following content: PORT=3088
5. Start the development server:
npm run dev
Running Tests
Unit Tests
npm test
Integration Tests
```bashSign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



