- Home
- MCP servers
- Linux
Linux
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"narmaku-linux-mcp-server": {
"command": "uv",
"args": [
"run",
"linux-mcp-server"
],
"env": {
"LINUX_MCP_LOG_DIR": "/var/log/linux-mcp-server",
"LINUX_MCP_LOG_LEVEL": "INFO",
"LINUX_MCP_SSH_KEY_PATH": "/path/to/your/private/key",
"LINUX_MCP_ALLOWED_LOG_PATHS": "/var/log/messages,/var/log/secure,/var/log/audit/audit.log",
"LINUX_MCP_LOG_RETENTION_DAYS": "30"
}
}
}
}You have a read‑only MCP server designed for Linux system diagnostics and remote troubleshooting. It lets you inspect a host or multiple remote hosts via SSH, gather system information, services, processes, logs, network data, and storage details, all without modifying the targets. This setup focuses on safe, read‑only diagnostics while providing flexible multi‑host support and structured audit logging.
How to use
Connect to the MCP server from an MCP client in your environment. You can run diagnostic tools against the local machine or target remote hosts using SSH. In a single session you can manage multiple hosts, and each tool call returns structured results for quick analysis.
Typical usage patterns include: running system information checks, listing and inspecting services, enumerating processes, querying logs, inspecting network status, and analyzing storage. You can scope each operation to a specific host by providing a host and username, or run purely local checks.
How to install
Prerequisites: you need Python 3.10 or higher and the uv package manager.
Install and run in development or testing environments using one of the supported runtimes.
uv run linux-mcp-server
uvx --from /path/to/linux-mcp-server linux-mcp-server
python -m linux_mcp_server
Configuration
Control access to log files via a whitelist of allowed paths to ensure safe reads. You can set environment variables to tailor log access, log level, and where logs are stored.
Key environment variables include: allowed log paths, log level, log directory, log retention, and SSH key path for remote connections.
# Comma-separated list of allowed log file paths
export LINUX_MCP_ALLOWED_LOG_PATHS="/var/log/messages,/var/log/secure,/var/log/audit/audit.log"
# Optional: Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
export LINUX_MCP_LOG_LEVEL="INFO"
# Optional: Custom log directory (default: ~/.local/share/linux-mcp-server/logs/)
export LINUX_MCP_LOG_DIR="/var/log/linux-mcp-server"
# Optional: Log retention in days (default: 10)
export LINUX_MCP_LOG_RETENTION_DAYS="30"
# Optional: Specify SSH private key path (defaults to ~/.ssh/id_ed25519, ~/.ssh/id_rsa, etc.)
export LINUX_MCP_SSH_KEY_PATH="/path/to/your/private/key"
Security considerations
All operations are read‑only to minimize impact on targets. Log access is whitelisted, and SSH uses key‑based authentication only. Host key verification can be disabled for flexibility, but use caution in untrusted networks.
Input validation is performed for all parameters, and remote users must have appropriate permissions for diagnostic commands.
Available tools
get_system_info
Retrieve OS version, kernel, hostname, and uptime.
get_cpu_info
Fetch CPU details and load averages.
get_memory_info
Report RAM usage and swap details.
get_disk_usage
Show filesystem usage and mount points.
get_hardware_info
Provide hardware details such as architecture and devices.
list_services
List all systemd services with their status.
get_service_status
Return detailed information for a specific service.
get_service_logs
Fetch recent logs for a specific service.
list_processes
List running processes with CPU/memory usage.
get_process_info
Show detailed information about a specific process.
get_journal_logs
Query systemd journal with filters.
get_audit_logs
Read audit logs if available.
read_log_file
Read a specific log file with whitelist enforcement.
get_network_interfaces
Display network interface information.
get_network_connections
Show active network connections.
get_listening_ports
List ports that are listening on the system.
list_block_devices
Enumerate block devices and partitions.
list_directories_by_size
List directories sorted by size with a top-N option.
list_directories_by_name
List directories sorted alphabetically.
list_directories_by_modified_date
List directories by modification date.