Skip to main content
Glama
PainInTheNic

ubuntu-mcp-server

by PainInTheNic

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
UBUNTU_MCP_HOST_KEYSNoPath to the host keys store file (default is '.host-keys.json' next to servers.json).
UBUNTU_MCP_KEY_PASSPHRASENoPassphrase for the SSH private key, if the key has one and is not loaded in ssh-agent.
UBUNTU_MCP_HOST_KEY_CHECKINGNoHost key verification policy: 'tofu' (default) trust-on-first-use, 'strict' refuse unknown hosts, 'off' accept any host key.tofu

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
ubuntu_list_serversA

List all Ubuntu servers configured in the inventory (servers.json), with their connection details.

Call this first to discover valid values for the 'server' parameter used by every other ubuntu_* tool.

Args:

  • response_format ('markdown' | 'json'): output format (default 'markdown')

Returns: name, host, port, username and description for each configured server. Does not contact the servers, so a listed server is not necessarily reachable right now.

ubuntu_system_overviewA

Get a one-shot health overview of an Ubuntu server: hostname, OS release, kernel, uptime, load average, memory usage, disk usage, whether a reboot is required, and any failed systemd services.

This is the best first call when asked "how is server X doing?" — it gathers everything in a single SSH round trip.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • response_format ('markdown' | 'json'): output format (default 'markdown')

Returns: the sections listed above; memory and disk are the raw 'free -h' / 'df -h' tables.

ubuntu_list_servicesA

List systemd services on an Ubuntu server, optionally filtered by state.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • state ('all' | 'running' | 'failed'): filter (default 'all')

  • limit (number): max services to return, 1-200 (default 50)

  • offset (number): skip this many for pagination (default 0)

  • response_format ('markdown' | 'json'): output format (default 'markdown')

Returns: unit name, active/sub state, and description per service, with pagination metadata (total, has_more, next_offset).

Example: state='failed' answers "is anything broken on web-01?"

ubuntu_service_statusA

Show detailed status of one systemd service: the full 'systemctl status' output (state, recent log lines, PID, memory) plus whether it is enabled at boot.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • service (string): unit name, e.g. 'nginx' or 'ssh'

Returns: raw status text plus parsed active_state ('active'/'inactive'/'failed') and enabled state ('enabled'/'disabled'/'static').

Error handling: reports if the unit does not exist and suggests ubuntu_list_services to find the right name.

ubuntu_manage_serviceA

Start, stop, restart, reload, enable, or disable a systemd service. Runs via 'sudo -n', so the server must allow passwordless sudo for the configured user.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • service (string): unit name, e.g. 'nginx'

  • action ('start' | 'stop' | 'restart' | 'reload' | 'enable' | 'disable'): what to do

Returns: confirmation plus the service's state after the action.

Error handling: if sudo requires a password the error explains how to configure passwordless sudo. 'reload' fails for services that don't support it — use 'restart' instead.

ubuntu_check_updatesA

List pending apt package updates on an Ubuntu server, flag security updates, and report whether a reboot is required. Does NOT install anything.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • refresh_cache (boolean): run 'apt-get update' first via sudo -n for current results (default false)

  • limit (number): max packages to list, 1-200 (default 50)

  • response_format ('markdown' | 'json'): output format (default 'markdown')

Returns: total pending updates, security update count, reboot-required flag, and per-package old → new versions.

To actually install updates, use ubuntu_run_command with sudo, e.g. command='apt-get upgrade -y' sudo=true — after confirming with the user.

ubuntu_tail_logA

Read recent log lines from an Ubuntu server — either from the systemd journal (journalctl) or from a log file — optionally filtered to lines containing a search string.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • source ('journal' | 'file'): where to read from (default 'journal')

  • unit (string, journal only): systemd unit, e.g. 'nginx' — omit for the whole journal

  • path (string, file only, required): absolute file path, e.g. '/var/log/syslog'

  • lines (number): how many recent lines, 1-1000 (default 100)

  • since (string, journal only): time filter like '1 hour ago' or 'today'

  • grep (string): only lines containing this text (case-insensitive fixed string)

  • use_sudo (boolean): read as root for protected logs (default false)

Returns: the matching log lines as plain text.

Error handling: permission errors suggest use_sudo=true or adding the user to the 'adm'/'systemd-journal' groups.

Examples:

  • "errors in nginx logs in the last hour" -> source='journal', unit='nginx', since='1 hour ago', grep='error'

  • "last 50 lines of /var/log/auth.log" -> source='file', path='/var/log/auth.log', lines=50

ubuntu_run_commandA

Run an arbitrary shell command on a configured Ubuntu server over SSH and return stdout, stderr, and the exit code.

Prefer the specialized tools when they fit (ubuntu_system_overview, ubuntu_list_services, ubuntu_service_status, ubuntu_check_updates, ubuntu_tail_log) — they produce cleaner output. Use this tool for everything they don't cover.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • command (string): shell command line; pipes and redirects work

  • sudo (boolean): run as root via 'sudo -n' — requires passwordless sudo on the server (default false)

  • timeout_seconds (number): 1-300, default 30

Returns: exit code plus stdout/stderr text, also available as structured content.

Error handling:

  • Unknown server names return the list of valid names.

  • A non-zero exit code is NOT a tool error — inspect stderr to understand what the command reported.

  • If sudo fails with "a password is required", the server lacks passwordless sudo; the output includes the fix.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PainInTheNic/MCP-Ubuntu'

If you have feedback or need assistance with the MCP directory API, please join our Discord server