opendota-mcp-server
Enables querying Dota 2 player statistics, match data, and hero information through the OpenDota API using natural language.
README
OpenDota MCP Server
A Model Context Protocol (MCP) server that provides seamless access to the OpenDota API for querying Dota 2 player statistics, match data, and hero information through AI assistants like Claude.
Features
- 20+ Tools across 5 categories for comprehensive Dota 2 data access
- Natural Language Support - Fuzzy matching for hero names, lane positions, and stat fields
- Dual Transport - Supports both stdio (local) and HTTP (remote) modes
- Rate Limiting - Built-in protection respecting OpenDota API limits
- Reference Data Caching - Fast lookups with local hero/item data
Available Tools
Player Tools (6 tools)
Query player statistics, win/loss records, hero preferences, and performance metrics:
get_player_info- Get player profile, win rate, and favorite heroesget_player_win_loss- Win/loss stats with advanced filteringget_heroes_played- Detailed statistics for all heroes playedget_player_peers- Find frequent teammatesget_player_totals- Aggregated player statisticsget_player_histograms- Distribution of matches across statistical fields
Hero Tools (4 tools)
Access hero information, matchups, and item builds:
get_heroes- List all heroes with attributesget_hero_matchups- Matchup data and win ratesget_hero_item_popularity- Popular item builds by game phaseget_hero_stats- Aggregated hero statistics and pick rates
Match Tools (3 tools)
Retrieve detailed match information and parsed data:
get_match_details- Comprehensive match informationget_parsed_match_details- Parsed match data with advanced analyticsget_player_recent_matches- Recent matches for a player
Lookup Tools (4 tools)
Convert names to IDs with fuzzy matching:
get_hero_id_by_name- Hero name → ID (handles typos)get_hero_by_id- Get hero details by IDconvert_lane_name_to_id- Lane/position → lane_role IDresolve_time_name- Time period names → OpenDota filter parameters
Misc Tools (3 tools)
Search and utility functions:
search_players- Search for players by nameget_constants- Get OpenDota constants and reference dataget_player_counts- Get player count by rank tier
Installation
Prerequisites
- Python 3.10 or higher
- pip package manager
Install from Source
# Clone the repository
git clone https://github.com/hkaanengin/opendota-mcp-server.git
cd opendota-mcp-server
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install with dev dependencies
pip install -e ".[dev]"
# Or install runtime only
pip install -e .
Usage
Option 1: Local Server (stdio mode)
Best for Claude Desktop integration on your local machine.
Using Claude Desktop
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Recommended: Using the installed command
After running pip install -e ., add to your claude_desktop_config.json:
{
"mcpServers": {
"opendota": {
"command": "/path/to/your/opendota-mcp-server/.venv/bin/opendota-mcp"
}
}
}
Note: Replace
/path/to/your/opendota-mcp-serverwith the actual path where you cloned this repository. On macOS/Linux, runpwdin the project directory to find this path. On Windows, runcdto see the full path.
Alternative: Using Python module directly
{
"mcpServers": {
"opendota": {
"command": "/path/to/your/opendota-mcp-server/.venv/bin/python",
"args": ["-m", "opendota_mcp.server"]
}
}
}
Alternative: Using the shell script
{
"mcpServers": {
"opendota": {
"command": "/path/to/your/opendota-mcp-server/start_mcp.sh"
}
}
}
Using Docker:
{
"mcpServers": {
"opendota": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "MCP_TRANSPORT=stdio",
"hkaanengin/opendota-mcp-server:latest"
]
}
}
}
After updating the config:
- Save the file
- Restart Claude Desktop completely
- Start a new conversation
- Your OpenDota tools should now be available!
Manual Testing
# Run the server directly
opendota-mcp
# Or using Python module
python -m opendota_mcp.server
# Or using the shell script
./start_mcp.sh
Option 2: Remote Server (HTTP mode)
Access a deployed server from anywhere.
Public Server
Use the publicly deployed server at:
https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp
Claude Desktop (Remote Connection)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"opendota": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-remote-http",
"https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp"
]
}
}
}
Claude.ai Web Interface
- Go to Claude.ai → Settings → MCP Servers
- Click "Add Server"
- Enter Server URL:
https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp - Save and start chatting!
Option 3: Deploy Your Own
Deploy to Google Cloud Run or any container platform:
# Build Docker image
docker build -t opendota-mcp-server .
# Run in HTTP mode
docker run -p 8080:8080 \
-e MCP_TRANSPORT=http \
-e PORT=8080 \
opendota-mcp-server
Configuration
Environment Variables
Create a .env file in the project root (or copy from .env.example):
# OpenDota API Key (optional)
# Get your API key from: https://www.opendota.com/api-keys
OPENDOTA_API_KEY=
# Logging level (DEBUG, INFO, WARNING, ERROR)
LOG_LEVEL=INFO
# Transport mode (stdio or http)
MCP_TRANSPORT=stdio
# HTTP server port (for HTTP mode)
PORT=8080
OpenDota API Key (Optional)
An API key is optional but recommended for higher rate limits and better performance.
Rate Limits:
- Without API key: 60 requests/minute (anonymous)
- With API key: Higher limits for registered users
How to get an API key:
- Visit https://www.opendota.com/api-keys
- Sign in with your Steam account
- Click "Create API Key"
- Copy the generated API key
- Add it to your
.envfile:OPENDOTA_API_KEY=your-api-key-here - Restart the server
The server will automatically detect and use the API key when configured. You'll see a confirmation message in the logs:
✅ OpenDota API key configured (higher rate limits enabled)
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Acknowledgments
- OpenDota for providing the excellent Dota 2 API
- FastMCP for the MCP framework
- The Model Context Protocol team at Anthropic
- The Dota 2 community
Support
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing issues for solutions
- Review the OpenDota API documentation
Made with ❤️ for the Dota 2 community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。