OS

opensuse/systemd-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

11 stars 8 forks 품질 61 트렌드 22MIT

mcp 서버

개요

서버는 직접 C API를 통해 Systemd에 연결하므로 systemctl을 실행할 필요가 없습니다. make install 명령 install: * systemd-mcp to /usr/bin/systemd-mcp * gatekeeper to /usr/sbin/gatekeeper * 게이트키에 대한 Systemd 단위. 서비스 및 게이트키. 소켓 * Gatekeeper 정책 Stdio (default) 이상 실행할 때, systemd-mcp는 허가를 위한 polkit를 이용합니다. 프로세스는 현재 사용자로서 실행됩니다. * : org.freedesktop.systemd1.manage-units에 대한 polkit 요청을 트리거하거나 중지하는 것과 같은 작업. * : systemd-mcp는이 순서의 전체 저널을 엽니 다. * 루트 또는 디렉토리 /var/log/journal과 같은 그룹으로 실행하면 모든 저널 파일을 액세스 할 수 있습니다. * Else systemd-mcp는 /run/gatekeeper/gatekeeper.socket을 통해 게이트키에 연결합니다. com.suse.gatekeeper.readlog에 대한 polkit 요청이 트리거됩니다. * 이름 게이트키가 유용하지 않다면 현재 사용자 (예 : 자체 사용자 .journal 파일)에 의해 읽기 가능한 저널 파일 만 사용됩니다.

개요(AI 번역)

서버는 직접 C API를 통해 Systemd에 연결하므로 systemctl을 실행할 필요가 없습니다.

설치

직접 Compile

또는 제공된 Makefile을 사용:

설치하기

make install 명령 설치:

  • systemd-mcp에 /usr/bin/systemd-mcp]
  • gatekeeper에 /usr/sbin/gatekeeper]
  • gatekeeper.service 및 gatekeeper.socket의 Systemd 단위
  • Polkit 정책 gatekeeper

보안

Stdio 수송 (Polkit/DBus)

Stdio (default)를 실행할 때, systemd-mcp]는 polkit]]를 사용한다. 프로세스는 현재 사용자로서 실행됩니다.

  • Unit Management: 시작 또는 중지 단위와 같은 작업은 org.freedesktop.systemd1.manage-units]에 대한 polkit 요청을 트리거합니다. *Log Access: systemd-mcp] 이 순서의 전체 저널을 열지:
  • root 또는 같은 그룹에서 디렉토리 /var/log/journal]로 실행하면 모든 저널 파일이 액세스 할 수 있습니다.
  • Else systemd-mcp는 gatekeeper]]를 통해 /run/gatekeeper/gatekeeper.socket]에 연결합니다. 이것은 com.suse.gatekeeper.readlog에 대한 polkit 요청을 트리거합니다.
  • 문키퍼가 사용되지 않는 경우에, 현재 사용자 (예를들면 user- .journal] 파일)에 의해 읽기 쉬운 저널 파일 만 사용됩니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Model Context Protocol (MCP) for systemd

The server directly connects to systemd via its C API and so doesn’t need systemctl to run.

Installation

Compile directly with

  go build -o bin/systemd-mcp systemd-mcp.go
  go build -o bin/gatekeeper gatekeeper/main.go

or use the provided Makefile:

  make build

and install with

  sudo make install

The make install command installs:

  • systemd-mcp to /usr/bin/systemd-mcp
  • gatekeeper to /usr/sbin/gatekeeper
  • Systemd units for gatekeeper.service and gatekeeper.socket
  • Polkit policy for gatekeeper

Security

Stdio Transport (Polkit/DBus)

When running over Stdio (default), systemd-mcp uses polkit for authorization. The process runs as the current user.

  • Unit Management: Operations like starting or stopping units trigger a polkit request for org.freedesktop.systemd1.manage-units.

  • Log Access: systemd-mcp tries to open the whole journal in this order:

    • If running as root or in the same group as the directory /var/log/journal, all journal files are accessible.
    • Else systemd-mcp connects to the gatekeeper via /run/gatekeeper/gatekeeper.socket. This triggers a polkit request for com.suse.gatekeeper.readlog.
    • If the gatekeeper isn’t usable, only the journal files readable by the current user (e.g. its own user-.journal files) are used. The log output contains a hint about this reduced access.

    Read operations over the stdio transport are always authorized, as the calling user runs the server itself; only write operations still trigger a polkit request.

HTTP Transport (OAuth2)

When running over HTTP (using --http), systemd-mcp uses OAuth2 for authorization. You must specify an OAuth2 controller address using --controller.

  • OAuth2 Configuration:
    • Audience: systemd-mcp-server
    • Supported Scopes:
      • mcp:read: Allows read-only access (e.g., listing units, reading logs).
      • mcp:write: Allows write access (e.g., starting/stopping units).

If the HTTP server is started as root or in the journal group, it accesses the whole journal directly. Otherwise the gatekeeper is used for log access, provided gatekeeper.socket is available; if it isn’t, only the journal files readable by the current user are shown.

HTTP Transport with authentication

For debugging purposes, the --noauth flag can be used to access the MCP server without authentication. To ensure this is intentional, the flag must be set exactly to ThisIsInsecure.

Self-signed certificates

GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →