mcp-replay-dota2: Skill for Claude Code

.claude/skills/add-mcp-tool/SKILL.md

add-mcp-tool is a skill for Claude Code from DeepBlueCoding/mcp-replay-dota2. It costs 154 tokens per session (1,621 once invoked), scanned A, original, MIT.

A step-by-step guide for adding a new MCP tool to a Dota 2 replay-analysis server. Dota 2 is a multiplayer game, and replay analysis extracts information from recorded matches.

In plain words
What is it for?
Use it when exposing a new match query or analysis operation in the mcp-replay-dota2 project.
Why use it?
It defines how the new tool's service code, response data, registration, instructions, documentation, and real-value tests should fit together.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is DeepBlueCoding/mcp-replay-dota2's own configuration. It tells Claude Code how to work on mcp-replay-dota2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-replay-dota2 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to DeepBlueCoding/mcp-replay-dota2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/DeepBlueCoding/mcp-replay-dota2/master/.claude/skills/add-mcp-tool/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/DeepBlueCoding/mcp-replay-dota2

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-mcp-tool

README.md
[![agentmods](https://agentmods.dev/badge/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool/github.svg)](https://agentmods.dev/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool)
Your own site
<a href="https://agentmods.dev/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool"><img src="https://agentmods.dev/badge/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-mcp-tool

Your own site · 80×15
<a href="https://agentmods.dev/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool"><img src="https://agentmods.dev/badge/skills/deepbluecoding/mcp-replay-dota2/add-mcp-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,621 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00154 $0.01621
Opus 5 $0.00077 $0.00811
Sonnet 5 $0.00031 $0.00324
Haiku 4.5 $0.00015 $0.00162

Measured 8d ago against content hash 2149fef1e03d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

add-mcp-tool scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/add-mcp-tool/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add an MCP tool to mcp-replay-dota2

Read CLAUDE.md (repo root) first — it holds the python-manta attribute-access rules, the enum rules, the lane-naming rules, and the mandatory tests+docs+changelog policy. This skill adds the tool-specific vertical slice on top of that.

Tool vs resource

  • Dynamic, parameter-required query (needs a match_id or other args) -> @mcp.tool.
  • Static reference data, no params (heroes, map, pro lists) -> @mcp.resource in the dota2:// namespace (see src/resources/, registered in dota_match_mcp_server.py).

This skill is for tools. For a brand-new analysis domain (new service), use the add-replay-collector-service skill first, then come back here to expose it.

Workflow (do in this order)

  1. Service method first. Put extraction logic in a service under src/services/<domain>/, not in the tool. The service must have ZERO MCP/fastmcp imports — it stays importable from CLI/web (the boundary is stated in src/services/__init__.py). Tools must contain no extraction logic; they only call services and shape the response.
  2. Response model. Add or extend a Pydantic model in src/models/ (NOT src/services/models/ — those are the service-layer models). Write a Field(description=...) on every field; those descriptions become the LLM-visible schema. FastMCP auto-serializes the model — never return a raw dict.
  3. Register the tool inside the correct register_<domain>_tools(mcp, services) in src/tools/<domain>_tools.py. Tools are NOT decorated at module top level — they live inside the register function so they capture services. Pull dependencies out of the dict, e.g. replay_service = services["replay_service"]. Decorate with @mcp.tool (bare, no parens — see replay_tools.py).
  4. Replay tools follow this exact pattern for progress + cached parse:
    @mcp.tool
    async def get_something(match_id: int, ctx: Context) -> SomethingResponse:
        async def progress_callback(current: int, total: int, message: str) -> None:
            await ctx.report_progress(current, total)
        data = await replay_service.get_parsed_data(match_id, progress=progress_callback)
        return some_service.do_thing(data)
    
    get_parsed_data returns a cached ParsedReplayData; never call python-manta Parser directly in a tool.
  5. Filtering uses the shared filter models in src/models/filters.py (DeathFilters, CombatFilters, EventFilters, FightFilters, HeroPerformanceFilters). Build with .from_params(killer=..., location=..., start_time=...) then .apply(items). Location filters accept the 37 named map regions — do not invent ad-hoc filtering.
  6. New tool module? Add register_<domain>_tools to the imports and the call list in src/tools/__init__.py::register_all_tools. The six existing modules are: replay_tools, combat_tools, fight_tools, match_tools, pro_scene_tools, analysis_tools (registered in that order; ~41 tools total).
  7. New service dependency? Instantiate the singleton in dota_match_mcp_server.py and add it to the services dict (~line 97). Available keys today: replay_service, combat_service, fight_service, jungle_service, lane_service, seek_service, farming_service, rotation_service, heroes_resource, pro_scene_resource, constants_fetcher, match_fetcher, pro_scene_fetcher.
  8. Tool-selection instructions — update BOTH surfaces so the LLM knows when to pick the tool:
    • the TOOL_INSTRUCTIONS markdown table in dota_match_mcp_server.py, and
    • the "AI Summary - Tool Selection Guide" admonition table at the top of docs/api/tools/index.md (and bump the per-category tool count in the Categories table).
  9. Docs page — add ## <tool_name> with a one-line purpose, a python call example, and a JSON Returns block, on the page matching the tool's category (see map below). Use the write-mkdocs-docs skill for the admonition/changelog conventions.
  10. Real-values test under tests/<area>/ using conftest fixtures only — never parse a replay in a test. See the run-ci-and-test-replays skill.
  11. CI gate — run all three before declaring done (also in CLAUDE.md):
    uv run ruff check src/ tests/ dota_match_mcp_server.py
    uv run mypy src/ dota_match_mcp_server.py --ignore-missing-imports
    uv run pytest
    

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 100 lines · 154 tokens per session scan A 2149fef1e03d

Subscribe to this mod's changes

add-mcp-tool is a skill published in the GitHub repository DeepBlueCoding/mcp-replay-dota2 (2 stars, last pushed 3mo ago), licensed MIT. It adds 154 tokens to every session and 1,621 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.