Helldivers2 Mcp

io.github.xerno42由 GitHub 帳號 xerno42 發布v1.0.2更新於 Oct 24, 2026

MCP server exposing live Helldivers 2 galactic war data.

已驗證Streamable HTTP可網頁執行

概覽

AI 產生的概覽

唯讀的 MCP 伺服器,讓助理取得《絕地戰兵 2》銀河戰爭的即時資料:戰況統計、主要指令、星球、快訊、Steam 新聞與民主太空站。

可以做什麼
  • 讀取全局戰況統計與活躍星球,包含各陣營擊殺數、任務勝負、命中率與影響倍率
  • 讀取目前主要指令,含簡報、解析後的任務清單、進度、獎勵與剩餘時間
  • 列出所有星球,並一次取得最多五顆星球的詳細資料:生態、危險、歸屬、生命值、事件與區域
  • 讀取遊戲內快訊與 Steam 新聞,可限制回傳筆數
  • 讀取民主太空站詳情:所在星球、下次投票剩餘時間與目前戰術行動
適用情境
適合讓助理回答《絕地戰兵 2》銀河戰爭目前局勢、整理主要指令或新聞、比較星球並規劃作戰地點,不必開啟遊戲。
執行需求
可使用託管端點,或在本機執行:npm 套件與容器映像需要 Node.js 22+ 或 Docker。自行架設需設定環境變數 X_SUPER_CONTACT 填入聯絡信箱,該值會轉送給上游社群 API。另有連接埠、綁定位址、允許的瀏覽器來源與流量限制等選用設定。
安裝前請注意
自行架設時必須提供真實聯絡信箱(X_SUPER_CONTACT),該值會轉送給第三方社群 API api.helldivers2.dev。所有工具僅讀取資料,不會寫入或修改任何內容。託管執行個體為第三方公開服務,請求與查詢會傳送到該服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Helldivers2 Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.xerno42%2Fhelldivers2-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "helldivers2": {
      "type": "http",
      "url": "https://mcp.avengersofsuperearth.com/mcp"
    }
  }
}

README

helldivers2-mcp

[npm version] [CI] [Docker Hub] [License: MIT]

A stateless Model Context Protocol (MCP) server that exposes live Helldivers 2 galactic war data to LLMs.

Data is sourced from the community API at api.helldivers2.dev.

Packages


Tools

ToolDescription
get_war_statusGalaxy-wide war statistics (kills by faction, missions won/lost, accuracy, deaths, impact multiplier) and active planets with owner, player count, active events, attack vectors, and region health
get_assignmentsActive Major Orders with title, briefing, decoded task list (faction, difficulty, target planet), current progress numbers, reward type and amount, and time until expiry
get_all_planetsFull planet list with IDs, names, and sectors
get_planet_detailsDetailed per-planet info: biome, hazards, initial/current owner, health, waypoints, active events, full combat statistics, attacking planets, and regions (up to 5 planets per call)
get_dispatchesIn-game dispatch feed — High Command broadcasts with published date (relative time) and message text; optional limit parameter (default 20, max 50)
get_steam_newsSteam news for Helldivers 2 with title, URL, publish date (relative time), and full article content; optional limit parameter (default 10, max 30)
get_space_station_detailsDSS details: current host planet (full planet info), time until next election, and active tactical actions with name, description, status, planet effects, and resource costs

Quickstart

Prerequisites

  • Node.js 22+ or Docker
  • A contact email for the X-Super-Contact header (required by the upstream API)

Local dev

bash
cp .env.example .env   # set [email protected]npm installnpm run dev               # hot-reload via tsx watch on :3000

Production build

bash
npm run build   # tsc → dist/npm run start

Docker

Image is available on Docker Hub and GitHub Container Registry.

bash
docker pull xerno42/helldivers2-mcp        # pull from Docker Hub# ordocker pull ghcr.io/xerno42/helldivers2-mcp # pull from GHCR# ordocker build -t helldivers2-mcp . # build locally
#then run with:docker run -p 3000:3000 -e [email protected] helldivers2-mcp

Configuration

All configuration is via environment variables.

VariableDefaultDescription
X_SUPER_CONTACT(required)Forwarded as X-Super-Contact to the upstream API per their usage guidelines
PORT3000HTTP port to listen on
BIND_HOST127.0.0.1Interface to bind (0.0.0.0 for Docker/containers)
MCP_ALLOWED_ORIGINS(unset)Comma-separated list of allowed browser Origin headers. Unset means browser-originated requests are blocked; server-to-server calls (no Origin header) are always allowed
MCP_RATE_LIMIT_PER_MIN60Sustained request rate limit (requests per minute)
MCP_RATE_LIMIT_BURST= MCP_RATE_LIMIT_PER_MINBurst capacity for the token-bucket rate limiter

Endpoints

MethodPathDescription
POST/mcpMCP Streamable HTTP transport endpoint
GET/healthLiveness check — returns { "ok": true }

The server uses the stateless Streamable HTTP transport. Each POST /mcp request creates a fresh McpServer + transport pair, handles the request, then tears them down. There is no session state.


Usage in Code

Call the MCP server directly over HTTP using the Streamable HTTP transport. Each request is a JSON-RPC tools/call message sent to POST /mcp.

JavaScript / TypeScript

Using the official MCP TypeScript SDK:

typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "my-app", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(  new URL("https://mcp.avengersofsuperearth.com/mcp"));
await client.connect(transport);
// List available toolsconst { tools } = await client.listTools();console.log(tools.map((t) => t.name));
// Get current war statusconst warStatus = await client.callTool({  name: "get_war_status",  arguments: {},});console.log(warStatus.content[0].text);
// Get details for specific planets by index (up to 5)const planets = await client.callTool({  name: "get_planet_details",  arguments: { planetindices: [57, 153] },});console.log(planets.content[0].text);
await client.close();

Without the SDK — raw JSON-RPC over fetch:

typescript
async function callTool(name: string, args: Record<string, unknown> = {}) {  const res = await fetch("https://mcp.avengersofsuperearth.com/mcp", {    method: "POST",    headers: {      "Content-Type": "application/json",      "Accept": "application/json, text/event-stream",    },    body: JSON.stringify({      jsonrpc: "2.0",      id: 1,      method: "tools/call",      params: { name, arguments: args },    }),  });  const text = await res.text();  // The response is an SSE frame ("event: message\ndata: {json}\n\n");  // concatenate its data line(s) to recover the JSON-RPC payload.  const json = text    .split("\n")    .filter((line) => line.startsWith("data:"))    .map((line) => line.slice(5).trim())    .join("");  const data = JSON.parse(json);  return data.result.content[0].text;}
const status = await callTool("get_war_status");const assignments = await callTool("get_assignments");const dispatches = await callTool("get_dispatches", { limit: 5 });const planets = await callTool("get_planet_details", { planetindices: [57, 153] });

Python

Using the official MCP Python SDK:

python
import asynciofrom mcp import ClientSessionfrom mcp.client.streamable_http import streamablehttp_client
async def main():    async with streamablehttp_client("https://mcp.avengersofsuperearth.com/mcp") as (read, write, _):        async with ClientSession(read, write) as session:            await session.initialize()
            # List available tools            tools = await session.list_tools()            print([t.name for t in tools.tools])
            # Get current war status            result = await session.call_tool("get_war_status", {})            print(result.content[0].text)
            # Get details for specific planets by index (up to 5)            result = await session.call_tool(                "get_planet_details",                {"planetindices": [57, 153]},            )            print(result.content[0].text)
asyncio.run(main())

Without the SDK — raw JSON-RPC over httpx:

python
import httpx
MCP_URL = "https://mcp.avengersofsuperearth.com/mcp"
def call_tool(name: str, arguments: dict = {}) -> str:    payload = {        "jsonrpc": "2.0",        "id": 1,        "method": "tools/call",        "params": {"name": name, "arguments": arguments},    }    headers = {        "Content-Type": "application/json",        "Accept": "application/json, text/event-stream",    }    response = httpx.post(MCP_URL, json=payload, headers=headers)    response.raise_for_status()    import json    # The response is an SSE frame ("event: message\ndata: {json}\n\n");    # concatenate its data line(s) to recover the JSON-RPC payload.    text = "".join(        line[5:].strip()        for line in response.text.splitlines()        if line.startswith("data:")    )    return json.loads(text)["result"]["content"][0]["text"]
status = call_tool("get_war_status")assignments = call_tool("get_assignments")planets = call_tool("get_planet_details", {"planetindices": [57, 153]})

Connecting to Claude Desktop

Hosted server (easiest)

A public instance is available at https://mcp.avengersofsuperearth.com/mcp. No setup required — just add it to your claude_desktop_config.json:

json
{  "mcpServers": {    "helldivers2": {      "url": "https://mcp.avengersofsuperearth.com/mcp"    }  }}

Self-hosted (local binary)

json
{  "mcpServers": {    "helldivers2": {      "command": "node",      "args": ["/path/to/helldivers2-mcp/dist/index.js"],      "env": {        "X_SUPER_CONTACT": "[email protected]"      }    }  }}

Self-hosted (HTTP server)

json
{  "mcpServers": {    "helldivers2": {      "url": "http://localhost:3000/mcp"    }  }}

Development

bash
npm run test              # Jest (ESM mode)npm run test:watchnpm run test:coveragenpm run lint              # ESLint

Run a single test file:

bash
npm run test src/__tests__/tools.war.test.ts

Adding a tool

  1. Create src/tools/your-tool.ts and export a Tool object with .definition and .handler.
  2. Import it and add it to the TOOLS array in src/index.ts.
  3. Return textResponse(...) on success or errorResponse(...) on failure — never throw from a handler.
  4. All upstream calls must go through hd2Fetch (in-memory 2-minute cache + rate-limit-aware queue).

License

MIT

來源:README.md,提交 e7c9201

工具

7

get_war_status

Get War Status

Fetch the current war status and active planets. Returns aggregated war statistics (impact multiplier, total missions won, total missions lost, total mission time, total terminid kills, total automaton kills, total illuminate kills, total bullets fired, total bullets hit, total deaths, total revives, total friendly fire casualties, overall mission success rate, overall accuracy), and a list of active planets (planets with active players or ownership change) with their name, sector, initial owner, current owner, player count, active event information if any (Event: faction, current health, max health, start and end time), the planets each active planet is currently attacking (id and name), and active regions (Region: name, health, max health, regen per second, size, active players).

無需輸入參數。

get_assignments

Get Assignments

Fetch the currently active assignments (Major Orders) issued by Super Earth high command. Returns each assignment with title, briefing, task description, decoded task list (type and value information including races, difficulties, and target planet names), current progress numbers, reward (type and amount), and expiration (seconds until expiry).

無需輸入參數。

get_all_planets

Get All Planets

Fetch a list of all planets in the current galactic war. Returns a list of planets with their id (index), name, and sector.

無需輸入參數。

get_planet_details

Get Planet Details

Fetch detailed information about one or more planets by providing their planet index/indices. Requires: planetindices parameter (array of integers of planet indices, maximum of 5) Returns: For each planet - index, name, sector, biome (Biome: name, description), hazards (Hazard: name, description), position, list of waypoints (planet indices) the planet is connected to, max health, current health, initial owner, current owner, regen per second, event information if one is active (faction who initiated the event, current health, max health, start and end time), statistics (Statistics: missions won, missions lost, mission time, terminid kills, automaton kills, illuminate kills, bullets fired, bullets hit, time played, deaths, revives, friendly fire casualties, mission success rate, accuracy, player count), attacking (a list of planet indices this planet is currently attacking), regions (Region: name, description, health, max health, size, regen per second, active players).

輸入參數planetindices必填

get_dispatches

Get Dispatches

Fetch the latest dispatches (news feed) from Super Earth high command. Returns recent dispatches with their published date (relative time) and message text. Optional `limit` parameter caps how many items to return (default 20, max 50).

輸入參數limit

get_steam_news

Get Steam News

Fetch the latest Steam news for Helldivers 2. Returns recent items with title, URL, published date (relative time), and content. Optional `limit` parameter caps how many items to return (default 10, max 30).

輸入參數limit

get_space_station_details

Get Space Station Details

Fetch the current Democracy Space Station (DSS) details. Returns the planet the DSS is currently supporting (full planet details), election end (relative time until the next planet vote ends), and a list of active tactical actions (Tactical action: name, description, strategic description, status, status expire, effects (Effect: name, description), costs (Cost: item name, current value, delta per second, max donation amount)).

無需輸入參數。

版本歷史

2
  1. v1.0.2最新Sep 26, 2026
  2. v1.0.1Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分