https://github.com/jonigl/mcp-server-with-streamable-http-example
A simple MCP server with streamable HTTP transport. Featuring tools, resources and prompts
https://github.com/jonigl/mcp-server-with-streamable-http-example
example mcp mcp-server prompts resources simple streamable-http streamable-http-transport tools
Last synced: 3 days ago
JSON representation
A simple MCP server with streamable HTTP transport. Featuring tools, resources and prompts
- Host: GitHub
- URL: https://github.com/jonigl/mcp-server-with-streamable-http-example
- Owner: jonigl
- Created: 2025-07-05T00:09:20.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-11T14:24:33.000Z (9 months ago)
- Last Synced: 2025-09-11T17:17:30.424Z (9 months ago)
- Topics: example, mcp, mcp-server, prompts, resources, simple, streamable-http, streamable-http-transport, tools
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
By default, the server runs on port **8000**.
```bash
python simple_streamable_http_mcp_server.py
```
Or with [uv](https://github.com/astral-sh/uv):
```bash
uv run mcp-server
```
## Custom Port
Change the port (default is 8000):
```bash
MCP_SERVER_PORT=9000 python simple_streamable_http_mcp_server.py
```
## Debug Logging
Enable debug logs for tool calls:
```bash
MCP_DEBUG=1 python simple_streamable_http_mcp_server.py
```
## Both Together
```bash
MCP_SERVER_PORT=9000 MCP_DEBUG=1 python simple_streamable_http_mcp_server.py
```
## 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
- `get_logo()` - Return the OllMCP logo image
## Prompts
- `BMI Calculator` - Prompt for BMI calculation
## Resources
- `server://info` - Get server info
- `text://welcome` - Get a welcome message
- `images://ollmcp-logo` - Get the OllMCP logo image
- `file://{path*}` - Read a local text file by path