Skip to content

Harden txAdmin tools: warn on plain HTTP, add destructive hints, reuse login #67

Closed

Description

@TMHSDigital

Summary

Three small hardening items for the txAdmin tools: the client sends the panel password over plain HTTP to any configured host without warning, the destructive tools carry no MCP destructive hint, and every tool call creates a new client and logs in again.

Where

  • mcp-server/tools/txadmin_client.py:32 (DEFAULT_URL = "http://127.0.0.1:40120")
  • mcp-server/tools/txadmin_client.py:45 (TxAdminConfig.url, any scheme and host)
  • mcp-server/tools/txadmin_client.py:130-154 (login, POSTs username and password)
  • mcp-server/tools/txadmin.py:53, 81, 117, 166 (new TxAdminClient() per call)
  • mcp-server/server.py:139-200 (txAdmin tools registered with plain @mcp.tool())
  • skills/txadmin-integration/SKILL.md:28 (documents http:// URL)

Details

  • Plain HTTP to remote hosts. TXADMIN_URL accepts any scheme and host, and login() sends {"username", "password"} as JSON to /auth/password. The default and documented examples use http://, which is fine for loopback, but nothing warns when the host is remote. Developers commonly point the tool at a panel on a VPS.
  • No destructive hint. txadmin_server_control_tool (stop/restart the live server), txadmin_resource_control_tool and txadmin_kick_player_tool have no MCP tool annotations, so clients cannot apply stricter approval policies to them, and read-only tools are not marked as such.
  • Login per call. Each tool call builds a new TxAdminClient, so every call performs a full password login. This multiplies credential transmissions and may run into txAdmin login rate limiting under heavy agent use (rate-limit behaviour not verified).

Impact

Credentials can cross the network in cleartext without the user realising; destructive actions are indistinguishable from searches to the MCP client; repeated logins add latency and auth-log noise.

Suggested fix

  • In TxAdminConfig, parse the URL; when the scheme is http and the host is not 127.0.0.1, ::1 or localhost, refuse unless an explicit opt-in such as TXADMIN_ALLOW_INSECURE=1 is set, and document HTTPS or an SSH tunnel for remote panels.
  • Register stop/restart/resource/kick tools with destructiveHint=True, readOnlyHint=False annotations, and the player search tool with readOnlyHint=True. Optionally require confirm=True for stop.
  • Cache one logged-in TxAdminClient per process and re-login on a 401 or CSRF failure.

Acceptance criteria

  • A remote http:// TXADMIN_URL is refused (or warned) unless explicitly allowed.
  • MCP clients see destructive and read-only annotations on the txAdmin tools.
  • Consecutive tool calls reuse one session and log in again only after an auth failure.
  • The skill documents the URL guidance.

Getting started

  • Relevant files: mcp-server/tools/txadmin_client.py, mcp-server/tools/txadmin.py, mcp-server/server.py, skills/txadmin-integration/SKILL.md
  • How to run checks: there is no test suite yet; run the MCP server with cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in .github/workflows/validate.yml
  • Related docs: MCP specification (tool annotations), txAdmin documentation

Filed by repo-audit/full-audit at 701824d. Severity: low. Effort: S. audit-key: enhancement|mcp-server/tools/txadmin_client.py|hardening

Activity

  1. TMHSDigital commented on Nov 21, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 435f349.

    Plain-HTTP txAdmin URLs on non-loopback hosts are refused unless TXADMIN_ALLOW_INSECURE=1; all tools carry MCP annotations (txAdmin control and kick destructive, lookups and player search read-only); one logged-in session is reused per process and renewed once on 401/403; the skill documents HTTPS/SSH-tunnel guidance.

    Verified: Tests: one login across consecutive calls, re-login after a 401, remote http refused with no request sent, https and the opt-in accepted, annotations visible via list_tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions