# gerard-kanters/mcp-linux-tools [Health: Active]

**Category:** 🖥️ OS Automation  
**Repository:** https://github.com/gerard-kanters/mcp-linux-tools  
**GitHub Stars:** 2  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gerard-kanters-mcp-linux-tools

## Description
Administer a Linux server from an MCP client such as Cursor or VS Code: read files and tail logs, check/reload/restart systemd services, manage cron jobs inside a dedicated crontab section, run read-only MySQL queries, drive WP-CLI on WordPress sites, run safe Git commands, and execute sandboxed Python. Directories, services and WordPress sites are allowlisted in config.json, and every tool returns a uniform {success, data, error, meta} response. Runs as a systemd service over HTTP.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/gerard-kanters/mcp-linux-tools), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
sudo mkdir -p /opt
```

2. Install:

```sh
cd /opt
```

3. Install:

```sh
sudo git clone https://github.com/gerard-kanters/mcp-linux-tools.git mcp
```

4. Install:

```sh
cd /opt/mcp
```

5. Install:

```sh
sudo python3.13 -m venv /opt/mcp/venv
```

6. Install:

```sh
sudo /opt/mcp/venv/bin/pip install --upgrade pip
```

## Documentation

## What gerard-kanters/mcp-linux-tools MCP server does

gerard-kanters/mcp-linux-tools is an MCP server for controlled administration of a Linux machine. It exposes operational actions to an MCP client through HTTP while applying allowlists and command restrictions. The available areas include filesystem inspection, log access, systemd service checks and restarts, cron management, WordPress operations, read-only MySQL queries, connectivity checks, safe Git commands, and sandboxed Python execution.

The server is intended for hosts running systemd. Its configuration identifies the host, sets the HTTP listener, defines file and log boundaries, limits read sizes and directory listing counts, and specifies manageable services and WordPress roots. Each tool returns a common object containing success, data, error, and meta fields, which gives clients a predictable way to handle results.

## How it works

The gerard-kanters/mcp-linux-tools MCP server starts from server.py, loads and validates config.json, registers the tool modules, and serves MCP requests over HTTP. The documented endpoint uses port 8765 by default and can be bound to a configured address and port. It is normally installed as a systemd unit that runs the Python application and restarts it after failure.

Security decisions are made before operations run. File paths are checked against separate read, log, and write allowlists. Service actions are limited to names in the configured service whitelist. WordPress commands are restricted to configured site roots, and cron changes are confined to the section managed by the MCP server. Python runs in a sandbox with network access disabled and an eight-second timeout.

## Setup and configuration

Installation requires Python 3.13 or newer, Linux with systemd, and root access for the documented service and crontab setup. The repository can be placed under /opt/mcp, where a virtual environment is created and requirements.txt is installed. A sandbox directory is also created before the systemd unit is enabled and started.

Edit /opt/mcp/config.json before starting the service. Required identification settings include server_type, server_ip, and server_name. Other sections configure the HTTP listener, logging, file-size and item limits, the Python interpreter and sandbox working directory, directory allowlists, service names, and WordPress executable and log locations. Restart the systemd unit after changing configuration.

## Tools and capabilities

The gerard-kanters/mcp-linux-tools MCP server groups its tools into these supported operations:

- Discover server details, the active service whitelist, and allowed WordPress sites.
- Read files, list directories, and inspect the beginning or end of log files in approved locations.
- Check, reload, or restart approved systemd services. The security notes exclude arbitrary stop, start, and enable operations.
- List, add, remove, or toggle cron jobs within the MCP-managed crontab area.
- Run WP-CLI against approved WordPress installations, including cache flushing, plugin and user listing, and WordPress log tailing.
- Submit read-only MySQL queries, with dangerous query patterns blocked.
- Execute Python in the configured sandbox without network access and with an eight-second limit.
- Ping hosts for connectivity checks and run restricted Git commands without push or force operations.

## Limitations and notes

Access is not a general-purpose shell. Arbitrary directories are denied, and the effective paths and services depend on config.json rather than on the client request alone. The documented default read and log locations are examples of configurable allowlists, so deployments should verify the active configuration before relying on them.

The service runs as root in the supplied systemd example, but the tool policy still blocks sudo or root operations requested through the tools. File reads have a configurable maximum size, directory listings have an item limit, and Python cannot use the network. Configuration changes take effect after the service is restarted. The server communicates over HTTP, so deployment teams should account for how that endpoint is exposed to MCP clients.

_Full upstream README: https://allmcps.com/mcp/gerard-kanters-mcp-linux-tools/readme_

