WG-Console-MCP-server

WG-Console-MCP-server

Enables AI assistants to access live Wargaming API data for World of Tanks Console, allowing queries about players, clans, vehicles, and tank comparisons.

Category
访问服务器

README

Wargaming MCP Server for World of Tanks Console

A Model Context Protocol (MCP) server that gives AI assistants (Claude Desktop, VS Code Copilot, or any MCP client) live access to the Wargaming API for World of Tanks Console (Xbox & PlayStation). Ask your assistant natural-language questions like "How good is player X on Xbox?" or "Compare the IS-7 and the Maus" and it answers with real data.

Built with TypeScript, the official MCP SDK, and Zod schema validation. Also includes a standalone Node.js CLI for quick API queries from the terminal.

Features

  • 30 MCP tools covering players, clans, vehicles, progress tracking, and the full Tankopedia encyclopedia
  • Session & progress tracking — the Wargaming API only exposes lifetime totals, so this server stores local stat snapshots and diffs them: get-player-progress answers "how did I do tonight?" with battles, win rate, average damage, and a per-tank breakdown over the interval. Snapshots also accumulate passively whenever you run get-player-report.
  • One-shot player reportsget-player-report takes just a nickname and combines account search, overall stats, derived metrics (damage ratio, survival rate, frags/battle), top tanks, best performers, and clan membership into a single answer
  • Side-by-side tank comparisoncompare-tanks "IS-7" "Maus" produces a full armor/firepower/mobility table
  • Side-by-side player comparisoncompare-players puts two players' stats, most-played tanks, and best performers next to each other
  • Whole-clan reportsget-clan-report fetches stats for every member in batched requests and aggregates them: battle-weighted win rate, activity buckets, top performers
  • Human-readable output everywhere — tank IDs and achievement IDs are resolved to real names via a cached Tankopedia lookup
  • Smart tank search — fuzzy name matching (IS-7, IS 7, and IS7 all work)
  • Client-side rate limiting & retries — requests are throttled to Wargaming's 10 req/s limit and automatically retried on transient errors
  • Response caching — encyclopedia data is TTL-cached (1 h), so name lookups are effectively free after the first call
  • Actionable error messages — common API errors (invalid key, IP restrictions, rate limits) come back with a hint on how to fix them
  • CI + smoke tests — GitHub Actions builds the project and verifies the MCP protocol layer on every push

Available Tools

Reports (4) — start here

Tool Description
get-player-report Complete player profile from a single nickname: stats, derived metrics, top tanks, best performers, clan
compare-tanks Side-by-side comparison table of two tanks (by name or ID): armor, gun, ammo, mobility, view range
compare-players Side-by-side comparison of two players: win rate, damage, survival, most-played and best tanks
get-clan-report Aggregate report for an entire clan (by tag, name, or ID): battle-weighted averages, activity, top performers

Progress Tracking (3)

The Wargaming API only returns lifetime totals — these tools store local snapshots (one small JSON file per player) and diff them to reconstruct recent performance.

Tool Description
snapshot-player Record a baseline snapshot of a player's current lifetime + per-tank stats
get-player-progress Performance since a snapshot: battles, win rate, avg damage, per-tank breakdown over the interval; auto-saves a new snapshot
list-player-snapshots List the stored snapshots for a player

Snapshots live in ~/.wargaming-mcp-server/snapshots (override with the WARGAMING_MCP_DATA_DIR env var) and are also recorded passively by get-player-report, so history accumulates from normal use.

Player & Account (8)

Tool Description
search-players Find players by nickname
get-player-stats Overall combat statistics (battles, win rate, damage, XP)
get-player-achievements Account-wide achievements with real medal names
get-player-vehicles Per-tank stats summary for a player
get-detailed-player-vehicle-stats Deep per-tank stats incl. survival rate, garage status, company battles
get-player-vehicle-achievements Vehicle-specific achievements, ribbons, and series
get-player-by-xuid Resolve a Microsoft XUID to an account
get-player-by-psnid Resolve a PlayStation Network ID to an account

Clans (4)

Tool Description
search-clans Find clans by name or tag
get-clan-info Clan details (members, description, created date)
get-player-clan-info A player's clan membership and role
get-clan-glossary Clan role definitions

Vehicles & Tanks (5)

Tool Description
get-vehicles Browse/filter vehicles by nation, type, tier, or name
search-tanks-by-name Fuzzy tank search by name (exact-match optional)
get-tank-details Tank specifications (HP, speed, weight, pricing)
get-vehicle-characteristics Full configuration profile: armor, gun, ammo, engine, turret, radio, suspension — accepts a tank name or ID, with optional custom module IDs
get-tank-modules Guns, engines, radios, suspensions, turrets by nation/tier

Encyclopedia (6)

Tool Description
get-tankopedia-info Game version, nations, vehicle types, achievement sections
get-maps Battle maps with descriptions
get-encyclopedia-achievements All achievements, medals, and ribbons
get-encyclopedia-modules Detailed module database
get-crew-roles Crew roles and their skills
get-vehicle-upgrades Equipment and consumables for a specific tank (by name or ID)

Quick Start

Prerequisites

  • Node.js 18+
  • A free Wargaming API key from the Wargaming Developer Portal

    ⚠️ Choose a Mobile application type unless you have a static IP — Server keys are locked to an IP allowlist and will return INVALID_IP_ADDRESS from other addresses.

Option A: Run via npx (no install)

Once published to npm, no clone or build is needed — point your MCP client at npx:

{
    "mcpServers": {
        "wargaming": {
            "command": "npx",
            "args": ["-y", "wargaming-mcp-server"],
            "env": {
                "WARGAMING_API_KEY": "your_api_key_here"
            }
        }
    }
}

Option B: Install from source

git clone https://github.com/lHyperionl/WG-Console-MCP-server.git
cd WG-Console-MCP-server
npm install

# add your API key
copy .env.example .env   # Windows (use `cp` on macOS/Linux)
# edit .env and set WARGAMING_API_KEY

npm run build

Run the tests

npm test           # full suite: protocol checks + live API calls
SKIP_LIVE=1 npm test   # offline: protocol checks only (no API key traffic)

The smoke test builds the project, spawns the MCP server over stdio, verifies all 30 tools are registered, and exercises live calls against the Wargaming API — including the full search → report, compare-tanks, compare-players, get-clan-report, and snapshot → progress flows.

Architecture

src/
├── index.ts              # Entry point: registers tools, starts stdio transport
├── api.ts                # API client: rate limiting, retries, TTL cache, error hints
├── types.ts              # Shared Wargaming API response types
├── format.ts             # Number/percentage formatting helpers
├── encyclopedia-cache.ts # Cached tank & achievement name resolution
├── player-lookup.ts      # Shared nickname -> account resolution
├── snapshots.ts          # Local stat snapshot store for progress tracking
└── tools/
    ├── players.ts        # 8 player/account tools
    ├── clans.ts          # 4 clan tools
    ├── vehicles.ts       # 5 vehicle tools
    ├── encyclopedia.ts   # 6 tankopedia tools
    ├── reports.ts        # get-player-report, compare-tanks, compare-players, get-clan-report
    └── progress.ts       # snapshot-player, get-player-progress, list-player-snapshots

Cross-cutting concerns live in one place: every tool goes through makeWargamingRequest, which enforces the 10 req/s limit with a sliding-window throttle, retries transient failures (HTTP 5xx/429 and REQUEST_LIMIT_EXCEEDED) with backoff, caches encyclopedia responses for an hour, and annotates well-known API errors with fix-it hints.

Claude Desktop Integration

Add to your Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json on Windows, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
    "mcpServers": {
        "wargaming": {
            "command": "node",
            "args": ["C:\\absolute\\path\\to\\wargaming-mcp-server\\build\\index.js"],
            "env": {
                "WARGAMING_API_KEY": "your_api_key_here"
            }
        }
    }
}

Restart Claude Desktop, then try:

  • "Give me a full report on player 'PlayerName' on Xbox"
  • "Compare the IS-7 and the T110E5"
  • "Compare me and my clanmate 'OtherPlayer'"
  • "Take a snapshot of my stats" — then, after a session: "How did I do tonight?"
  • "Give me a report on the clan with tag 'STEEL' — who are the top performers?"
  • "Show me all tier 10 German heavy tanks"
  • "Which of PlayerName's tanks has the best win rate?"

VS Code users: the repo ships a ready-made .vscode/mcp.json for the built-in MCP support.

CLI Tool

For quick queries without an MCP client:

node wot-cli.js search-players "ProGamer"
node wot-cli.js player-stats 1088722148
node wot-cli.js player-vehicles 1088722148
node wot-cli.js search-vehicles 10 germany heavyTank
node wot-cli.js vehicle-characteristics "IS-7"
node wot-cli.js tank-modules guns germany 10
node wot-cli.js search-clans "STEEL"
node wot-cli.js maps

Run node wot-cli.js with no arguments for the full command reference.

Continuous Integration

Every push runs the CI workflow: install → TypeScript build → smoke test. If a WARGAMING_API_KEY repository secret is configured, the live API checks run too; otherwise CI validates the MCP protocol layer offline.

Troubleshooting

Symptom Cause / Fix
INVALID_IP_ADDRESS Your key is a Server-type application restricted to specific IPs. Add your current IP in the developer portal, or create a Mobile-type key.
INVALID_APPLICATION_ID The API key in .env is wrong or was deactivated.
REQUEST_LIMIT_EXCEEDED Wargaming rate limit (10 req/s) — the server throttles and retries automatically; if it persists, reduce parallel clients.
Server exits immediately WARGAMING_API_KEY is not set — check your .env or MCP client env config.

Notes

  • Xbox and PlayStation share a single unified API endpoint (api-modernarmor.worldoftanks.com); the platform parameter is kept for forward compatibility and labeling.
  • This project is not affiliated with Wargaming. It is a community tool using the public Wargaming API.

License

ISC

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选