mcp -with-streamable-http-example
A simple MCP server with streamable HTTP transport. Featuring tools, resources and prompts
claude mcp add --transport stdio jonigl-mcp-server-with-streamable-http-example python simple_streamable_http_mcp_server.py \ --env MCP_DEBUG="Enable debug logging for tool calls (1 to enable)" \ --env MCP_SERVER_PORT="Port to run the server on (default 8000; can be overridden, e.g., 9000)"
How to use
This MCP server provides a simple streamable HTTP transport interface with a small set of example tools and prompts. It runs a Python-based MCP server that serves endpoints to interact with tools like hello_world, add_numbers, random_number, return_json_example, and calculate_bmi. You can customize the server port and enable verbose debug output via environment variables. The included tools demonstrate basic arithmetic, string output, random number generation, and a BMI calculation workflow, all accessible through the MCP protocol over HTTP.
How to install
Prerequisites:
- Python 3.x installed
- Access to run scripts from the repository
- Optional: uv for running the server via UV if you prefer the uv runtime
Installation steps:
- Ensure you have Python installed and available in PATH.
- Download or clone the repository containing simple_streamable_http_mcp_server.py.
- Install any required Python dependencies if provided (usually via pip install -r requirements.txt if present).
- Run the server using the instructions below.
Usage examples:
- Default port (8000): python simple_streamable_http_mcp_server.py
- Custom port (e.g., 9000): MCP_SERVER_PORT=9000 python simple_streamable_http_mcp_server.py
- Enable debug logging: MCP_DEBUG=1 python simple_streamable_http_mcp_server.py
- Using uv if preferred: uv run mcp-server
Additional notes
Notes and tips:
- The server defaults to port 8000 unless overridden with MCP_SERVER_PORT.
- Debug logging (MCP_DEBUG) is helpful for tracing tool invocations and inputs/outputs.
- The tools provided are examples: hello_world, add_numbers, random_number, return_json_example, and calculate_bmi. They illustrate typical MCP tool interfaces (name, parameters, and description).
- If you modify the script, ensure the port configuration and environment variables align with your deployment environment.
- Since this is a Python-based MCP server, npm-related configuration is not applicable.
Related MCP Servers
mcp-proxy
A bridge between Streamable HTTP and stdio MCP transports
jupyter
🪐 🔧 Model Context Protocol (MCP) Server for Jupyter.
mcp-outline
A Model Context Protocol (MCP) server enabling AI assistants to interact with Outline documentation services.
academia_mcp
Academia MCP server: Tools for automatic scientific research
symfony
A Symfony package designed for building secure servers based on the Model Context Protocol, utilizing Server-Sent Events (SSE) and/or StreamableHTTP for real-time communication. It offers a scalable tool system tailored for enterprise-grade applications.
strands
Experimental: Bidirectional MCP integration for Strands Agents.