OpenDota MCP server

Integrates with the OpenDota API to provide real-time Dota 2 statistics, match data, and player information for game analysis, performance tracking, and esports research.
Back to servers
Setup instructions
Provider
Anthony Susevski
Release date
Mar 03, 2025
Language
Python
Stats
4 stars

This MCP server allows you to access OpenDota API data including player statistics, match information, and Dota 2 game data through a standardized Model Context Protocol interface. It enables AI assistants and LLMs to retrieve real-time Dota 2 information through simple, structured API calls.

Installation

You can install the OpenDota MCP server using either an automated setup script or manual installation:

# 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]"

Setting Up Your Environment

Before using the server, it's recommended to set up an API key:

  1. Create an OpenDota API key at https://www.opendota.com/api-keys
  2. Set your API key as an environment variable:
export OPENDOTA_API_KEY=your_api_key_here

Running the Server

Standard Method

Start the server directly with Python:

python -m src.opendota_server.server

With Claude Desktop

If you want to use the server with Claude Desktop, follow the integration instructions at https://modelcontextprotocol.io/quickstart/user

For WSL users, create a claude_desktop_config.json file with:

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

Testing with the Example Client

You can test the server functionality with the included example client:

python -m src.client

Available Tools

The OpenDota MCP server provides access to the following data retrieval tools:

  • Player Information

    • get_player_by_id - Retrieve player information by account ID
    • get_player_recent_matches - Get recent matches for a player
    • get_player_win_loss - Get win/loss statistics for a player
    • get_player_heroes - Get a player's most played heroes
    • get_player_peers - Get players who have played with a specified player
    • 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
    • search_player - Search for players by name
  • Match Data

    • get_match_data - Get detailed data for a specific match
    • get_match_heroes - Get heroes played in a specific match
    • get_public_matches - Get recent public matches
  • Game Information

    • get_hero_stats - Get statistics for heroes
    • get_heroes - Get list of all Dota 2 heroes
  • Professional Scene

    • get_pro_players - Get list of professional players
    • get_pro_matches - Get recent professional matches
    • get_team_info - Get information about a team

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "opendota" '{"command":"python","args":["-m","src.opendota_server.server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "opendota": {
            "command": "python",
            "args": [
                "-m",
                "src.opendota_server.server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "opendota": {
            "command": "python",
            "args": [
                "-m",
                "src.opendota_server.server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later