Get the FREE Ultimate OpenClaw Setup Guide →

mcp -with-streamable-http-example

A simple MCP server with streamable HTTP transport. Featuring tools, resources and prompts

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Ensure you have Python installed and available in PATH.
  2. Download or clone the repository containing simple_streamable_http_mcp_server.py.
  3. Install any required Python dependencies if provided (usually via pip install -r requirements.txt if present).
  4. 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

Sponsor this space

Reach thousands of developers