Skip to main content
Glama
goldsrc-query-mcp

goldsrc-query-mcp

goldsrc-query-mcp

npm version license CI E2E

一个 MCP 服务器,允许 AI 助手使用 goldsrc-query 库查询 GoldSrc 游戏服务器(Half-Life、Counter-Strike 1.6 等)。


工具

工具

描述

ping

往返延迟(毫秒)

get_server_info

服务器名称、地图、玩家数量、VAC 状态等

get_players

当前玩家列表,包含名称、得分和游戏内时间

get_rules

所有服务器 cvar

get_all

一次调用获取服务器信息、玩家列表和规则

send_rcon

发送单个 RCON 命令并返回响应

send_rcon_batch

通过单个已认证连接发送多个 RCON 命令


Related MCP server: Steam MCP Server

安装

npx goldsrc-query-mcp

或者全局安装:

npm install -g goldsrc-query-mcp

要求: Node.js >=20.12.0


使用

传输方式

服务器支持三种传输方式,通过 MCP_TRANSPORT 环境变量(或用于 HTTP 的 --http 标志)选择。

stdio(默认)

node dist/index.js
# or
npx goldsrc-query-mcp

HTTP

MCP_TRANSPORT=http MCP_PORT=3000 node dist/index.js
# shorthand flag
node dist/index.js --http

HTTPS

MCP_TRANSPORT=https MCP_PORT=443 MCP_TLS_CERT=cert.pem MCP_TLS_KEY=key.pem node dist/index.js

MCP_TLS_CERT 和 MCP_TLS_KEY 必须同时设置;如果任一缺失,服务器将退出并报错。

Claude Desktop

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):

{
  "mcpServers": {
    "goldsrc": {
      "command": "npx",
      "args": ["goldsrc-query-mcp"]
    }
  }
}

示例提示

  • "192.168.1.10:27015 正在运行什么地图?"

  • "cs.example.com 服务器上有多少玩家?"

  • "显示我服务器上的所有 cvar。"

  • "在我的服务器 192.168.1.10 上运行 sv_gravity 800,密码为 secret。"

  • "踢出所有机器人并将地图更改为 de_dust2。"


工具参考

所有工具都接受 address(必填)、port(默认 27015)和 timeout(默认 3000 毫秒)。

ping

返回以毫秒为单位的往返延迟。

get_server_info

以 JSON 形式返回服务器元数据 - 名称、地图、玩家数量、VAC 状态、服务器类型、环境以及可选的 EDF 字段。

get_players

以 JSON 形式返回玩家列表 - 每个玩家的索引、名称、得分和时长(游戏内秒数)。

get_rules

以 JSON 形式返回所有服务器 cvar - 总数和 { name, value } 对列表。

get_all

在一次调用中返回服务器信息、玩家列表和规则。请使用此工具,而不是分别调用 get_server_info、get_players 和 get_rules。

send_rcon

address:  "192.168.1.10"
password: "your_rcon_password"
command:  "status"

发送单个 RCON 命令并返回服务器响应。

send_rcon_batch

address:  "192.168.1.10"
password: "your_rcon_password"
commands: ["sv_gravity 800", "mp_friendlyfire 1", "changelevel de_dust2"]

通过单个已认证连接发送多个 RCON 命令。返回 { command, response } 对数组。当运行多个命令时,请使用此工具而不是 send_rcon。

Available Tools

7 tools
get_allGet AllA
Read-only

Get server info, player list, and rules in one call. Use this instead of calling get_server_info, get_players, and get_rules separately.

Inputs: address (required), port, timeout.

get_playersGet PlayersA
Read-only

Get the current player list with names, scores, and time in-game. Use to see who is on a server.

Inputs: address (required), port, timeout.

get_rulesGet RulesA
Read-only

Get all server cvars. Use to inspect server configuration.

Inputs: address (required), port, timeout.

get_server_infoGet Server InfoA
Read-only

Get server metadata: name, map, player counts, VAC status, and more. Use to get an overview of a server or check if it is online.

Inputs: address (required), port, timeout.

pingPingA
Read-only

Measure round-trip latency to a GoldSrc server. Use to check if a server is reachable and responsive.

Inputs: address (required), port, timeout.

send_rconSend RCONA
Destructive

Send a single RCON command and return the response. Use for one-off commands; prefer send_rcon_batch when sending multiple commands.

Inputs: address (required), command (required), password (required), port, +1 more.

send_rcon_batchSend RCON BatchA
Destructive

Send multiple RCON commands over a single authenticated connection. Use instead of rcon when running more than one command.

Inputs: address (required), commands (required), password (required), port, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: ping for latency, get_server_info for metadata, get_players for player list, get_rules for cvars, get_all for a combined query, and send_rcon/send_rcon_batch for command execution. The descriptions explicitly clarify when to use each, especially distinguishing the single vs. batch RCON tools and the combined vs. individual getters.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase and underscores: ping, get_*, send_*. This makes the toolset predictable and easy to navigate.

    Tool Count5/5

    With 7 tools, the server is well-scoped. Each tool serves a necessary function for querying and managing a GoldSrc server, with no redundancy or excessive bloat.

    Completeness5/5

    The toolset covers the full lifecycle of interacting with a GoldSrc server: checking reachability (ping), retrieving server info, players, and rules, fetching everything in one call, and sending RCON commands in both single and batch modes. There are no obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables control and inspection of a Factorio 2.0 server via RCON, with tools for administration, player management, game state queries, and Lua execution.
      19
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to programmatically control a local TF2/SourceMod game server: query live state, run commands, compile and hot-load plugins, stream telemetry, debug runtime errors, and write ephemeral scripts through the full SourceMod native API.
      1
      MIT