Skip to content

Docker Deployment

The Dota 2 Match MCP Server is available on DockerHub for easy deployment.

Quick Start

docker run --pull=always -p 8081:8081 dbcjuanma/mcp_replay_dota2 --transport sse

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 transport runs an HTTP server, which is ideal for Docker deployments:

docker run --pull=always -p 8081:8081 dbcjuanma/mcp_replay_dota2 --transport sse --port 8081

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:

docker run --pull=always -i dbcjuanma/mcp_replay_dota2

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

{
  "mcpServers": {
    "dota2-match-analysis": {
      "url": "http://localhost:8081/sse"
    }
  }
}

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:

  1. Pre-compiled bytecode (UV_COMPILE_BYTECODE=1) - Python bytecode is compiled at build time
  2. Slim base image - Uses python:3.12-slim-bookworm for minimal size
  3. Layer caching - Dependencies are installed in a separate layer for faster rebuilds
  4. No runtime dependency resolution - Uses locked dependencies from uv.lock

Production Deployment

For production deployments, consider:

  1. Use a specific version tag instead of latest for reproducibility:

    docker run --pull=always -p 8081:8081 dbcjuanma/mcp_replay_dota2:1.2.0 --transport sse
    

  2. Set resource limits:

    docker run --pull=always -p 8081:8081 \
      --memory=2g \
      --cpus=2 \
      dbcjuanma/mcp_replay_dota2 --transport sse
    

  3. 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