Docker Deployment¶
The Dota 2 Match MCP Server is available on DockerHub for easy deployment.
Quick Start¶
Run with SSE Transport (Recommended)¶
The --pull=always flag ensures you always get the latest image. The server will be available at http://localhost:8081/sse.
Run with Docker Compose¶
# SSE transport (default)
docker compose up mcp-server
# STDIO transport
docker compose --profile stdio run --rm mcp-server-stdio
Building Locally (Contributors Only)¶
If you want to build from source:
git clone https://github.com/DeepBlueCoding/mcp-replay-dota2.git
cd mcp-replay-dota2
docker build -t dbcjuanma/mcp_replay_dota2 .
Transport Modes¶
SSE (Server-Sent Events) - Recommended for Docker¶
SSE transport runs an HTTP server, which is ideal for Docker deployments:
Configure your MCP client to connect to http://localhost:8081/sse.
STDIO (Standard I/O)¶
STDIO transport is the default for local development but requires interactive mode in Docker:
Persistent Cache¶
Replay files are large (50-400MB) and take time to download and parse. Mount a volume to persist the cache:
docker run --pull=always -p 8081:8081 \
-v dota2-replay-cache:/app/.cache/mcp_dota2 \
dbcjuanma/mcp_replay_dota2 --transport sse
Environment Variables¶
| Variable | Default | Description |
|---|---|---|
PORT |
8081 |
Port for SSE transport |
Claude Desktop Configuration¶
SSE Transport (Recommended)¶
STDIO Transport¶
{
"mcpServers": {
"dota2-match-analysis": {
"command": "docker",
"args": ["run", "--pull=always", "-i", "--rm", "-v", "dota2-replay-cache:/app/.cache/mcp_dota2", "dbcjuanma/mcp_replay_dota2"]
}
}
}
The --pull=always flag ensures you always get the latest image on each restart.
Startup Optimization¶
The Docker image uses several optimizations for fast startup:
- Pre-compiled bytecode (
UV_COMPILE_BYTECODE=1) - Python bytecode is compiled at build time - Slim base image - Uses
python:3.12-slim-bookwormfor minimal size - Layer caching - Dependencies are installed in a separate layer for faster rebuilds
- No runtime dependency resolution - Uses locked dependencies from
uv.lock
Production Deployment¶
For production deployments, consider:
-
Use a specific version tag instead of
latestfor reproducibility: -
Set resource limits:
-
Health checks are included in
docker-compose.yml
Troubleshooting¶
Slow Startup¶
If startup is slow, ensure: - The Docker image has been built (not building on first run) - The cache volume is mounted (avoids re-downloading replays) - Sufficient memory is allocated (at least 1GB recommended)
Connection Refused¶
If you get "connection refused" when connecting to SSE:
- Ensure the container is running: docker ps
- Check the port mapping: docker run -p 8081:8081 ...
- Verify the transport mode: --transport sse