Skip to main content

Read-only MCP server over batru.gg's live, calibrated Dota 2 / Deadlock win-rate prediction and meta API.

Project description

batru-mcp

A minimal, read-only MCP server over batru.gg's live API, so your LLM can answer Dota 2 / Deadlock draft, counter and win-rate questions with real, calibrated model predictions instead of guessing from memory.

It is a thin wrapper around batru.gg's public endpoints — no model runs locally; every number comes from the same production model the website serves.

Why calibrated matters

batru.gg's model is trained on ~20M real matches and calibrated: a reported 60% win rate corresponds to an empirically observed ~60% win rate. We deliberately do not headline a raw "accuracy" number — accuracy alone is misleading for win prediction. What you get from these tools are probabilities you can trust at face value. The tool descriptions instruct the host LLM to report these numbers verbatim and never invent matchup data.

Tools

Tool What it does
lookup_hero(query, game="dota2") Normalise a name/alias/shortName to {id, displayName, shortName}. game ∈ {dota2, deadlock}.
predict_dota_winrate(my_heroes, enemy_heroes, my_side="radiant") Calibrated win-rate % for both teams (partial drafts OK; empty → 50/50).
recommend_dota_pick(my_heroes, enemy_heroes, my_side="radiant") Top-3 heroes to pick next, each with its calibrated win rate.
get_dota_counters(hero, limit=12) Real matchup table: who this hero beats / loses to, with win rate % and sample size.
predict_deadlock_draft(team0_heroes, team1_heroes) Calibrated win-rate % for a Deadlock 6v6 (6 heroes per team).

Hero names are accepted in any form (e.g. am, anti mage, Anti-Mage) and normalised internally — the backend silently drops names it doesn't recognise, so normalising first keeps predictions honest.

Install

Requires uv (or any way to run a Python 3.12+ package from PyPI):

uvx batru-mcp           # fetches from PyPI and starts the stdio MCP server

Configuration is via the BATRU_API_BASE environment variable (default https://batru.gg) — you normally don't need to set anything.

Claude Desktop config

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "batru": {
      "command": "uvx",
      "args": ["batru-mcp"]
    }
  }
}

Restart Claude Desktop; the batru tools appear in the tool picker. Claude Code: claude mcp add batru -- uvx batru-mcp.

Development

git clone https://github.com/batrugg/batru-mcp && cd batru-mcp
uv sync
uv run batru-mcp        # run the server from the checkout (blocks, waiting on stdin)

For a Claude Desktop pointing at the checkout, use "command": "uv", "args": ["run", "--directory", "/absolute/path/to/batru-mcp", "batru-mcp"].

Tests

uv run pytest            # offline: hero normalisation + draft assembly
uv run pytest -m live    # also hits the real batru.gg API

Prefer programmatic access from Python instead of MCP? pip install batru — the official batru SDK.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

batru_mcp-0.1.2.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

batru_mcp-0.1.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file batru_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: batru_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for batru_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cb85f0d9b5d4bc823595a46ce4b8b3e007fb29f118a7a27f2017ec9b0ae64f39
MD5 900a1ed134ad83f45739ce1639dd66e3
BLAKE2b-256 08f3223a3f13d336f0bbb0d1f80baef0655a8496d1e994e5ab025bd9efa28e30

See more details on using hashes here.

File details

Details for the file batru_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: batru_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for batru_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9625e3ba8dc87089a293be5ad64efd0e2ebc82844696faa01f6693321b787b3b
MD5 5afd098fb72ad01b538a8b9d4241880f
BLAKE2b-256 d61d0f4c122462c20c9916835e337288f44bf434a4975273ccae21561b8e2eb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page