mcp-streamable-http
mcp-streamable-http-server provides a comprehensive development template for building StreamableHttp services with flexible authentication, dynamic service registration, customizable middleware, and easy tool configuration via YAML.
claude mcp add --transport stdio purity3-mcp-streamable-http-server uvx mcp-streamable-http-server \ --env HOST="0.0.0.0" \ --env PORT="3000" \ --env DATABASE_URL="sqlite:///./database.db"
How to use
The mcp-streamable-http-server provides a Streamable HTTP MCP service with authentication, session management, and tool execution. It supports dynamic service registration, context-aware user identification, and configurable middleware for access control and custom logic. Tools are defined via Python implementations and YAML configurations, enabling you to expose specific MCP capabilities (like demo routines, notifications, or session-related operations) to MCP inspectors and clients. To use it, start the server (the project is Python-based and recommended to run with uv), configure environment variables for your database and host, and then interact with the exposed Tools through your MCP client or the MCP Inspector to invoke actions and receive structured results.
How to install
Prerequisites:
- Python 3.13+ installed
- Git installed
- Optional: uv (recommended) for running the server
- Clone the repository:
git clone https://github.com/purity3/mcp-streamable-http-server.git
cd mcp-streamable-http-server
- Create and activate a virtual environment (recommended):
python -m venv .venv
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
- Install development dependencies (via uv):
uv pip install -e .[dev]
- Copy and customize environment configuration:
cp .env.example .env
Edit .env to set DATABASE_URL, HOST, PORT, and any other environment variables as needed. For SQLite, a typical setting is:
DATABASE_URL="sqlite:///./database.db"
HOST="0.0.0.0"
PORT="3000"
- Run the server (uv recommended):
uv run server
- Verify the server is accessible at the configured host/port, e.g. http://localhost:3000. You can connect with the MCP Inspector to test Tools, Resources, and Prompts.
Additional notes
Tips and common considerations:
- The server uses a middleware-based authentication flow; ensure your credentials and tokens are correctly configured in the client calls or via env vars.
- For SQLite databases, the database file (database.db) is typically created on first access if the path in DATABASE_URL is valid.
- When debugging with the MCP Inspector, set Transport Type to streamable-http and provide your server URL and credentials if required.
- If you enable dynamic service registration at runtime, make sure your YAML tool definitions are valid and accessible by the server.
- You can customize middleware and services to enforce IP-based access, advanced token validation, or logging as described in the README examples.
Related MCP Servers
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
python
🔐 Plug-and-play auth for Python MCP servers.
mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
servicenow-api
ServiceNow MCP Server and API Wrapper
the -company
TheMCPCompany: Creating General-purpose Agents with Task-specific Tools