linuxctl CLI
The linuxctl command-line interface allows users and AI agents to seamlessly interact with the Linux Model Context Protocol (MCP) Daemon (mcpd) running in the background.
linuxctl speaks a small, uniform verb/group grammar (design rationale: plan/linuxctl-redesign.md) instead of a flat, one-off command per tool - every tool, resource, and resource template mcpd exposes is reachable through the same handful of words, discovered dynamically from the daemon's live schema on every invocation. Adding a new tool server-side makes it usable via linuxctl immediately, with no client code changes.
This section is split into a few focused pages so every way of using linuxctl is easy to find:
- Grammar & Commands - the
<verb> <group> [target-keyword]grammar itself, plus every standalone command (ping,explain,resource,tool). - MCP Meta-Group -
get mcp-api tools/resources/prompts/info, for introspecting the MCP protocol itself (what this daemon does and doesn't implement). - Full Command Reference - every tool, resource, and template, grouped and with real captured output.
- Daemon User Administration -
create/delete/update/list/describe mcpd user, the local-only (no network) way to manage bearer tokens and permissions.
Synopsis
linuxctl [OPTIONS] <verb> <group> [target-keyword] [args]
linuxctl [OPTIONS] describe <group> [target-keyword] <name>
linuxctl [OPTIONS] explain <group>
linuxctl [OPTIONS] get mcp-api <tools|resources|prompts|info>
linuxctl [OPTIONS] tool <group>/<command> [--flag val ...]
linuxctl [OPTIONS] resource <uri>
linuxctl [OPTIONS] <verb> mcpd user <username>
linuxctl completion <bash|zsh>
Options
-
-server URLThe URL of themcpdserver to connect to. Defaults to theMCP_SERVERenvironment variable, orhttps://localhost:9091if that's unset. -
-token TOKENBearer token for authentication. If not provided via this flag, the client looks for theMCP_TOKENenvironment variable. Not needed for the local-onlymcpdadmin group. -
-config-path DIRLocal path to the daemon'sconfigs/directory. Only used by the local-onlymcpdadmin group - defaults to./configs. -
-silent,-sPrint no errors or warnings, likecurl -s- for scripts. Output goes to stdout and errors to stderr either way;-sonly discards stderr. The exit status still tells a failure: 0 on success, 1 on any error, a tool's own failure included:if ! linuxctl -s get files read --path /etc/app.conf > app.conf; thenecho "could not read the config" >&2fi -
-tls-insecure,-kSkip TLS certificate verification, likecurl -k(orMCP_TLS_INSECURE=1). Testing only - see below.
Environment Variables
-
MCP_TOKENThe bearer token used for authenticating with the daemon. This is the recommended way to authenticate so you don't leak tokens in shell histories. -
MCP_SERVERDefault for-server. Prefer this over a shell alias likealias linuxctl="linuxctl -server ..."- shell completion can't see through aliases. -
MCP_TLS_FINGERPRINT(or-tls-fingerprint) Trust the server whose certificate has this SHA-256 fingerprint - the simplest way to trust mcpd's self-signed certificate from another machine. mcpd logs it at startup;linuxctl describe mcpd tlsshows it on the daemon's host. -
MCP_CA_CERT(or-ca-cert) Trust this certificate file (PEM) - e.g. a copy of the host's/etc/mcpd/configs/tls/mcpd.crt. Without either,linuxctltrusts the system's CAs plus, on the daemon's own host, its certificate when readable. -
MCP_TLS_INSECURE=1(or-tls-insecure, short-kas in curl) Skip certificate verification. For testing only: any certificate is accepted, a forged one too, and the token is sent to it - pin the fingerprint instead.
Quick example
export MCP_SERVER="https://my-host:9091"
export MCP_TLS_FINGERPRINT="sha256:..." # linuxctl describe mcpd tls, on my-host
export MCP_TOKEN="your_token_here"
linuxctl ping
linuxctl get files /etc/hosts
linuxctl get disks free /
See Grammar & Commands for the full rules, or jump straight to the Full Command Reference for real, copy-pasteable examples across every tool.
Shell completion
linuxctl completion bash|zsh enables Tab completion of verbs, groups, keywords, flags and resource URIs, driven by the daemon's live registry. See Autocompletion (bash/zsh) for setup.
Table output width
-o table fits the terminal - long trailing columns such as a process's command line are cut with …, like ps. This still applies when piped (| more, | less), using the controlling terminal's width. Use -o wide for untruncated output, as with kubectl.