Skip to content

jonigl/mcp-server-with-streamable-http-example

Repository files navigation

A simple MCP server with streamable HTTP transport Example

This example demonstrates how to create a simple MCP server with streamable HTTP transport, featuring several tools, prompts, and resources.

Run

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

Tools

  • hello_world(name) - Say hello
  • add_numbers(a, b) - Add two numbers
  • random_number(min_val, max_val) - Generate random number
  • return_json_example() - Return example JSON
  • calculate_bmi(weight, height) - Calculate BMI

Prompts

  • BMI Calculator - Prompt for BMI calculation

Resources

  • server://info - Get server info

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages