Installation Guide¶
Get the Linux MCP Server running quickly with your favorite LLM client.
Architecture Requirement
This setup requires a Control VM, where the MCP server and AI assistant run—this can be your local machine, and a Target VM - the Linux system you wish to troubleshoot, which can be a local or remote host.
Table of Contents
Installation Options¶
The Linux MCP Server can be installed using pip, uv, or run in a container. Choose the method that best suits your environment.
Prerequisites¶
Python 3.10 or later.
See Platform Specific Notes for installation instructions
Install with pip (Recommended)¶
Command not found?
The ~/.local/bin directory may not be in your PATH.
Quick fix: Use the full path:
Permanent fix: Add to your shell config:
Install with uv¶
Install uv first, then:
Verify installation:
Tip
If the command is not found, run uv tool update-shell to add ~/.local/bin to your PATH, then restart your shell.
Note
It is not necessary to run linux-mcp-server directly for normal use. The LLM client will handle starting and stopping the server.
Run in a container (Podman)¶
A container runtime such as Podman is required.
Container image:
Container Setup for SSH Keys¶
The container needs access to your SSH keys for remote connections. Set up the required directories and permissions:
# Create directories
mkdir -p ~/.local/share/linux-mcp-server/logs
# Copy your SSH key and set ownership
cp ~/.ssh/id_ed25519 ~/.local/share/linux-mcp-server/
sudo chown -R 1001:1001 ~/.local/share/linux-mcp-server/
Why UID 1001? Understanding container permissions
The container runs as a non-root user (UID 1001) for security. Files mounted from your host must be readable by this user.
What's happening:
- The container process runs as user ID
1001, not your host user - Mounted SSH keys must be owned by
1001to be readable - Log directory must be writable by
1001to store logs
If you see permission errors:
Docker vs Podman differences
Podman uses --userns keep-id:uid=1001,gid=0 to map user namespaces.
Docker does NOT support this flag. When using Docker:
- Remove the
--usernsparameter from the run command - Ensure files are owned by UID 1001 on the host
- Create directories beforehand (Docker won't auto-create them)
SSH Configuration¶
Setup¶
- Verify passwordless SSH access to the target system:
ssh user@hostname "echo success". - Add host aliases to the
~/.ssh/configfile for easier access. - (Optional) Set the
LINUX_MCP_USERenvironment variable if the remote user name is the same on all hosts and not using~/.ssh/config.
SSH Key Prerequisites
The MCP server requires passwordless SSH authentication (key-based, not password).
Check if you have SSH keys:
If no keys exist, generate them:
Copy your key to a remote host:
Test the connection:
If prompted for a password, key-based authentication is not configured correctly.
Specifying Remote Hosts¶
When using MCP tools, the host parameter may be a fully qualified domain name (FQDN), an alias from ~/.ssh/config, or an IP address.
Per-Host Configuration¶
If per-host connection settings are required, use ~/.ssh/config and do not set LINUX_MCP_USER.
# ~/.ssh/config
Host webserver
HostName 10.0.0.64
User admin
Host dbserver
HostName 10.0.0.128
User postgres
Port 2222
With this config, use host="webserver" in MCP tool calls instead of the full hostname.
Tip
If ssh-agent is running, keys loaded into the session will be used automatically.
Platform-Specific Notes¶
Linux¶
Installing Python:
Most Linux distributions come with Python pre-installed. Check your version:
If you need to install or upgrade Python:
Debian/Ubuntu:
RHEL/CentOS/Fedora:
Arch Linux:
Notes:
- You may have to use python3 and pip3 commands instead of python and pip on most Linux distributions
macOS¶
Installing Python¶
Download from python.org/downloads/macos and run the installer.
Installing linux-mcp-server¶
Command not found after installation?
On macOS (which uses zsh by default), add the install location to your PATH:
For uv installations, also run:
SSH Setup on macOS¶
macOS includes OpenSSH by default. To set up key-based authentication:
# Generate a key (if you don't have one)
ssh-keygen -t ed25519 -C "your_email@example.com"
# Copy to remote host
ssh-copy-id user@hostname
Using macOS Keychain for SSH keys
macOS can store your SSH key passphrase in the system Keychain, so you don't need to enter it repeatedly:
# Add your key to the ssh-agent with Keychain storage
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Add this to ~/.ssh/config to automatically load keys:
macOS Limitations¶
Local vs Remote Usage
Local execution (no host parameter): Most tools will have limited functionality since macOS doesn't use systemd, journalctl, or standard Linux paths.
| Tool | Local (macOS) | Remote (Linux) |
|---|---|---|
get_system_information |
✅ Works | ✅ Works |
list_processes |
✅ Works | ✅ Works |
get_network_interfaces |
✅ Works | ✅ Works |
list_services |
❌ No systemd | ✅ Works |
get_journal_logs |
❌ No journald | ✅ Works |
get_disk_usage |
✅ Works | ✅ Works |
Remote execution (with host parameter): Full functionality when connecting to Linux servers via SSH.
Windows¶
Installing Python¶
Search for "Python" in the Microsoft Store and install Python 3.12 or later. This automatically handles PATH configuration.
Using Windows Package Manager (built into Windows 11, available for Windows 10):
Download from python.org/downloads/windows.
Important
Check "Add Python to PATH" during installation, or you'll need to configure it manually.
Scoop is a command-line installer for Windows:
Verify installation (in PowerShell or Command Prompt):
Installing linux-mcp-server¶
Command not found after installation?
The default pip user install location on Windows is:
Add to PATH via PowerShell:
# Find Python user scripts directory
python -c "import site; print(site.USER_SITE.replace('site-packages', 'Scripts'))"
# Add to your PATH (replace X with your Python version)
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:APPDATA\Python\Python312\Scripts", "User")
Restart your terminal after making PATH changes.
SSH Setup on Windows¶
Windows 10/11 includes OpenSSH as an optional feature.
Enable OpenSSH Client:
Generate and copy SSH keys:
# Generate a key
ssh-keygen -t ed25519 -C "your_email@example.com"
# Copy to remote host (Windows doesn't have ssh-copy-id by default)
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh user@hostname "cat >> ~/.ssh/authorized_keys"
Using ssh-agent on Windows
Start the ssh-agent service to manage your keys:
Windows Limitations¶
Remote-Only Usage Recommended
This MCP server is designed for Linux systems. On Windows, local execution will not work for most tools since Windows lacks systemd, journalctl, and Linux-specific paths.
Supported use case: Use Windows as a client to manage remote Linux servers via SSH.
| Tool | Local (Windows) | Remote (Linux) |
|---|---|---|
get_system_information |
❌ Fails | ✅ Works |
list_processes |
❌ Fails | ✅ Works |
list_services |
❌ No systemd | ✅ Works |
get_journal_logs |
❌ No journald | ✅ Works |
| All other tools | ❌ Fails | ✅ Works |
Having Problems?¶
See the Troubleshooting Guide for solutions to common issues.
Additional Resources¶
- Client Configuration: Configure Claude Desktop, Goose, and other MCP clients
- Troubleshooting: Solutions for common issues
- Usage Guide: Detailed guide on using all available tools
- Contributing: Development workflow and guidelines
- MCP Documentation
- MCP Inspector