cursor_admin_mcp
This server enables Cursor AI agents to execute privileged system commands with mandatory human approval before any privilege escalation occurs.
Run PowerShell commands as Administrator (Windows): The
run_as_admintool executes PowerShell commands with elevated privileges after the user approves via a WPF dialog and UAC prompt.Run bash commands as root (Linux/macOS): The
run_as_roottool executes bash commands as root after the user approves via azenity(Linux) orosascript(macOS) dialog and sudo authentication.Mandatory human approval gate: Every privileged execution requires explicit visual confirmation — the exact command is shown before elevation, and declining halts execution with no privilege escalation.
Capture and return output:
stdoutandstderrfrom executed commands are captured and returned to the agent for further processing.Platform safety enforcement: Each tool is restricted to its target OS — calling the wrong tool returns a clear error without any execution.
Temporary file isolation and cleanup: Commands are written to isolated temporary files that are automatically deleted after each invocation, minimizing security exposure.
Allows executing commands with root privileges on Linux systems using sudo and zenity approval dialog.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cursor_admin_mcp Install Python 3.12 using winget"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cursor_admin_mcp
Cross-platform secure MCP server for Cursor agents. Exposes elevated execution tools with mandatory human approval before privilege escalation:
Windows:
run_as_admin— PowerShell with WPF approval dialog and UACLinux / macOS:
run_as_root— bash with approval dialog andsudo
Requirements
All platforms
Node.js 20 or later
Windows (run_as_admin)
Windows 10 or later
Windows PowerShell 5.1 (default
powershellon Windows)WPF (
PresentationFramework) for the approval dialog
Linux (run_as_root)
bash
sudo(user must have sudo privileges)zenityfor approval and password dialogsDISPLAYorWAYLAND_DISPLAYset (GUI session required)
Install example (Debian/Ubuntu):
sudo apt install zenitymacOS (run_as_root)
bash
sudo(user must be an administrator)osascriptfor approval and password dialogs (built into macOS)GUI session required (osascript dialogs)
Related MCP server: cursor-mcp-server
Security model
Both tools follow the same pattern: payload isolation, visual approval, privilege escalation, log capture, cleanup.
Windows — run_as_admin
The agent sends a PowerShell command string.
The server writes the command to an isolated temporary
.ps1file.A wrapper script shows a WPF
MessageBoxwith the exact command payload.If the user clicks Yes, UAC prompts for elevation and the payload runs elevated.
If the user clicks No, execution stops and the tool returns
Execution denied by user.stdout/stderr are captured to a temporary log file and returned to the agent.
All temporary files are deleted after each invocation.
Linux — run_as_root
The agent sends a bash command string.
The server writes the command to an isolated temporary
.shfile.A wrapper script shows a zenity question dialog with the exact command payload.
If the user clicks Yes,
sudo -Aruns the payload using a temporarySUDO_ASKPASSscript (zenity --password).If the user clicks No, execution stops and the tool returns
Execution denied by user.stdout/stderr are captured to a temporary log file and returned to the agent.
All temporary files are deleted after each invocation.
macOS — run_as_root
The agent sends a bash command string.
The server writes the command to an isolated temporary
.shfile.A wrapper script shows an osascript dialog with the exact command payload.
If the user clicks Yes,
sudo -Aruns the payload using a temporarySUDO_ASKPASSscript (osascript hidden-password dialog).If the user clicks No, execution stops and the tool returns
Execution denied by user.stdout/stderr are captured to a temporary log file and returned to the agent.
All temporary files are deleted after each invocation.
The agent cannot bypass approval or elevation on any platform. Use the tool that matches the current OS.
Build and run
npm install
npm run build
npm startOther scripts:
npm run typecheck— TypeScript check without emitnpm test— run unit tests
Branching and releases
Branch | Purpose |
| Day-to-day development; open PRs here |
| Stable releases only; merge from |
Workflow:
Branch from
developfor features and fixes.Open pull requests targeting
develop. CI runs on every push and PR.When ready to ship, merge
developintomain(via PR or fast-forward merge).Each push to
mainruns the Release workflow: build, test, then create a GitHub release taggedv{version}frompackage.json.Bump
versioninpackage.jsonbefore merging tomainso each release gets a unique tag. If the tag already exists, the release job skips creation and logs a reminder to bump the version.
To start using develop:
git checkout -b develop
git push -u origin developSet develop as the default branch in GitHub repository settings if you want new PRs to target it by default.
Cursor MCP configuration
Add this server in Cursor → Settings → Features → MCP Servers (adjust the path if your clone location differs):
{
"mcpServers": {
"cursor-admin-mcp": {
"command": "node",
"args": ["C:\\dev\\repos\\others\\cursor_admin_mcp\\dist\\index.js"]
}
}
}On Linux and macOS, use the appropriate absolute path to dist/index.js.
After changing MCP settings, reload MCP servers in Cursor.
Manual smoke test
Windows
Build the project:
npm run buildRegister the MCP server in Cursor using the config above.
Ask the agent to call
run_as_adminwith:Write-Output "hello"Confirm the WPF dialog shows the exact command.
Click Yes, approve UAC, and verify output contains
hello.Run again and click No — verify the tool returns
Execution denied by user.without a UAC prompt.Confirm no leftover temp files remain under
%TEMP%.
Linux
Build the project:
npm run buildRegister the MCP server in Cursor.
Ask the agent to call
run_as_rootwith:echo "hello"Confirm the zenity dialog shows the exact command.
Click Yes, enter your sudo password in the zenity prompt, and verify output contains
hello.Run again and click No — verify the tool returns
Execution denied by user.without a sudo prompt.Confirm no leftover temp files remain under
/tmp.
macOS
Build the project:
npm run buildRegister the MCP server in Cursor.
Ask the agent to call
run_as_rootwith:echo "hello"Confirm the osascript dialog shows the exact command.
Click Yes, enter your administrator password in the osascript prompt, and verify output contains
hello.Run again and click No — verify the tool returns
Execution denied by user.without a sudo prompt.Confirm no leftover temp files remain under
$TMPDIR.
Calling run_as_admin on Linux or macOS, or run_as_root on Windows, returns a clear platform error without elevation.
SDK note
This project uses @modelcontextprotocol/server@2.0.0-alpha.2 (MCP TypeScript SDK v2 alpha). The v2 API may change before stable release.
License
MIT — see LICENSE.
Available Tools
2 toolsrun_as_adminA
Windows only. Executes a PowerShell command with Administrator privileges after visual user approval.
Inputs: command (required).
run_as_rootB
Linux and macOS. Executes a bash command as root after visual user approval and sudo authentication.
Inputs: command (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools are clearly distinguished by target platform: run_as_admin for Windows and run_as_root for Linux/macOS. There is no overlap or ambiguity in their purposes.
Both tools follow a consistent 'run_as_<privilege>' naming pattern. The verb 'run' and the privilege level are clearly indicated, making the pattern predictable.
The server has exactly two tools, covering elevated command execution on all major OS platforms. While minimal, the count is appropriate for the narrow domain of admin command execution.
The tool set covers the entire domain of running commands with elevated privileges across all supported OS platforms (Windows, Linux, macOS). No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.9104 npm23MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server wrapping the Cursor CLI agent, enabling Claude Code and other MCP clients to delegate tasks to Cursor's AI agent for file writing, bash commands, and codebase queries.-
- FlicenseAqualityBmaintenanceCross-platform MCP server for policy-controlled command execution on Linux and Windows, with no SSH dependency.3-
- AlicenseBqualityDmaintenanceA fast, hardened MCP server that lets any MCP host drive the Cursor Agent CLI for heavy repo-aware tasks like search, analysis, planning, and edits, keeping host context small and token costs low.101MIT