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. - 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 (loca
Add this skill
npx mdskills install hkaanengin/opendota-mcp-serverComprehensive MCP server with 20+ well-documented tools for Dota 2 data access
1# OpenDota MCP Server23A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that provides seamless access to the [OpenDota API](https://docs.opendota.com) for querying Dota 2 player statistics, match data, and hero information through AI assistants like Claude.45## Features67- **20+ Tools** across 5 categories for comprehensive Dota 2 data access8- **Natural Language Support** - Fuzzy matching for hero names, lane positions, and stat fields9- **Dual Transport** - Supports both stdio (local) and HTTP (remote) modes10- **Rate Limiting** - Built-in protection respecting OpenDota API limits11- **Reference Data Caching** - Fast lookups with local hero/item data1213## Available Tools1415### Player Tools (6 tools)16Query player statistics, win/loss records, hero preferences, and performance metrics:17- `get_player_info` - Get player profile, win rate, and favorite heroes18- `get_player_win_loss` - Win/loss stats with advanced filtering19- `get_heroes_played` - Detailed statistics for all heroes played20- `get_player_peers` - Find frequent teammates21- `get_player_totals` - Aggregated player statistics22- `get_player_histograms` - Distribution of matches across statistical fields2324### Hero Tools (4 tools)25Access hero information, matchups, and item builds:26- `get_heroes` - List all heroes with attributes27- `get_hero_matchups` - Matchup data and win rates28- `get_hero_item_popularity` - Popular item builds by game phase29- `get_hero_stats` - Aggregated hero statistics and pick rates3031### Match Tools (3 tools)32Retrieve detailed match information and parsed data:33- `get_match_details` - Comprehensive match information34- `get_parsed_match_details` - Parsed match data with advanced analytics35- `get_player_recent_matches` - Recent matches for a player3637### Lookup Tools (4 tools)38Convert names to IDs with fuzzy matching:39- `get_hero_id_by_name` - Hero name → ID (handles typos)40- `get_hero_by_id` - Get hero details by ID41- `convert_lane_name_to_id` - Lane/position → lane_role ID42- `resolve_time_name` - Time period names → OpenDota filter parameters4344### Misc Tools (3 tools)45Search and utility functions:46- `search_players` - Search for players by name47- `get_constants` - Get OpenDota constants and reference data48- `get_player_counts` - Get player count by rank tier4950## Installation5152### Prerequisites53- Python 3.10 or higher54- pip package manager5556### Install from Source5758```bash59# Clone the repository60git clone https://github.com/hkaanengin/opendota-mcp-server.git61cd opendota-mcp-server6263# Create virtual environment64python3 -m venv .venv65source .venv/bin/activate # On Windows: .venv\Scripts\activate6667# Install with dev dependencies68pip install -e ".[dev]"6970# Or install runtime only71pip install -e .72```7374## Usage7576### Option 1: Local Server (stdio mode)7778Best for Claude Desktop integration on your local machine.7980#### Using Claude Desktop8182**Config file location:**83- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`84- Windows: `%APPDATA%\Claude\claude_desktop_config.json`85- Linux: `~/.config/Claude/claude_desktop_config.json`8687**Recommended: Using the installed command**8889After running `pip install -e .`, add to your `claude_desktop_config.json`:9091```json92{93 "mcpServers": {94 "opendota": {95 "command": "/path/to/your/opendota-mcp-server/.venv/bin/opendota-mcp"96 }97 }98}99```100101> **Note:** Replace `/path/to/your/opendota-mcp-server` with the actual path where you cloned this repository. On macOS/Linux, run `pwd` in the project directory to find this path. On Windows, run `cd` to see the full path.102103**Alternative: Using Python module directly**104105```json106{107 "mcpServers": {108 "opendota": {109 "command": "/path/to/your/opendota-mcp-server/.venv/bin/python",110 "args": ["-m", "opendota_mcp.server"]111 }112 }113}114```115116**Alternative: Using the shell script**117118```json119{120 "mcpServers": {121 "opendota": {122 "command": "/path/to/your/opendota-mcp-server/start_mcp.sh"123 }124 }125}126```127128**Using Docker:**129130```json131{132 "mcpServers": {133 "opendota": {134 "command": "docker",135 "args": [136 "run",137 "-i",138 "--rm",139 "-e", "MCP_TRANSPORT=stdio",140 "hkaanengin/opendota-mcp-server:latest"141 ]142 }143 }144}145```146147After updating the config:1481. Save the file1492. Restart Claude Desktop completely1503. Start a new conversation1514. Your OpenDota tools should now be available!152153#### Manual Testing154155```bash156# Run the server directly157opendota-mcp158159# Or using Python module160python -m opendota_mcp.server161162# Or using the shell script163./start_mcp.sh164```165166### Option 2: Remote Server (HTTP mode)167168Access a deployed server from anywhere.169170#### Public Server171172Use the publicly deployed server at:173```174https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp175```176177#### Claude Desktop (Remote Connection)178179Add to your `claude_desktop_config.json`:180181```json182{183 "mcpServers": {184 "opendota": {185 "command": "npx",186 "args": [187 "-y",188 "@modelcontextprotocol/server-remote-http",189 "https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp"190 ]191 }192 }193}194```195196#### Claude.ai Web Interface1971981. Go to Claude.ai → Settings → MCP Servers1992. Click "Add Server"2003. Enter Server URL: `https://opendota-mcp-server-jylza6gata-ew.a.run.app/mcp`2014. Save and start chatting!202203### Option 3: Deploy Your Own204205Deploy to Google Cloud Run or any container platform:206207```bash208# Build Docker image209docker build -t opendota-mcp-server .210211# Run in HTTP mode212docker run -p 8080:8080 \213 -e MCP_TRANSPORT=http \214 -e PORT=8080 \215 opendota-mcp-server216```217218## Configuration219220### Environment Variables221222Create a `.env` file in the project root (or copy from `.env.example`):223224```env225# OpenDota API Key (optional)226# Get your API key from: https://www.opendota.com/api-keys227OPENDOTA_API_KEY=228229# Logging level (DEBUG, INFO, WARNING, ERROR)230LOG_LEVEL=INFO231232# Transport mode (stdio or http)233MCP_TRANSPORT=stdio234235# HTTP server port (for HTTP mode)236PORT=8080237```238239### OpenDota API Key (Optional)240241An API key is **optional** but recommended for higher rate limits and better performance.242243**Rate Limits:**244- **Without API key**: 60 requests/minute (anonymous)245- **With API key**: Higher limits for registered users246247**How to get an API key:**2482491. Visit [https://www.opendota.com/api-keys](https://www.opendota.com/api-keys)2502. Sign in with your Steam account2513. Click "Create API Key"2524. Copy the generated API key2535. Add it to your `.env` file:254 ```env255 OPENDOTA_API_KEY=your-api-key-here256 ```2576. Restart the server258259The server will automatically detect and use the API key when configured. You'll see a confirmation message in the logs:260```261✅ OpenDota API key configured (higher rate limits enabled)262```263264## Contributing265266Contributions are welcome! Please:2672681. Fork the repository2692. Create a feature branch (`git checkout -b feature/amazing-feature`)2703. Commit your changes (`git commit -m 'Add amazing feature'`)2714. Push to the branch (`git push origin feature/amazing-feature`)2725. Open a Pull Request273274## Acknowledgments275276- [OpenDota](https://www.opendota.com/) for providing the excellent Dota 2 API277- [FastMCP](https://github.com/jlowin/fastmcp) for the MCP framework278- The Model Context Protocol team at Anthropic279- The Dota 2 community280281## Support282283For issues, questions, or contributions:284- Open an issue on [GitHub](https://github.com/hkaanengin/opendota-mcp-server/issues)285- Check existing issues for solutions286- Review the [OpenDota API documentation](https://docs.opendota.com)287288---289290**Made with ❤️ for the Dota 2 community**291
Full transparency — inspect the skill content before installing.