Skip to main content
Glama

host-inspector-mcp

An MCP server (stdio) that lets an AI assistant inspect a Linux host safely: what is using the CPU, which disk is filling up, why a service failed, what the journal says. It replaces "run this shell command for me" with a small set of typed, bounded, mostly read-only tools.

Built on the mcp 2.x Python SDK and psutil. Python >= 3.12.

Tools

Tool

What it does

Access

system_overview

OS, kernel, CPU, memory, swap, load, uptime, mounted disks

read-only

hardware_sensors

temperatures, fans, battery where the kernel exposes them

read-only

top_processes

heaviest processes by CPU or memory

read-only

process_details

one PID: command, parent, children, open files, sockets

read-only

disk_usage

du -d1-style breakdown of a directory

read-only

find_large_files

biggest files under a path (one filesystem, symlinks not followed)

read-only

network_status

interfaces, default route, DNS, listening ports

read-only

check_connectivity

DNS + TCP connect latency to host:port

read-only (network)

service_status

one systemd unit, or all failed and running units

read-only

journal_logs

journalctl filtered by unit, time, priority, regex, boot

read-only

package_updates

pending apt/snap updates and reboot-required

read-only

package_info

apt policy and description, or a name search

read-only

tool_inventory

which developer CLIs are installed, with versions

read-only

kill_process

signal a process you own

the only mutating tool; annotated destructive

Related MCP server: System Control MCP Server

Safety design

The server is the permission boundary between a language model and a machine, so the boundaries are explicit and tested (tests/test_tools.py):

  • No shell, ever. Every external command goes through one helper, _run(argv), which uses subprocess.run with a list. A test passes "a; echo b" and checks it arrives as a literal argument.

  • Bounded. Every command has a timeout (a test proves a hung command is reported, not waited on). Output lists are capped (limit, top_n, first 50 files or sockets, and so on) so a call cannot flood the model's context.

  • Unprivileged. It runs as the invoking user. When a process belongs to someone else, process_details returns a note instead of an error, and kill_process refuses.

  • One mutating tool, with guard rails. kill_process refuses PID 0, PID 1 and the server itself, refuses processes owned by other users, and only accepts TERM, KILL, INT or HUP (a typed Literal).

  • Honest MCP annotations. Read-only tools carry readOnlyHint; only kill_process carries destructiveHint; check_connectivity is marked open-world because it touches the network. A client can therefore auto-approve the first group and prompt for the last.

  • Robust walkers. find_large_files stays on one filesystem, skips symlinked directories (a test proves nothing is counted twice) and ignores unreadable directories rather than failing.

  • Portable. Missing tools (for example no journalctl in a container) produce a readable error: ... is not installed string instead of a stack trace.

Run it

pip install .
# register with your MCP client: command = host-inspector-mcp, transport = stdio
HOST_INSPECTOR_NAME=build-box HOST_INSPECTOR_INSTRUCTIONS="CI runner, Debian 12" host-inspector-mcp

The two environment variables let the same package describe itself correctly when it is launched on different hosts (for example over ssh host host-inspector-mcp).

Tests

PYTHONPATH=src python -m unittest discover -s tests     # 14 tests, including a real MCP handshake over stdio

The last test launches the server as a subprocess, lists its tools through the official MCP client and calls kill_process on PID 1 to prove the refusal travels over the protocol.

Available Tools

14 tools
check_connectivityA
Read-only

Test DNS resolution and a TCP connect to host:port, reporting latency.

Inputs: host, port, timeout_s.

disk_usageA
Read-only

Size of each immediate child of a directory (like du -d1), largest first.

Inputs: path, top_n.

find_large_filesB
Read-only

Find the largest files under a path (stays on one filesystem, skips unreadable dirs).

Inputs: path, limit, min_size_mb. Returns: result

hardware_sensorsA
Read-only

Temperatures (CPU/NVMe/etc.), fan speeds and battery, where the kernel exposes them.

Inputs: no named parameters.

journal_logsA
Read-only

Read systemd journal entries, filtered by unit, time window, priority, boot and regex. Note: system-wide logs need the user to be in the adm group (they are).

Inputs: boot, grep, unit, lines, +2 more. Returns: result

kill_processA
Destructive

Send a signal to a process owned by the current user (default SIGTERM). Refuses PID 1 and this server.

Inputs: pid (required), signal. Returns: result

network_statusA
Read-only

Network interfaces with addresses/link state, default route, DNS servers and listening ports.

Inputs: no named parameters.

package_infoA
Read-only

Whether an apt package is installed, its version, candidate version and description; falls back to searching package names if it isn't an exact match.

Inputs: name (required). Returns: result

package_updatesA
Read-only

Pending apt and snap updates, and whether a reboot is required. (Does not refresh indexes.)

Inputs: no named parameters.

process_detailsB
Read-only

Detailed info on one process: command, parent, status, threads, open files and connections.

Inputs: pid (required).

service_statusA
Read-only

Status of one systemd unit (e.g. 'ssh', 'docker'), or with no unit, list failed units plus running services. Set user=True for the user's own systemd instance.

Inputs: unit, user. Returns: result

system_overviewA
Read-only

Snapshot of the machine: OS, kernel, CPU, memory, swap, load, uptime and mounted disks.

Inputs: no named parameters.

tool_inventoryB
Read-only

Which common developer/admin CLI tools are on PATH, with versions.

Inputs: no named parameters.

top_processesA
Read-only

List the heaviest processes by CPU% (sampled over ~0.5s) or resident memory.

Inputs: limit, sort_by. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools map to a distinct inspection target (processes, disk, network, services, logs, packages, hardware), and boundary cases like process_details vs top_processes vs kill_process are clearly differentiated. A couple of pairs are close — disk_usage vs find_large_files and package_info vs package_updates — but the descriptions make the distinction workable.

    Naming Consistency4/5

    All names are predictable snake_case with no style mixing. There is a mild split between verb-led action names (kill_process, find_large_files, check_connectivity) and noun-phrase inspection names (system_overview, network_status), but the pattern is readable and arguably intentional.

    Tool Count5/5

    Fourteen tools is squarely in the sweet spot for a host diagnostics server, and each one covers a distinct slice of system state (CPU, memory, disk, network, services, logs, packages, hardware). No obvious filler tools.

    Completeness4/5

    Coverage of the host-inspection domain is broad: process lifecycle, disk usage, connectivity, systemd/journal, packages, hardware sensors, and system snapshot are all present. Minor gaps exist around scheduling/cron inspection, dmesg/kernel messages, and user/group queries, but nothing that blocks core diagnostic workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables natural-language diagnosis of Linux system issues by providing sandboxed, typed tools for system, service, filesystem, and git inspection, with human approval for mutating actions.
      18
      -
    • A
      license
      A
      quality
      B
      maintenance
      Lets an AI assistant inspect a Linux machine through ten fixed read-only tools covering load, memory, disks, processes, ports, interfaces, systemd units, the journal, and allowlisted log files. All output is size-capped, control-character-stripped and secret-redacted, and nothing in the package can write to the system.
      10
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Gives AI agents safe, bounded, non-blocking access to Linux sysadmin inspection tasks, including CPU, RAM and disk healthchecks, memory-safe log tailing with regex filtering, and user-level systemd service and timer auditing. All operations run without sudo or unrestricted root shells, avoiding interactive pager hangs and context window flooding.
      4
      132 PyPI
      1
      MIT