Skip to main content
Glama
Jon2G

cursor_admin_mcp

by Jon2G

cursor_admin_mcp

cursor_admin_mcp MCP server

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 UAC

  • Linux / macOS: run_as_root — bash with approval dialog and sudo

Requirements

All platforms

  • Node.js 20 or later

Windows (run_as_admin)

  • Windows 10 or later

  • Windows PowerShell 5.1 (default powershell on Windows)

  • WPF (PresentationFramework) for the approval dialog

Linux (run_as_root)

  • bash

  • sudo (user must have sudo privileges)

  • zenity for approval and password dialogs

  • DISPLAY or WAYLAND_DISPLAY set (GUI session required)

Install example (Debian/Ubuntu):

sudo apt install zenity

macOS (run_as_root)

  • bash

  • sudo (user must be an administrator)

  • osascript for 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

  1. The agent sends a PowerShell command string.

  2. The server writes the command to an isolated temporary .ps1 file.

  3. A wrapper script shows a WPF MessageBox with the exact command payload.

  4. If the user clicks Yes, UAC prompts for elevation and the payload runs elevated.

  5. If the user clicks No, execution stops and the tool returns Execution denied by user.

  6. stdout/stderr are captured to a temporary log file and returned to the agent.

  7. All temporary files are deleted after each invocation.

Linux — run_as_root

  1. The agent sends a bash command string.

  2. The server writes the command to an isolated temporary .sh file.

  3. A wrapper script shows a zenity question dialog with the exact command payload.

  4. If the user clicks Yes, sudo -A runs the payload using a temporary SUDO_ASKPASS script (zenity --password).

  5. If the user clicks No, execution stops and the tool returns Execution denied by user.

  6. stdout/stderr are captured to a temporary log file and returned to the agent.

  7. All temporary files are deleted after each invocation.

macOS — run_as_root

  1. The agent sends a bash command string.

  2. The server writes the command to an isolated temporary .sh file.

  3. A wrapper script shows an osascript dialog with the exact command payload.

  4. If the user clicks Yes, sudo -A runs the payload using a temporary SUDO_ASKPASS script (osascript hidden-password dialog).

  5. If the user clicks No, execution stops and the tool returns Execution denied by user.

  6. stdout/stderr are captured to a temporary log file and returned to the agent.

  7. 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 start

Other scripts:

  • npm run typecheck — TypeScript check without emit

  • npm test — run unit tests

Branching and releases

Branch

Purpose

develop

Day-to-day development; open PRs here

main

Stable releases only; merge from develop when ready

Workflow:

  1. Branch from develop for features and fixes.

  2. Open pull requests targeting develop. CI runs on every push and PR.

  3. When ready to ship, merge develop into main (via PR or fast-forward merge).

  4. Each push to main runs the Release workflow: build, test, then create a GitHub release tagged v{version} from package.json.

  5. Bump version in package.json before merging to main so 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 develop

Set 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

  1. Build the project: npm run build

  2. Register the MCP server in Cursor using the config above.

  3. Ask the agent to call run_as_admin with: Write-Output "hello"

  4. Confirm the WPF dialog shows the exact command.

  5. Click Yes, approve UAC, and verify output contains hello.

  6. Run again and click No — verify the tool returns Execution denied by user. without a UAC prompt.

  7. Confirm no leftover temp files remain under %TEMP%.

Linux

  1. Build the project: npm run build

  2. Register the MCP server in Cursor.

  3. Ask the agent to call run_as_root with: echo "hello"

  4. Confirm the zenity dialog shows the exact command.

  5. Click Yes, enter your sudo password in the zenity prompt, and verify output contains hello.

  6. Run again and click No — verify the tool returns Execution denied by user. without a sudo prompt.

  7. Confirm no leftover temp files remain under /tmp.

macOS

  1. Build the project: npm run build

  2. Register the MCP server in Cursor.

  3. Ask the agent to call run_as_root with: echo "hello"

  4. Confirm the osascript dialog shows the exact command.

  5. Click Yes, enter your administrator password in the osascript prompt, and verify output contains hello.

  6. Run again and click No — verify the tool returns Execution denied by user. without a sudo prompt.

  7. 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 tools
run_as_adminA

Windows only. Executes a PowerShell command with Administrator privileges after visual user approval.

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesPowerShell command or script to execute.

TDQS

A3.7/5.0
Behavior3/5

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

Discloses platform restriction, admin privilege requirement, and user approval step. However, with no annotations provided, the description does not cover failure behaviors, return value, or execution model (synchronous/asynchronous), which are relevant for a mutation tool.

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?

Single sentence, front-loaded with key constraint (Windows only), no redundant information. Every word adds value.

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?

For a single-parameter tool with no annotations and no output schema, the description covers platform, privilege, and approval but omits execution details (e.g., success/failure, output format). Could be more complete.

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

Parameters3/5

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

Schema covers 100% of parameters with description matching command semantics. Description adds no additional meaning beyond what the schema already provides.

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?

Description clearly states it executes a PowerShell command with Administrator privileges, specifies Windows-only and visual user approval. Distinguishes from sibling run_as_root by platform and privilege model.

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

Usage Guidelines3/5

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

Implicitly indicates Windows-only usage and differentiation from run_as_root, but lacks explicit when-to-use, when-not-to-use, or alternative guidance. No mention of scenarios requiring admin vs standard execution.

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

run_as_rootB

Linux and macOS. Executes a bash command as root after visual user approval and sudo authentication.

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesBash command or script to execute as root.

TDQS

B3.4/5.0
Behavior3/5

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

Discloses that the tool requires visual user approval and sudo authentication, indicating it is not fully automated. Without annotations, it carries the burden of transparency, but lacks details on destructiveness, error handling, or return behavior.

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?

The description is a single, concise sentence that includes both platform and execution context. It is front-loaded and efficient, though could be slightly more structured.

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 a single required parameter and no output schema, the description adequately covers the tool's purpose and execution context. However, it lacks information on what the tool returns or error scenarios, which would be valuable for completeness.

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

Parameters3/5

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

Schema covers 100% of parameters with a description. The tool description adds context about approval and sudo, but does not add semantic detail beyond what the schema already provides for the 'command' parameter.

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 the tool executes a bash command as root on Linux/macOS, which is specific and distinct from typical commands. However, it does not explicitly differentiate from the sibling tool 'run_as_admin', which could cause ambiguity.

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

Usage Guidelines3/5

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

Mentions visual user approval and sudo authentication as prerequisites, but does not specify when to use this tool versus run_as_admin or provide explicit exclusions or alternatives.

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

TDQS

A3.9/5.0
Disambiguation5/5

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.

Naming Consistency5/5

Both tools follow a consistent 'run_as_<privilege>' naming pattern. The verb 'run' and the privilege level are clearly indicated, making the pattern predictable.

Tool Count4/5

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.

Completeness5/5

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

ActivityMaintained
ResponsivenessNo issues

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
  • F
    license
    Not graded
    quality
    D
    maintenance
    An 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.
  • A
    license
    B
    quality
    B
    maintenance
    A 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.
    10
    1
    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/Jon2G/cursor_admin_mcp'

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