|
3 | 3 | 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`. |
4 | 4 |
|
5 | 5 | !!! note "Precedence" |
6 | | - 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. |
| 6 | +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. |
7 | 7 |
|
8 | 8 | To see available options, run `linux-mcp-server --help`. |
9 | 9 |
|
10 | 10 | ## Transport Settings |
11 | 11 |
|
12 | | -| Option / Env Var | Default | Description | |
13 | | -|------------------|---------|-------------| |
14 | | -| `--transport`<br>`LINUX_MCP_TRANSPORT` | `stdio` | Transport type: `stdio` or `http` | |
15 | | -| `--host`<br>`LINUX_MCP_HOST` | `127.0.0.1` | Host address for HTTP transport | |
16 | | -| `--port`<br>`LINUX_MCP_PORT` | `8000` | Port number for HTTP transport | |
17 | | -| `--path`<br>`LINUX_MCP_PATH` | `/mcp` | Path for HTTP transport | |
| 12 | +| Option / Env Var | Default | Description | |
| 13 | +| -------------------------------------- | ----------- | --------------------------------- | |
| 14 | +| `--transport`<br>`LINUX_MCP_TRANSPORT` | `stdio` | Transport type: `stdio` or `http` | |
| 15 | +| `--host`<br>`LINUX_MCP_HOST` | `127.0.0.1` | Host address for HTTP transport | |
| 16 | +| `--port`<br>`LINUX_MCP_PORT` | `8000` | Port number for HTTP transport | |
| 17 | +| `--path`<br>`LINUX_MCP_PATH` | `/mcp` | Path for HTTP transport | |
18 | 18 |
|
19 | 19 | !!! warning "HTTP Transport Security" |
20 | | - The HTTP transport does not currently have authentication. It should not be used in production or on untrusted networks. |
| 20 | +The HTTP transport does not currently have authentication. It should not be used in production or on untrusted networks. |
21 | 21 |
|
22 | 22 | !!! note |
23 | | - Some clients, like Claude Desktop, require `stdio` transport. |
| 23 | +Some clients, like Claude Desktop, require `stdio` transport. |
24 | 24 |
|
25 | 25 | ## SSH Connection Settings |
26 | 26 |
|
27 | | -| Option / Env Var | Default | Description | |
28 | | -|------------------|---------|-------------| |
29 | | -| `--user`<br>`LINUX_MCP_USER` | *(empty)* | Default username for SSH connections | |
30 | | -| `--ssh-key-path`<br>`LINUX_MCP_SSH_KEY_PATH` | *(none)* | Path to SSH private key file | |
31 | | -| `--key-passphrase`<br>`LINUX_MCP_KEY_PASSPHRASE` | *(empty)* | Passphrase for encrypted SSH key | |
32 | | -| `--search-for-ssh-key`<br>`LINUX_MCP_SEARCH_FOR_SSH_KEY` | `False` | Auto-discover SSH keys in `~/.ssh` | |
33 | | -| `--command-timeout`<br>`LINUX_MCP_COMMAND_TIMEOUT` | `30` | Local and remote command timeout in seconds | |
| 27 | +| Option / Env Var | Default | Description | |
| 28 | +| -------------------------------------------------------- | --------- | ------------------------------------------- | |
| 29 | +| `--user`<br>`LINUX_MCP_USER` | _(empty)_ | Default username for SSH connections | |
| 30 | +| `--ssh-key-path`<br>`LINUX_MCP_SSH_KEY_PATH` | _(none)_ | Path to SSH private key file | |
| 31 | +| `--key-passphrase`<br>`LINUX_MCP_KEY_PASSPHRASE` | _(empty)_ | Passphrase for encrypted SSH key | |
| 32 | +| `--search-for-ssh-key`<br>`LINUX_MCP_SEARCH_FOR_SSH_KEY` | `False` | Auto-discover SSH keys in `~/.ssh` | |
| 33 | +| `--command-timeout`<br>`LINUX_MCP_COMMAND_TIMEOUT` | `30` | Local and remote command timeout in seconds | |
34 | 34 |
|
35 | 35 | ## SSH Security Settings |
36 | 36 |
|
37 | | -| Option / Env Var | Default | Description | |
38 | | -|------------------|---------|-------------| |
39 | | -| `--verify-host-keys` / `--no-verify-host-keys`<br>`LINUX_MCP_VERIFY_HOST_KEYS` | `True` | Verify remote host identity via known_hosts | |
40 | | -| `--known-hosts-path`<br>`LINUX_MCP_KNOWN_HOSTS_PATH` | *(none)* | Custom path to known_hosts file | |
| 37 | +| Option / Env Var | Default | Description | |
| 38 | +| ------------------------------------------------------------------------------ | -------- | ------------------------------------------- | |
| 39 | +| `--verify-host-keys` / `--no-verify-host-keys`<br>`LINUX_MCP_VERIFY_HOST_KEYS` | `True` | Verify remote host identity via known_hosts | |
| 40 | +| `--known-hosts-path`<br>`LINUX_MCP_KNOWN_HOSTS_PATH` | _(none)_ | Custom path to known_hosts file | |
41 | 41 |
|
42 | 42 | See [SSH Configuration](ssh.md) for details on setting up SSH connections and managing host keys. |
43 | 43 |
|
44 | 44 | ## Tool Settings |
45 | 45 |
|
46 | | -| Option / Env Var | Default | Description | |
47 | | -|------------------|---------|-------------| |
48 | | -| `--toolset`<br>`LINUX_MCP_TOOLSET` | `fixed` | Toolset: `fixed`, `run_script`, or `both` | |
49 | | -| `--allowed-log-paths`<br>`LINUX_MCP_ALLOWED_LOG_PATHS` | *(none)* | Comma-separated allowlist of log file paths for `read_log_file` | |
50 | | -| `--max-file-read-bytes`<br>`LINUX_MCP_MAX_FILE_READ_BYTES` | `1048576` | Maximum bytes `read_file` may return | |
| 46 | +| Option / Env Var | Default | Description | |
| 47 | +| ---------------------------------------------------------- | --------- | --------------------------------------------------------------- | |
| 48 | +| `--toolset`<br>`LINUX_MCP_TOOLSET` | `fixed` | Toolset: `fixed`, `run_script`, or `both` | |
| 49 | +| `--allowed-log-paths`<br>`LINUX_MCP_ALLOWED_LOG_PATHS` | _(none)_ | Comma-separated allowlist of log file paths for `read_log_file` | |
| 50 | +| `--max-file-read-bytes`<br>`LINUX_MCP_MAX_FILE_READ_BYTES` | `1048576` | Maximum bytes `read_file` may return | |
51 | 51 |
|
52 | 52 | See [Guarded Command Execution](guarded-command-execution.md) for details on the `run_script` toolset. |
53 | 53 |
|
54 | 54 | ## Guarded Command Execution Settings |
55 | 55 |
|
56 | 56 | These are used when `LINUX_MCP_TOOLSET` is set to `run_script` or `both`. |
57 | 57 |
|
58 | | -| Option / Env Var | Default | Description | |
59 | | -|------------------|---------|-------------| |
60 | | -| `--gatekeeper-model`<br>`LINUX_MCP_GATEKEEPER_MODEL` | *(none)* | Required: [LiteLLM model name](https://docs.litellm.ai/docs/providers) to use | |
61 | | -| `--always-confirm-scripts` / `--no-always-confirm-scripts`<br>`LINUX_MCP_ALWAYS_CONFIRM_SCRIPTS` | `False` | All scripts must be confirmed by the user | |
62 | | -| Other environment variables | *(none)* | As required by the LiteLLM provider, e.g. `OPENAI_API_KEY` | |
| 58 | +| Option / Env Var | Default | Description | |
| 59 | +| ----------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 60 | +| `--gatekeeper.model`<br>`LINUX_MCP_GATEKEEPER__MODEL` | _(none)_ | Required: [LiteLLM model name](https://docs.litellm.ai/docs/providers) to use | |
| 61 | +| `--gatekeeper.quantization`<br>`LINUX_MCP_GATEKEEPER__QUANTIZATION` | _(model specific)_ | _Not usually needed_ - Particular model quantization to use (openrouter only) | |
| 62 | +| `--gatekeeper.reasoning_effort`<br>`LINUX_MCP_GATEKEEPER__REASONING_EFFORT` | _(model specific)_ | Reasoning effort to use for gatekeeper model (`none`, `minimal`, `low`, `medium`, `high`, `xhigh`). Not all values are supported for all models. Special values (`enable_thinking`, `disable_thinking`) set the `enable_thinking` chat template parameter. | |
| 63 | +| `--gatekeeper.structured_output`<br>`LINUX_MCP_GATEKEEPER__STRUCTURED_OUTPUT` | _(autodected)_ | _Not usually needed_ - Whether to use structured output generation for the model. Default is to use if detected as available. | |
| 64 | +| `--gatekeeper.temperature`<br>`LINUX_MCP_GATEKEEPER__TEMPERATURE` | 0.0 | _Not usually needed_ - Temperature to use for model - for some models, a non-zero value may be necessary when enabling reasoning | |
| 65 | +| Other environment variables | _(none)_ | As required by the LiteLLM provider, e.g. `OPENAI_API_KEY` | |
63 | 66 |
|
64 | 67 | ## Logging Configuration |
65 | 68 |
|
66 | | -| Option / Env Var | Default | Description | |
67 | | -|------------------|---------|-------------| |
68 | | -| `--log-dir`<br>`LINUX_MCP_LOG_DIR` | `~/.local/share/linux-mcp-server/logs` | Directory for server logs | |
69 | | -| `--log-level`<br>`LINUX_MCP_LOG_LEVEL` | `INFO` | Log verbosity: `DEBUG`, `INFO`, `WARNING` | |
70 | | -| `--log-retention-days`<br>`LINUX_MCP_LOG_RETENTION_DAYS` | `10` | Days to retain log files | |
| 69 | +| Option / Env Var | Default | Description | |
| 70 | +| -------------------------------------------------------- | -------------------------------------- | ----------------------------------------- | |
| 71 | +| `--log-dir`<br>`LINUX_MCP_LOG_DIR` | `~/.local/share/linux-mcp-server/logs` | Directory for server logs | |
| 72 | +| `--log-level`<br>`LINUX_MCP_LOG_LEVEL` | `INFO` | Log verbosity: `DEBUG`, `INFO`, `WARNING` | |
| 73 | +| `--log-retention-days`<br>`LINUX_MCP_LOG_RETENTION_DAYS` | `10` | Days to retain log files | |
71 | 74 |
|
72 | 75 | See [Debug Logging](debugging.md) for details on log formats and locations. |
73 | 76 |
|
74 | 77 | ## Examples |
75 | 78 |
|
76 | 79 | **Specify SSH settings:** |
| 80 | + |
77 | 81 | ```bash |
78 | 82 | linux-mcp-server --user admin --ssh-key-path ~/.ssh/id_rsa --verify-host-keys |
79 | 83 | ``` |
80 | 84 |
|
81 | 85 | **Configure log access:** |
| 86 | + |
82 | 87 | ```bash |
83 | 88 | linux-mcp-server --allowed-log-paths "/var/log/messages,/var/log/secure,/var/log/audit/audit.log" |
84 | 89 | ``` |
85 | 90 |
|
86 | 91 | **Using environment variables in a client config:** |
| 92 | + |
87 | 93 | ```json |
88 | 94 | { |
89 | 95 | "env": { |
|
0 commit comments