home / mcp / opendota mcp server

OpenDota MCP Server

Provides real-time OpenDota data through MCP, enabling clients to fetch player, match, hero, and team information.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "asusevski-opendota-mcp-server": {
      "command": "python",
      "args": [
        "-m",
        "src.opendota_server.server"
      ],
      "env": {
        "OPENDOTA_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

OpenDota MCP Server provides a standard interface to query real-time OpenDota data through an MCP client. It exposes endpoints for player profiles, match data, hero statistics, and more, enabling large language models and AI assistants to fetch Dota 2 statistics and related information on demand.

How to use

You connect an MCP client to the OpenDota MCP Server to request data such as player profiles, recent matches, hero rankings, and match details. Use the client to invoke the available tools and receive structured data in response. Typical workflows include querying a player’s recent matches, looking up professional players, retrieving match details, or fetching hero statistics for analysis or summarization.

How to install

Prerequisites you need before installation: Python 3.x, a working environment for running Python applications, and optionally a client that can consume MCP services. If you plan to use Claude Desktop, you will also prepare a configuration that connects to the local server through your MCP client.

# Option 1: Quick local run (directly run the server)
python -m src.opendota_server.server

Option 2: Manual installation (clone and set up) includes optional automated setup or manual package preparation. You can adapt the steps to your shell preference (bash, zsh, etc.).

# Clone the repository
git clone https://github.com/asusevski/opendota-mcp-server.git
cd opendota-mcp-server

# Option 1: Automated setup (works with bash, zsh, and other shells)
./scripts/setup_env.sh

# Option 2: Manual installation with uv
uv add pyproject.toml

# For development dependencies
uv pip install -e ".[dev]"

Environment variables you may set before running the server include the OpenDota API key. Create or obtain an API key and set it in your environment as OPENDOTA_API_KEY.

Running the server directly is straightforward once dependencies are installed.

Start the server with the following command.

python -m src.opendota_server.server

Claude Desktop and MCP config example

If you use Claude Desktop to access the MCP, you can configure it to run the server inside a Windows Subsystem for Linux (WSL) environment. The following configuration snippet shows a sample setup for running the server under WSL.

{
  "mcpServers": {
    "opendota": {
      "command": "wsl.exe",
      "args": [
        "--",
        "bash",
        "-c",
        "cd ~/opendota-mcp-server && source .venv/bin/activate && python src/opendota_server/server.py"
      ]
    }
  }
}

Using the example client

To exercise the server locally with the client code, run the client module after the server is up.

python -m src.client

Specific tools included

The server provides a set of endpoints (tools) to retrieve OpenDota data. Examples include:

- get_player_by_id – Retrieve player information by account ID

- get_player_recent_matches – Get recent matches for a player

- get_match_data – Get detailed data for a specific match

- get_player_win_loss – Get win/loss statistics for a player

- get_player_heroes – Get a player’s most played heroes

- get_hero_stats – Get statistics for heroes

- search_player – Search for players by name

- get_pro_players – Get list of professional players

- get_pro_matches – Get recent professional matches

- get_player_peers – Get players who have played with a specified player

- get_heroes – Get list of all Dota 2 heroes

- get_player_totals – Get player’s overall stats totals

- get_player_rankings – Get player hero rankings

- get_player_wordcloud – Get most common words used by player in chat

- get_team_info – Get information about a team

- get_public_matches – Get recent public matches

- get_match_heroes – Get heroes played in a specific match

Security

Protect your OpenDota API key and any accessed data. Use proper access controls and rotate keys as needed.

License

MIT

Available tools

get_player_by_id

Retrieve player information by account ID

get_player_recent_matches

Get recent matches for a player

get_match_data

Get detailed data for a specific match

get_player_win_loss

Get win/loss statistics for a player

get_player_heroes

Get a player's most played heroes

get_hero_stats

Get statistics for heroes

search_player

Search for players by name

get_pro_players

Get list of professional players

get_pro_matches

Get recent professional matches

get_player_peers

Get players who have played with a specified player

get_heroes

Get list of all Dota 2 heroes

get_player_totals

Get player's overall stats totals

get_player_rankings

Get player hero rankings

get_player_wordcloud

Get most common words used by player in chat

get_team_info

Get information about a team

get_public_matches

Get recent public matches

get_match_heroes

Get heroes played in a specific match