This project provides a minimal Model Context Protocol (MCP) server using Python. It exposes a single tool random_float that returns a random float in [0,1). The server supports multiple transport modes: STDIO (default), HTTP, and SSE.
uv run main.py| Variable | Purpose | Default |
|---|---|---|
| APP_TRANSPORT | Transport type (STDIO, HTTP, SSE) | STDIO |
| APP_HOST | Server host | 0.0.0.0 |
| APP_PORT | Server port | 8000 |
Build the image and run:
docker build -t simple-mcp .# HTTP transport
docker run --rm -p 8000:8000 -e APP_TRANSPORT=HTTP simple-mcp
# SSE transport
docker run --rm -p 8000:8000 -e APP_TRANSPORT=SSE simple-mcp
# Custom port
docker run --rm -p 9000:9000 -e APP_TRANSPORT=HTTP -e APP_PORT=9000 simple-mcpuv --directory <path_to_project_directory> run main.py
{
"mcpServers": {
"simple_mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"<path_to_project_directory>",
"main.py"
]
}
}
}docker run --rm -i simple-mcp
{
"mcpServers": {
"simple_mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"simple-mcp"
]
}
}
}