OP

OpenDota MCP Server for Real-Time Dota 2 Statistics

Access real-time Dota 2 stats, match and player data via an MCP server using OpenDota API for seamless LLM and AI assistant integration.

Quick Install
npx -y @asusevski/opendota-mcp-server

Overview

This MCP (Model Context Protocol) server exposes OpenDota API data over a simple, MCP-compatible interface so language models and AI assistants can access live Dota 2 statistics. The server translates common OpenDota REST endpoints into MCP tools that an LLM can call directly, removing the need for custom API wiring inside the model pipeline.

It is useful when you want to augment conversational agents, dashboards, or automation scripts with up-to-date match details, player profiles, hero metrics, and pro match information. The design targets developers who want a plug-and-play MCP service that integrates OpenDota data into LLM tools, desktops like Claude Desktop, or other MCP-aware clients.

Features

  • Player profile and summary retrieval (by account ID)
  • Recent matches and full match details
  • Hero statistics, rankings and most-played heroes per player
  • Search and lookup for players, teams, and professional players/matches
  • Utility endpoints: player win/loss, peers, totals, wordclouds, public matches
  • Lightweight MCP server process that can run locally or in WSL
  • Example client and simple integration guidance for MCP-aware frontends

Installation / Configuration

Prerequisites: Python 3.9+, pip, and optionally uv (union-virtualenv) for environment management.

  1. Clone the repository:
git clone https://github.com/asusevski/opendota-mcp-server.git
cd opendota-mcp-server
  1. (Optional) Automated setup script:
# works in bash/zsh
./scripts/setup_env.sh
  1. Manual environment setup (example using virtualenv/uv):
# install dependencies according to pyproject.toml
uv add pyproject.toml

# for development extras
uv pip install -e ".[dev]"
  1. (Recommended) Create and export an OpenDota API key:
# sign up for a key at https://www.opendota.com/api-keys
export OPENDOTA_API_KEY="your_api_key_here"
  1. Run the server:
python -m src.opendota_server.server
# or
python src/opendota_server/server.py

Installing via Smithery (one-line):

npx -y @smithery/cli install @asusevski/opendota-mcp-server --client claude

Example Claude Desktop configuration using WSL:

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

Run the example client:

python -m src.client

Available Tools

The server exposes a set of MCP tools that map to OpenDota functionality. Common tools include:

Tool namePurpose
get_player_by_idReturn profile and summary for a given account ID
get_player_recent_matchesList recent matches for a player
get_match_dataFetch detailed data for a match (events, players, heroes)
get_player_win_lossPlayer win/loss total and breakdown
get_player_heroesMost-played heroes for a player
get_hero_statsAggregate statistics and rankings for heroes
search_playerSearch players by display name
get_pro_playersRetrieve professional player listing
get_pro_matchesList recent professional matches
get_player_peersPlayers that commonly play with a given account
get_heroesStatic list of Dota 2 heroes
get_player_totalsTotals (kills, assists, etc.) for a player
get_player_rankingsHero rankings for a player
get_player_wordcloudMost common words used by a player in chat
get_team_infoTeam metadata and members
get_public_matchesRecent public matchmaking games
get_match_heroesHeroes played in a specific match

Each tool returns JSON compatible with MCP messaging so an LLM can parse and act on results.

Use Cases

  • LLM game helper: Attach the MCP server to a chat assistant so users can ask “How did player 12345678 perform in their last 5 matches?” and the assistant calls get_player_recent_matches and summarizes results.
  • Scout and analytics pipelines: Periodically pull pro match lists and player hero stats to feed a scouting dashboard or automated scouting reports.
  • Live match enrichment: When a match ID appears in chat or logs, fetch get_match_data to present full lineup, hero items, and event timeline to viewers or analysts.
  • Automated alerts: Trigger notifications for high-impact pro matches or notable player performances (e.g., rare win streaks) using get_pro_matches and get_player_totals.
  • Research and model conditioning: Use hero statistics and player rankings to condition LLM prompts for tactical suggestions or commentary generation.

Security & License

  • The server relies on your OpenDota API key; keep it secret and store it in environment variables or a secrets manager.
  • License: MIT. The code and integrations are open-source; review dependencies and assess risk before deploying publicly.

Tips for Developers

  • Start with the example client to see request/response patterns.
  • If integrating with a desktop MCP client (Claude Desktop, etc.), validate command/args paths for virtual environments and WSL.
  • Combine multiple tool calls in a single MCP session to build higher-level features (e.g., get_player_by_id -> get_player_heroes -> get_player_rankings) while keeping responses small and focused.
Tags:ai-ml