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 分

    请在仓库或注册中心条目中声明许可证。