Ternux
MCP

Enabling & Configuring MCP

Turn on the local MCP server and connect an AI agent to it.

Enable the server

Go to Settings → MCP and toggle Enable MCP server. Ternux will:

  1. Generate a random bearer token (if one doesn't exist yet).
  2. Start listening on 127.0.0.1 on the configured port (default 7823).
FieldDescription
Enable MCP serverStarts/stops the local server. Only sessions open at call time are reachable — nothing is exposed while disabled.
PortLocal port the endpoint listens on (102465535). Can't be changed while the server is running — disable first.
Bearer tokenRequired on every request as Authorization: Bearer <token>. Use Copy to grab it, Regenerate to invalidate the old one and issue a new one.
StatusShows Running on 127.0.0.1:<port> or Stopped.

Regenerating the token immediately invalidates the old one — any connected agent will need the new token to keep working.

Connect an MCP client

Point your MCP client at the local endpoint and supply the bearer token. For example, with Claude Code:

claude mcp add --transport http ternux http://127.0.0.1:7823/mcp \
  --header "Authorization: Bearer <token>"

Once connected, the client will see two tools — list_open_connections and run_command — described in Available Tools.

Disabling

Toggle Enable MCP server off in Settings → MCP. The server stops immediately and the endpoint stops accepting connections; already-open SSH tabs in Ternux are unaffected.

On this page