Skip to main content
Glama
KamaruSama

mcp-sudo

by KamaruSama

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

Tool

Purpose

store_password

Store sudo password (encrypted, one-time)

sudo_exec

Run shell command with sudo

has_password

Check if password is stored

clear_password

Remove stored password


Related MCP server: cursor_admin_mcp

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

cd /path/to/mcp-sudo
uv venv --python 3.12 .venv
uv 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).

Available Tools

4 tools
clear_passwordB

Remove the stored sudo password.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only says 'remove' without disclosing side effects, safety implications, or what happens if no password is stored. The agent cannot assess behavioral impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that is concise and to the point. However, it could be slightly expanded to include behavioral context without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity and presence of an output schema, the description is overly minimal. It lacks context on the tool's effect on system state, error conditions, and security implications, which are important for a password management tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters, and the input schema is fully covered (100%). The description does not add parameter info because none exist, meeting the baseline of 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Remove the stored sudo password' clearly states the verb (remove) and the resource (stored sudo password), distinguishing it from siblings like has_password (check) and store_password (set).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. For example, it does not mention prerequisites like whether a password must exist, or that it should be called before storing a new password.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

has_passwordA

Check if a sudo password is already stored.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears the full burden. It states it checks if a password is stored, which is a simple read operation. However, it does not explicitly confirm no side effects or mention any preconditions, so it is adequate but not detailed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that conveys the purpose efficiently with no unnecessary words. It is front-loaded and earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (zero parameters, an output schema exists), the description is complete enough. It tells an agent everything needed to understand the tool's role.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, and schema_description_coverage is 100% (trivially). With zero parameters, the baseline is 4; the description does not need to add parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Check' and the resource 'sudo password', and it distinguishes itself from siblings like 'clear_password', 'store_password', and 'sudo_exec' by focusing on checking existence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings (e.g., after storing a password, before executing with sudo). There is no mention of prerequisites or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

store_passwordC

Store sudo password encrypted. Only needs to be done once.

ParametersJSON Schema
NameRequiredDescriptionDefault
passwordYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses encryption and one-time nature, but fails to explain behavior on repeated calls (overwrite?), required permissions, side effects, or security guarantees. For a sensitive operation, more detail is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences are concise, but the description is under-specified for a security tool. The structure is adequate, but could include more details without exceeding reasonable length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of sibling tools and output schema, the description lacks completeness. It does not explain what the tool returns, error conditions, or how it fits into the sudo workflow (e.g., required before sudo_exec). A more complete description would link to siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description adds no meaning to the 'password' parameter beyond the schema's type and requirement. No constraints, format, or security hints are provided, leaving the agent without guidance on valid input.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Store sudo password encrypted', specifying the verb and resource. It distinguishes from siblings like 'clear_password', 'has_password', and 'sudo_exec' by implying a setup action, though not explicitly contrasting them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Only mentions 'Only needs to be done once', which hints at a one-time setup but provides no explicit guidance on when to use this tool versus alternatives like 'has_password' (to check existence) or 'sudo_exec' (to use the password). No prerequisites or conditions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sudo_execA

Execute a command with sudo using the stored password.

Args: command: The shell command to run with sudo. timeout: Timeout in seconds (default 120).

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYes
timeoutNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states that the command runs with sudo, but does not disclose side effects (e.g., elevated privileges, potential system changes), failure modes (e.g., timeout, permission errors), or dependencies (e.g., stored password existence). More detail is needed for safe usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise: two sentences plus a structured Args list. Every line serves a purpose. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (sudo execution) and the presence of an output schema (but not described), the description is minimally adequate. It lacks context about prerequisites (password must be stored), error behavior, and security implications. However, it covers the basic purpose and parameters. More detail would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: 'command' is a shell command string, and 'timeout' is an integer defaulting to 120 seconds. This adds clear meaning beyond the schema's property names and types. However, it could be more specific (e.g., timeout is in seconds, not milliseconds).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a command with sudo using the stored password. It uses a specific verb 'execute' and identifies the resource as a command with sudo. This distinguishes it from sibling tools that manage passwords (clear_password, has_password, store_password).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., password must be stored) or situations where a different tool (like a non-sudo command executor) should be used. Sibling tools are about password management, so usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: storing, checking, clearing password, and executing commands. No overlap or ambiguity between tools.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (store_password, has_password, clear_password, sudo_exec) with snake_case. The naming is predictable and clear.

Tool Count5/5

With 4 tools covering password management and sudo execution, the number is perfectly scoped for the domain. Each tool serves a necessary function without redundancy.

Completeness4/5

The tool set covers the essential password lifecycle and command execution. A minor gap is the lack of an explicit update tool, but store_password likely allows overwriting.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.
    9
    117
    20
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A cross-platform MCP server providing secure, user-approved privilege escalation for Cursor agents, with tools for running commands as admin on Windows and root on Linux.
    2
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server for SSH/SCP operations with passwordless authentication, enabling remote command execution, file transfer, and session management.
    19
    9
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KamaruSama/mcp-sudo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server