Mcp Sudo

io.github.KamaruSama由 GitHub 帳號 KamaruSama 發布v1.0.1更新於 Oct 24, 2026

Run sudo commands with a Fernet-encrypted password bound to machine-id + user.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

讓助理在本機保存 sudo 密碼,並在不必重複輸入認證的情況下執行特權 shell 指令。

可以做什麼
提供四個工具:store_password 一次性快取 sudo 密碼,sudo_exec 以 sudo 執行 shell 指令,has_password 檢查是否已儲存密碼,clear_password 移除已儲存的密碼。密碼以 Fernet 加密,金鑰由 machine-id 與 USER 衍生,加密檔案存放在設定路徑下並設為 chmod 600。此伺服器鎖定單一使用者的 Linux 工作站。
適用情境
適用於單一使用者的 Linux 工作站,希望助理反覆執行特權指令而不必每次輸入 sudo 密碼的情境。它不是密鑰管理器,因此不適合共用機器或多使用者系統。
執行需求
需要本機 Python 執行環境(從 PyPI 安裝,README 中顯示 Python 3.12 以及 mcp 和 cryptography 套件),以及具備 machine-id 與 USER 值的 Linux 機器。它以本機 stdio 程序執行,僅限桌面端;未宣告需要 API 金鑰或遠端帳號。
安裝前請注意
它會把 sudo 密碼存放在磁碟上,並以由 machine-id 與 USER 衍生的金鑰加密;README 警告,若 machine-id 被複製到另一台機器,或其他使用者能讀取該 MCP 程序,密碼就可能被還原。sudo_exec 會執行任意特權 shell 指令,可能變更或刪除系統資料。應將其視為工作階段的便利工具,而非密鑰管理器。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Sudo,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-sudo

MCP server for running sudo commands with encrypted password storage.

Exposes 4 tools to persist a sudo password (encrypted with a machine-bound key) and invoke privileged commands without re-entering credentials. Designed for single-user Linux workstations.

📖 อ่านภาษาไทย →


Tools

ToolPurpose
store_passwordStore sudo password (encrypted, one-time)
sudo_execRun shell command with sudo
has_passwordCheck if password is stored
clear_passwordRemove stored password

Security model

  • Password is encrypted with Fernet (AES-128-CBC + HMAC-SHA256).
  • Encryption key is derived from machine-id + USER — never stored on disk.
  • Decryption only succeeds on the same machine with the same user.
  • Encrypted blob lives at ~/.config/claude-sudo-mcp/credential.enc (chmod 600).

This is not a secrets manager. Treat this as "remember my sudo password for this session on this box." If your machine-id is copied to another box or another user reads the MCP process, the password can be recovered.


Install

bash
cd /path/to/mcp-sudouv venv --python 3.12 .venvuv pip install --python .venv/bin/python mcp cryptography
claude mcp add sudo -s user -- \  /path/to/mcp-sudo/.venv/bin/python /path/to/mcp-sudo/server.py

On first use, call store_password once to cache credentials.


Support the project ❤


Contact


Copyright © 2026 likezara™. All rights reserved. Developed by Kamaru (pen name).

來源:README.md,提交 788e63b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。