Back to Home
openSUSE icon

systemd-mcp

by openSUSE

Overview

Manages systemd services, units, and logs via the Model Context Protocol (MCP) by directly connecting to systemd's C API.

Installation

Run Command
go run systemd-mcp.go

Environment Variables

  • SYSTEMD_MCP_HTTP
  • SYSTEMD_MCP_LOGFILE
  • SYSTEMD_MCP_CONTROLLER
  • SYSTEMD_MCP_VERBOSE
  • SYSTEMD_MCP_DEBUG
  • SYSTEMD_MCP_LOG_JSON
  • SYSTEMD_MCP_LIST_TOOLS
  • SYSTEMD_MCP_ALLOW_WRITE
  • SYSTEMD_MCP_ALLOW_READ
  • SYSTEMD_MCP_ENABLED_TOOLS
  • SYSTEMD_MCP_TIMEOUT
  • SYSTEMD_MCP_NOAUTH

Security Notes

The server implements robust authorization mechanisms (Polkit/D-Bus and OAuth2) for managing systemd units and reading logs. However, two critical tools, 'get_file' and 'get_man_page', do not perform any authorization checks within their respective MCP handlers (or underlying functions). This means that if these tools are enabled, any authenticated (via Polkit or OAuth2) or unauthenticated (if '--noauth' is used) client can read arbitrary files and retrieve any man page on the system, subject only to the permissions of the user running the 'systemd-mcp' server. If the server is run with elevated privileges (e.g., as root for HTTP mode, as recommended by the README), this constitutes a severe arbitrary file read vulnerability. Command execution through 'man', 'rpm', and 'getfacl' is present, but arguments are passed via exec.Command, reducing direct shell injection risk, though potential vulnerabilities in these external tools could still be a concern. No obvious hardcoded secrets or obfuscation were found.

Similar Servers

Stats

Interest Score36
Security Score3
Cost ClassMedium
Avg Tokens1500
Stars7
Forks6
Last Update2026-01-16

Tags

systemdMCPD-BusPolkitOAuth2