This directory contains example MCP configuration files for different AI coding tools.
Location: ~/.config/Claude/claude_desktop_config.json (Linux/macOS)
Location: %APPDATA%\Claude\claude_desktop_config.json (Windows)
Copy the contents of claude-desktop-config.json to your Claude Desktop configuration file.
Available configurations:
sudo-mcp- Standard configuration using installed binarysudo-mcp-custom- Custom blocklist and timeout settingssudo-mcp-no-blocklist- DANGEROUS: Disables all command validation
Location: ~/.config/claude/mcp.json (Linux)
Location: ~/Library/Application Support/Claude/mcp.json (macOS)
Location: %APPDATA%\Claude\mcp.json (Windows)
Copy the contents of claude-code-config.json to your Claude Code configuration file.
Available configurations:
sudo-mcp- Standard configuration using installed binarysudo-mcp-custom- Custom blocklist and timeout settingssudo-mcp-no-blocklist- DANGEROUS: Disables all command validation
Location: Project-specific .cursor/mcp.json or global Cursor settings
Copy the contents of cursor-config.json to your Cursor MCP configuration.
Available configurations:
sudo-mcp- Standard configuration using installed binarysudo-mcp-project-specific- Project-specific configuration using workspace variablessudo-mcp-no-blocklist- DANGEROUS: Disables all command validation
-
Install sudo-mcp using the installation script:
git clone https://github.com/hughesjs/sudo-mcp.git cd sudo-mcp chmod +x scripts/install.sh ./scripts/install.sh -
Copy the appropriate configuration file to your MCP client's configuration location
-
Update
YOUR_USERNAMEin paths if using custom configurations -
Restart your AI coding tool to load the MCP server
-
Test the connection by asking: "Can you list the available MCP tools?"
All configurations support these command-line options:
| Option | Alias | Description | Default |
|---|---|---|---|
--blocklist-file <path> |
-b |
Path to custom blocklist JSON file | Embedded default |
--no-blocklist |
DANGEROUS: Disable all validation | false |
|
--audit-log <path> |
-a |
Path to audit log file | /var/log/sudo-mcp/audit.log |
--timeout <seconds> |
-t |
Default command timeout | 15 |
Use the default sudo-mcp configuration with the standard blocklist:
{
"mcpServers": {
"sudo-mcp": {
"command": "/usr/bin/sudo-mcp"
}
}
}Use sudo-mcp-custom with a relaxed blocklist and longer timeout:
{
"mcpServers": {
"sudo-mcp": {
"command": "/usr/bin/sudo-mcp",
"args": [
"--blocklist-file",
"/path/to/permissive-blocklist.json",
"--timeout",
"60"
]
}
}
}Use sudo-mcp-no-blocklist ONLY in isolated test environments:
{
"mcpServers": {
"sudo-mcp": {
"command": "/usr/bin/sudo-mcp",
"args": ["--no-blocklist"]
}
}
}- Check the MCP configuration file location for your tool
- Verify the project path is correct and absolute
- Check logs in stderr for error messages
- Ensure .NET 10 SDK is installed:
dotnet --version
- Verify pkexec is installed:
which pkexec - Ensure a polkit authentication agent is running (required for GUI auth)
- Check polkit policies:
pkaction --action-id org.freedesktop.policykit.exec
- Check the audit log for denial reasons:
/var/log/sudo-mcp/audit.log - The default blocklist is embedded in the binary
- Create a custom blocklist JSON file with more permissive patterns and use
--blocklist-file - Last resort: Use
--no-blocklistin an isolated environment
- Increase the global timeout:
--timeout 60 - Ask the AI to pass a longer timeout in the tool request
- Check if the command is hanging (requires user input, etc.)
Once configured, try these prompts with your AI coding tool:
- "What user am I running as?" (executes
whoami) - "Show me the system uptime" (executes
uptime) - "List running services" (executes
systemctl list-units --type=service)
- "Delete everything in the root directory" (should block
rm -rf /) - "Format my hard drive" (should block
mkfscommands)
- "Run a system update with a 5 minute timeout" (AI should pass
timeoutSeconds: 300)
For issues, questions, or security concerns, see the main README.md and SECURITY.md.