Configuration Reference¶
The Linux MCP Server is configured through command line options or environment variables. Environment variables use a LINUX_MCP_ prefix. For example, --log-level corresponds to LINUX_MCP_LOG_LEVEL.
Precedence
Command line options take precedence over environment variables. For MCP client configurations (Claude Desktop, Cursor, etc.), you typically use environment variables in the config file rather than command line arguments, but either will work.
To see available options, run linux-mcp-server --help.
Transport Settings¶
| Option / Env Var | Default | Description |
|---|---|---|
--transportLINUX_MCP_TRANSPORT |
stdio |
Transport type: stdio or http |
--hostLINUX_MCP_HOST |
127.0.0.1 |
Host address for HTTP transport |
--portLINUX_MCP_PORT |
8000 |
Port number for HTTP transport |
--base-urlLINUX_MCP_BASE_URL |
(derived from TLS, host, and port) | Public server URL including scheme, used for authentication URLs |
--pathLINUX_MCP_PATH |
/mcp |
Path for HTTP transport |
--tls-certLINUX_MCP_TLS_CERT |
(none) | Path to PEM certificate chain for HTTPS; requires --tls-key |
--tls-keyLINUX_MCP_TLS_KEY |
(none) | Path to PEM private key for HTTPS; requires --tls-cert |
TLS settings require http transport. Without them, the server uses plain HTTP.
See Shared Server for TLS, authentication, and authorization setup.
Note
Some clients, like Claude Desktop, require stdio transport.
SSH Connection Settings¶
| Option / Env Var | Default | Description |
|---|---|---|
--userLINUX_MCP_USER |
(empty) | Default username for SSH connections |
--ssh-key-pathLINUX_MCP_SSH_KEY_PATH |
(none) | Path to SSH private key file |
--key-passphraseLINUX_MCP_KEY_PASSPHRASE |
(empty) | Passphrase for encrypted SSH key |
--search-for-ssh-keyLINUX_MCP_SEARCH_FOR_SSH_KEY |
False |
Auto-discover SSH keys in ~/.ssh |
--command-timeoutLINUX_MCP_COMMAND_TIMEOUT |
30 |
Local and remote command timeout in seconds |
SSH Security Settings¶
| Option / Env Var | Default | Description |
|---|---|---|
--verify-host-keys / --no-verify-host-keysLINUX_MCP_VERIFY_HOST_KEYS |
True |
Verify remote host identity via known_hosts |
--known-hosts-pathLINUX_MCP_KNOWN_HOSTS_PATH |
(none) | Custom path to known_hosts file |
See SSH Configuration for details on setting up SSH connections and managing host keys.
Tool Settings¶
| Option / Env Var | Default | Description |
|---|---|---|
--toolsetLINUX_MCP_TOOLSET |
fixed |
Toolset: fixed, run_script, or both |
--host-modeLINUX_MCP_HOST_MODE |
(see below) | Where tools may run: local-only, remote-only, or any |
--allowed-log-pathsLINUX_MCP_ALLOWED_LOG_PATHS |
(none) | Comma-separated allowlist of log file paths for read_log_file |
--max-file-read-bytesLINUX_MCP_MAX_FILE_READ_BYTES |
1048576 |
Maximum bytes read_file may return |
See Guarded Command Execution for details on the run_script toolset.
Host mode¶
By default most tools take a required host parameter: localhost runs the work on the system the MCP server runs on, and any other value runs it on that host over SSH. LINUX_MCP_HOST_MODE controls which of those the server accepts:
| Value | Effect |
|---|---|
any |
Both localhost and remote hosts are allowed |
local-only |
Everything runs on the system the server runs on; tools take no host parameter at all |
remote-only |
Only remote hosts are allowed; localhost is refused |
The default is remote-only when the server runs in a container or on a platform other than Linux, and any otherwise. In a container, tools would otherwise report on the container's own filesystem, processes and units rather than the host's; on macOS and Windows local execution is not implemented at all.
The setting shapes what the model is shown, so it is told what it can do rather than finding out by being refused: the server instructions describe where tools run, remote-only describes each tool's host parameter as a remote system to reach over SSH, and local-only drops that parameter from the tool schemas entirely, since there is only one value it could have. A host outside the configured mode is rejected, never silently redirected. A client still passing an explicit host: localhost under local-only keeps working.
Only localhost means local execution
The mode is decided by comparing host against localhost, so remote-only controls whether tools
run locally without SSH. It does not stop a client from naming the server's own address or host name
and reaching it over SSH; there is no way to recognize every name that resolves back to the same system.
Not an authorization mechanism
Host mode narrows what the model is offered. Use an authorization policy to control who may run which tools where.
Guarded Command Execution Settings¶
These are used when LINUX_MCP_TOOLSET is set to run_script or both.
| Option / Env Var | Default | Description |
|---|---|---|
--always-confirm-scripts / --no-always-confirm-scriptsLINUX_MCP_ALWAYS_CONFIRM_SCRIPTS |
False |
All scripts must be confirmed by the user |
--gatekeeper.providerLINUX_MCP_GATEKEEPER__PROVIDER |
(none) | Required: LLM provider (openai, anthropic, gemini, openrouter, or vertex_ai) |
--gatekeeper.modelLINUX_MCP_GATEKEEPER__MODEL |
(none) | Required: provider-native model ID (e.g. gpt-5.4, claude-sonnet-4-6, gemini-2.0-flash, openai/gpt-oss-120b for OpenRouter) |
--gatekeeper.reasoning_effortLINUX_MCP_GATEKEEPER__REASONING_EFFORT |
(unset) | Reasoning effort. none = least/no thinking; minimal/low/medium/high/xhigh = that level. Leave unset or set to unset to use the provider default value. Not all values are supported for all models. |
--gatekeeper.structured_outputLINUX_MCP_GATEKEEPER__STRUCTURED_OUTPUT |
True |
Whether to use structured JSON output from the model |
--gatekeeper.temperatureLINUX_MCP_GATEKEEPER__TEMPERATURE |
(unset) | Temperature to use for the model. A float between 0.0 and 2.0; leave unset or set to unset to omit the parameter. Omitting is required for certain models (e.g. OpenAI reasoning models such as gpt-5 and gpt-6) |
--gatekeeper.openai.base_urlLINUX_MCP_GATEKEEPER__OPENAI__BASE_URL / OPENAI_API_BASE |
https://api.openai.com/v1 |
OpenAI provider: API base URL |
--gatekeeper.openai.template_kwargsLINUX_MCP_GATEKEEPER__OPENAI__TEMPLATE_KWARGS |
(none) | OpenAI provider: extra chat-template arguments (e.g. { "enable_thinking": false }), sent as chat_template_kwargs |
--gatekeeper.anthropic.base_urlLINUX_MCP_GATEKEEPER__ANTHROPIC__BASE_URL |
https://api.anthropic.com/v1 |
Anthropic provider: API base URL |
--gatekeeper.openrouter.base_urlLINUX_MCP_GATEKEEPER__OPENROUTER__BASE_URL |
https://openrouter.ai/api/v1 |
OpenRouter provider: API base URL |
--gatekeeper.openrouter.quantizationLINUX_MCP_GATEKEEPER__OPENROUTER__QUANTIZATION |
(none) | OpenRouter provider: filter providers by quantization level (e.g. fp4, bf16) |
--gatekeeper.openrouter.template_kwargsLINUX_MCP_GATEKEEPER__OPENROUTER__TEMPLATE_KWARGS |
(none) | OpenRouter provider: extra chat-template arguments |
--gatekeeper.vertex_ai.projectLINUX_MCP_GATEKEEPER__VERTEX_AI__PROJECT / VERTEXAI_PROJECT |
(none) | Vertex AI provider: GCP project |
--gatekeeper.vertex_ai.locationLINUX_MCP_GATEKEEPER__VERTEX_AI__LOCATION / VERTEXAI_LOCATION |
global |
Vertex AI provider: GCP region |
--gatekeeper.vertex_ai.base_urlLINUX_MCP_GATEKEEPER__VERTEX_AI__BASE_URL |
(computed) | Vertex AI provider: override OpenAI-compatible MaaS endpoint URL (default derived from project/location) |
| Provider credentials | (none) | OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY / GEMINI_API_KEY, or OPENROUTER_API_KEY for direct providers; GOOGLE_APPLICATION_CREDENTIALS for vertex_ai |
Redaction Settings¶
| Option / Env Var | Default | Description |
|---|---|---|
--redaction.enabledLINUX_MCP_REDACTION__ENABLED |
true |
Redact credentials from tool output |
--redaction.rules-pathLINUX_MCP_REDACTION__RULES_PATH |
(none) | Path to a YAML file of custom redaction rules |
Built-in rules cover credentials such as passwords, API keys, tokens, PEM private keys and cloud provider keys. A rules file can add patterns of its own and enable or disable existing ones by name. See Redaction for the rules file format, and for the --redact-list and --redact-test options that check the rules.
Logging Configuration¶
| Option / Env Var | Default | Description |
|---|---|---|
--log-outputLINUX_MCP_LOG_OUTPUT |
files |
Destination: files (rotating text and JSON files plus text stderr), stdout, or stderr. stdout requires an HTTP transport. |
--log-formatLINUX_MCP_LOG_FORMAT |
text |
Stream format: text or json. Applies to stdout/stderr output; ignored in files mode. |
--log-dirLINUX_MCP_LOG_DIR |
~/.local/share/linux-mcp-server/logs |
Directory for server logs; used only with --log-output=files |
--log-levelLINUX_MCP_LOG_LEVEL |
default |
default, DEBUG, INFO, WARNING, ERROR, or CRITICAL. default is INFO and above for linux-mcp-server itself, but WARNING and above for libraries it uses. |
--log-retention-daysLINUX_MCP_LOG_RETENTION_DAYS |
10 |
Days to retain log files; used only with --log-output=files |
See Debug Logging for details on log formats and locations.
Authorization Configuration¶
These settings enable OAuth2 authentication for the HTTP transport. See Shared Server for an overview of authorization concepts and setup.
| Option / Env Var | Default | Description |
|---|---|---|
--auth.providerLINUX_MCP_AUTH__PROVIDER |
(none) | Authorization provider: google, github, jwt, or introspection |
--policy-pathLINUX_MCP_POLICY_PATH |
(none) | Path to authorization policy YAML file |
The behavior when --policy-path is not specified varies by transport:
stdio: all access is allowed - the default action islocalforlocalhostandssh_defaultotherwise.http: all access is denied
Note: --policy-path can be specified for the stdio transport, but is not typically useful. All rules must have all_users: true since there are no token claims to match on.
Authorization Providers¶
Each provider requires its own set of configuration options, described below. Only the settings for the selected --auth.provider need to be configured.
Google¶
Uses Google OAuth for authentication. Suitable for testing or environments where users have Google accounts.
| Option / Env Var | Default | Description |
|---|---|---|
--auth.google.client_idLINUX_MCP_AUTH__GOOGLE__CLIENT_ID |
(required) | Google OAuth client ID |
--auth.google.client_secretLINUX_MCP_AUTH__GOOGLE__CLIENT_SECRET |
(required) | Google OAuth client secret |
Sign-in requests the openid and email scopes, so tokens carry the email and email_verified claims that authorization policy rules can match.
When the OAuth client's audience is set to Internal in Google Cloud, only accounts in your Google Workspace can sign in, so a rule on email alone is usually enough.
GitHub¶
Uses GitHub OAuth for authentication. Suitable for testing or environments where users have GitHub accounts.
| Option / Env Var | Default | Description |
|---|---|---|
--auth.github.client_idLINUX_MCP_AUTH__GITHUB__CLIENT_ID |
(required) | GitHub OAuth client ID |
--auth.github.client_secretLINUX_MCP_AUTH__GITHUB__CLIENT_SECRET |
(required) | GitHub OAuth client secret |
JWT¶
Validates JWT tokens locally using a JWKS endpoint. Use this when your authorization server issues JWTs and publishes a JWKS endpoint for token verification.
| Option / Env Var | Default | Description |
|---|---|---|
--auth.jwt.jwks_uriLINUX_MCP_AUTH__JWT__JWKS_URI |
(required) | URL of the JWKS endpoint for token verification |
--auth.jwt.issuerLINUX_MCP_AUTH__JWT__ISSUER |
(required) | Expected token issuer (iss claim) |
--auth.jwt.audienceLINUX_MCP_AUTH__JWT__AUDIENCE |
(none) | Expected token audience (aud claim) |
Introspection¶
Validates tokens by sending them back to the authorization server's introspection endpoint. Use this when your authorization server supports RFC 7662 token introspection.
| Option / Env Var | Default | Description |
|---|---|---|
--auth.introspection.introspection_urlLINUX_MCP_AUTH__INTROSPECTION__INTROSPECTION_URL |
(required) | Token introspection endpoint URL |
--auth.introspection.issuerLINUX_MCP_AUTH__INTROSPECTION__ISSUER |
(required) | Expected token issuer |
--auth.introspection.client_idLINUX_MCP_AUTH__INTROSPECTION__CLIENT_ID |
(required) | Client ID for authenticating to the introspection endpoint |
--auth.introspection.client_secretLINUX_MCP_AUTH__INTROSPECTION__CLIENT_SECRET |
(required) | Client secret for authenticating to the introspection endpoint |
--auth.introspection.timeout_secondsLINUX_MCP_AUTH__INTROSPECTION__TIMEOUT_SECONDS |
10 |
Timeout in seconds for introspection requests |
Authorization Policy¶
See Configuring the Authorization policy for an overview and examples.
An authorization policy is a YAML file with a single toplevel property, rules,
which is a list of rules.
The rules are checked in order,
and when a matching rule is found, the action from that rule is used, and processing stops.
Each rule has the following properties that are used for matching:
host(required, string): eitherlocalhostfor local execution or a pattern (with * and ? wildcards) that matches a remote host.localhostmust be specified literally -host: *will not matchlocalhost.tools(required, list of strings) - a list of tool names or toolsets to match. Use*to match all tools. A toolset (as forLINUX_MCP_TOOLSET) is represented by a@prefix. If a tool name or toolset name is preceded by-, that excludes the tool or toolset. (Exclusions take precedence, order doesn't matter.)-
claims(object) - claims from the OAuth2 token to match on. Each item in here is of the form<claim_name>:<value>with the following match rules:- if
<value>is a string, and the value from the token is a string, they must match exactly - if
<value>is a string, and the value from the token is a list,<value>must be in the list (example:groups: app-rhel-mcp-server-users) - for all other types for
<value>the values must match exactly (example:email_verified: true)
An
email_verifiedclaim sent as the string"true"or"false"(as Google does) is converted to a boolean before matching and logging, soemail_verified: trueworks with every provider. -all_users(boolean) -trueif this rule should match all users. Eitherall_users: trueor a non-emptyclaimsmust be specified; a rule withall_users: false(the default) and noclaimsis invalid. - if
The rule also specifies an action and, if the action is ssh_key, additional properties for that action.
action(one ofdeny,local,ssh_default,ssh_key) - what to do for a matching ruledeny- deny execution of the toollocal- allow the tool to be executed on the local systemssh_default- allow the tool to be executed on a remote system, using default SSH key lookupssh_key- allow the tool to be executed on a remote system using a specific SSH key identified by path
ssh_key: Required whenactionisssh_key.path: (string) - path to an SSH key to use to connect to a remote systemuser: (string) - username to use on the remote system
Examples¶
Specify SSH settings:
Configure log access:
Using environment variables in a client config: