
opensuse/systemd-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
システム化された mcp サーバー
概要
サーバは、C API 経由でシステムに直接接続するので、実行にはsystemctl を必要としません。 make install コマンドをインストールします。 * systemd-mcp を /usr/bin/systemd-mcp * gatekeeper から /usr/sbin/gatekeeper * ゲートキーパー用のシステム単位です。 サービスおよびゲートキーパー。 ソケット * ゲートキーパーのためのPolkitポリシー Stdio (デフォルト) で実行すると、systemd-mcp は polkit を使って承認します。 プロセスは、現在のユーザーとして実行されます。 * : ユニットの起動や停止などの操作は、org.freedesktop.systemd1.manage-units の polkit リクエストをトリガーします。 * : systemd-mcp は、この順番でジャーナル全体を開きます: * root またはディレクトリ /var/log/journal と同じグループで実行すると、すべてのジャーナルファイルがアクセス可能です。 * エルスは/run/gatekeeper/gatekeeper.socketを介してゲートキーパーに接続します。 これは com.suse.gatekeeper.readlog の polkit リクエストをトリガーします。 * 必須 ゲートキーパーが利用できない場合は、現在のユーザー(独自のユーザー- .journal files)が読みやすいジャーナルファイルのみが使用されます.
概要(AI 翻訳)
サーバは、C API 経由でシステムに直接接続するので、実行にはsystemctl を必要としません。
インストール
直接コンパイル
または提供された Makefile を使用する:
そして取付けて下さい
[make install] コマンドをインストールします。
※systemd-mcpから[[T2]へ
※[gatekeeper→/usr/sbin/gatekeeper
※[gatekeeper.serviceと[[[T6]のシステムユニット]
*Polkitポリシー [[T7]
セキュリティ
Stdio トランスポート (Polkit/DBus)
Stdio (デフォルト) で実行する場合、 [systemd-mcp]] は polkit を使用して承認します。 プロセスは、現在のユーザーとして実行されます。
*ユニット管理:ユニットの起動や停止などの操作は、[[org.freedesktop.systemd1.manage-units]のpolkitリクエストをトリガーします。
*Log Access:[systemd-mcp]は、この順にジャーナル全体を開きます。
※ root または同じグループでディレクトリ [/var/log/journal] と同じグループで実行すると、すべてのジャーナルファイルがアクセス可能です。
※[systemd-mcp]は[gatekeeper]]]から接続します。 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-mcpto/usr/bin/systemd-mcpgatekeeperto/usr/sbin/gatekeeper- Systemd units for
gatekeeper.serviceandgatekeeper.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-mcptries 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-mcpconnects to thegatekeepervia/run/gatekeeper/gatekeeper.socket. This triggers a polkit request forcom.suse.gatekeeper.readlog. - If the gatekeeper isn’t usable, only the journal files readable by the current user (e.g. its own
user-.journalfiles) 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.
- If running as root or in the same group as the directory
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).
- Audience:
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
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →