Repository navigation
Closed
Labels
Description
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(newTxAdminClient()per call)mcp-server/server.py:139-200(txAdmin tools registered with plain@mcp.tool())skills/txadmin-integration/SKILL.md:28(documentshttp://URL)
Details
- Plain HTTP to remote hosts.
TXADMIN_URLaccepts any scheme and host, andlogin()sends{"username", "password"}as JSON to/auth/password. The default and documented examples usehttp://, 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_toolandtxadmin_kick_player_toolhave 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 ishttpand the host is not127.0.0.1,::1orlocalhost, refuse unless an explicit opt-in such asTXADMIN_ALLOW_INSECURE=1is set, and document HTTPS or an SSH tunnel for remote panels. - Register stop/restart/resource/kick tools with
destructiveHint=True,readOnlyHint=Falseannotations, and the player search tool withreadOnlyHint=True. Optionally requireconfirm=Trueforstop. - Cache one logged-in
TxAdminClientper process and re-login on a 401 or CSRF failure.
Acceptance criteria
- A remote
http://TXADMIN_URLis 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
TMHSDigital commentedon Nov 21, 2026
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.