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.
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]"
Before using the server, it's recommended to set up an API key:
export OPENDOTA_API_KEY=your_api_key_here
Start the server directly with Python:
python -m src.opendota_server.server
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"
]
}
}
}
You can test the server functionality with the included example client:
python -m src.client
The OpenDota MCP server provides access to the following data retrieval tools:
Player Information
get_player_by_id
- Retrieve player information by account IDget_player_recent_matches
- Get recent matches for a playerget_player_win_loss
- Get win/loss statistics for a playerget_player_heroes
- Get a player's most played heroesget_player_peers
- Get players who have played with a specified playerget_player_totals
- Get player's overall stats totalsget_player_rankings
- Get player hero rankingsget_player_wordcloud
- Get most common words used by player in chatsearch_player
- Search for players by nameMatch Data
get_match_data
- Get detailed data for a specific matchget_match_heroes
- Get heroes played in a specific matchget_public_matches
- Get recent public matchesGame Information
get_hero_stats
- Get statistics for heroesget_heroes
- Get list of all Dota 2 heroesProfessional Scene
get_pro_players
- Get list of professional playersget_pro_matches
- Get recent professional matchesget_team_info
- Get information about a teamTo 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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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