This example demonstrates how to create a simple MCP server with streamable HTTP transport, featuring several tools, prompts, and resources.
uv run mcp-server
Or directly:
python simple_streamable_http_mcp_server.py
Custom port can be set using the following environment variable:
export MCP_SERVER_PORT=8000
Alternatively you can run the server with a custom port like this:
MCP_SERVER_PORT=8000 uv run mcp-server
hello_world(name)
- Say helloadd_numbers(a, b)
- Add two numbersrandom_number(min_val, max_val)
- Generate random numberreturn_json_example()
- Return example JSONcalculate_bmi(weight, height)
- Calculate BMI
BMI Calculator
- Prompt for BMI calculation
server://info
- Get server info