| name | linux-mcp-server-administration |
| description | MCP server for read-only Linux system diagnostics and troubleshooting on RHEL-based systems via SSH |
| triggers | ["diagnose Linux system issues remotely","check system logs and services on remote servers","troubleshoot RHEL server problems","inspect systemd services and processes","analyze Linux system performance and status","connect to remote Linux hosts for diagnostics","monitor network and storage on Linux systems","examine journal logs and system information"] |
Linux MCP Server Administration
Skill by ara.so — MCP Skills collection.
Overview
The Linux MCP Server is a Model Context Protocol server that provides read-only diagnostic and troubleshooting capabilities for RHEL-based Linux systems. It enables LLM clients to execute diagnostic commands on local or remote systems via SSH, making it ideal for system administration, monitoring, and troubleshooting tasks.
Key Features:
- Strictly read-only operations for safe diagnostics
- Remote SSH execution with key-based authentication
- Multi-host management in a single session
- Comprehensive system diagnostics (services, processes, logs, network, storage)
- RHEL/systemd optimized
Installation
Using pip
pip install linux-mcp-server
Using uv (recommended)
pip install uv
uv pip install linux-mcp-server
From source
git clone https://github.com/rhel-lightspeed/linux-mcp-server.git
cd linux-mcp-server
pip install -e .
Configuration
MCP Client Configuration
Add to your MCP client settings (e.g., Claude Desktop config.json):
{
"mcpServers": {
"linux": {
"command": "uv",
"args": [
"--directory",
"/path/to/linux-mcp-server",
"run",
"linux-mcp-server"
],
"env": {
"LINUX_MCP_ALLOWED_LOGS": "/var/log/messages,/var/log/secure,/var/log/audit/audit.log"
}
}
}
}
Environment Variables
LINUX_MCP_ALLOWED_LOGS: Comma-separated list of log files that can be accessed (default: common system logs)
SSH_AUTH_SOCK: SSH agent socket for key-based authentication
HOME: User home directory (for SSH key location)
SSH Setup for Remote Hosts
Ensure SSH key-based authentication is configured:
ssh-keygen -t ed25519 -C "your_email@example.com"
ssh-copy-id user@remote-host
ssh user@remote-host
Available Tools
System Information
get_system_info - Retrieve basic system information (hostname, OS, kernel, uptime)
get_uname - Get detailed kernel and system information
Service Management
list_services - List systemd services and their states
get_service_status - Get detailed status of a specific service
Process Management
list_processes - List running processes
get_process_info - Get detailed information about a specific process
Log Analysis
read_journal - Read systemd journal logs
read_log_file - Read specific log files
search_logs - Search for patterns in logs
Network Diagnostics
get_network_info - Get network interface information
get_listening_ports - List listening network ports
test_connectivity - Test network connectivity to a host
Storage Diagnostics
get_disk_usage - Get filesystem disk usage
get_mount_points - List mounted filesystems
Common Patterns
Multi-Host Diagnostics
Service Troubleshooting Workflow
System Health Check
Log Analysis for Errors
Running the Server
Standalone Mode
linux-mcp-server
LINUX_MCP_ALLOWED_LOGS="/var/log/myapp.log,/var/log/custom.log" linux-mcp-server
Development Mode
git clone https://github.com/rhel-lightspeed/linux-mcp-server.git
cd linux-mcp-server
pip install -e .
python -m linux_mcp_server
Troubleshooting
SSH Connection Issues
Problem: "Could not connect to remote host"
Solutions:
- Verify SSH key authentication:
ssh user@host
- Check SSH agent is running:
echo $SSH_AUTH_SOCK
- Start SSH agent:
eval $(ssh-agent) and ssh-add ~/.ssh/id_ed25519
- Verify host in known_hosts:
ssh-keyscan host >> ~/.ssh/known_hosts
Log Access Denied
Problem: "Log file not in allowed list"
Solution:
- Add log path to
LINUX_MCP_ALLOWED_LOGS environment variable
- Restart the MCP server after updating configuration
{
"env": {
"LINUX_MCP_ALLOWED_LOGS": "/var/log/messages,/var/log/secure,/custom/app.log"
}
}
Permission Denied Errors
Problem: "Permission denied" when accessing system resources
Solutions:
- Use appropriate user with sudo privileges:
ssh admin@host not ssh user@host
- Verify remote user has read access to logs and system commands
- For systemctl commands, ensure user can run
systemctl status
Tool Not Found
Problem: Command not found on remote system
Solutions:
- Verify RHEL/systemd-based system (tool is optimized for RHEL)
- Check required commands are installed:
systemctl, journalctl, ss, df
- Ensure PATH includes
/usr/bin, /usr/sbin
Security Considerations
- Read-only operations: All tools are strictly read-only, no system modifications
- SSH key authentication: Use key-based auth, never passwords
- Log access control: Explicitly whitelist allowed log files
- Principle of least privilege: Use service accounts with minimal permissions
- Audit logging: All SSH connections are logged on remote systems
Best Practices
- Use service accounts: Create dedicated accounts for MCP diagnostics
- Limit log access: Only whitelist logs necessary for diagnostics
- Test SSH first: Always verify manual SSH connection before using MCP
- Monitor usage: Review SSH logs to track diagnostic sessions
- Keep keys secure: Use SSH agent, don't embed keys in config files