DesktopCommanderMCP Command-Line Arguments: Complete CLI Reference
DesktopCommanderMCP supports three top-level commands (setup, remove, remote) and specific flags including --no-onboarding, --debug, --persist-session, and --disable-no-sleep to control installation behavior, remote device management, and debugging.
DesktopCommanderMCP is a Model Context Protocol (MCP) server built with Node.js that exposes terminal and process management capabilities to AI assistants. Understanding the command-line arguments for DesktopCommanderMCP is essential for automation, debugging, and customizing how the server initializes. The entry point at src/index.ts parses these inputs to determine whether to install the server, remove it, or launch the remote-device helper.
Top-Level Commands
The CLI recognizes three primary subcommands defined in src/index.ts. Each command delegates to a dedicated handler in the src/npm-scripts/ directory.
setup
The setup command, implemented at lines 26-30 of src/index.ts, executes the runSetup script to install or update the server in Claude Desktop's configuration. This command automatically registers the MCP server and prepares the environment for first use.
remove
Lines 32-36 of src/index.ts handle the remove command, which triggers the runUninstall script. This cleanly removes DesktopCommanderMCP from your system and unregisters it from Claude Desktop.
remote
The remote command, found at lines 38-42 of src/index.ts, starts the remote-device helper via the runRemote script. This exposes your local machine to AI services over the network, allowing remote command execution.
Global Flags
These options modify behavior across multiple commands and are processed early in the application lifecycle.
--no-onboarding
When passed to the setup command, this flag disables first-time onboarding prompts that would otherwise require interactive input. The logic resides at lines 45-48 in src/index.ts, enabling automated installations in CI/CD pipelines or silent deployments.
--debug
Available for both setup and remote commands, this flag enables Node.js debugging by injecting the --inspect-brk argument. According to src/npm-scripts/remote.ts lines 5-7 and the README documentation, this allows developers to attach a debugger during script initialization to troubleshoot connectivity or permission issues.
Remote-Specific Flags
The remote command accepts additional arguments processed in src/npm-scripts/remote.ts (lines 5-7) to control session persistence and system power management.
--persist-session
This flag keeps the remote-device session alive across process restarts. As implemented at line 5 of src/npm-scripts/remote.ts, it maintains state during intermittent network connectivity rather than terminating the helper when the connection drops.
--disable-no-sleep
Located at line 6 of src/npm-scripts/remote.ts, this flag disables the default "no-sleep" guard. Without this flag, the server prevents your operating system from sleeping during long-running commands; with it, normal power management resumes.
Practical Usage Examples
Here are runnable commands demonstrating each argument combination:
# Install or update the server
npx @wonderwhy-er/desktop-commander@latest setup
# Install with debugging enabled and skip onboarding prompts
npx @wonderwhy-er/desktop-commander@latest setup --debug --no-onboarding
# Remove the server configuration entirely
npx @wonderwhy-er/desktop-commander@latest remove
# Start remote device helper with session persistence
npx @wonderwhy-er/desktop-commander@latest remote --persist-session
# Remote helper with full debugging and power management disabled
npx @wonderwhy-er/desktop-commander@latest remote --debug --persist-session --disable-no-sleep
Source Code Implementation
The argument parsing logic resides in specific files that demonstrate how DesktopCommanderMCP handles CLI input:
src/index.ts: Main entry point parsingsetup,remove,remote, and--no-onboarding(lines 26-48)src/npm-scripts/setup.ts: Implements installation logic for thesetupcommandsrc/npm-scripts/uninstall.ts: Handles cleanup operations for theremovecommandsrc/npm-scripts/remote.ts: Processesremotespecific flags including--debug,--persist-session, and--disable-no-sleep(lines 5-7)
Unlike tool-specific parameters passed via RPC calls (such as get_config or start_process), these command-line arguments affect the server's startup flow and are parsed before the MCP transport layer initializes.
Summary
- DesktopCommanderMCP accepts three primary commands:
setup,remove, andremote - Use
--no-onboardingwithsetupto skip interactive prompts during automated installations - The
--debugflag attaches the Node.js inspector tosetuporremoteprocesses for troubleshooting - Remote sessions support
--persist-sessionfor continuity across reconnections and--disable-no-sleepto allow normal system sleep - All command-line argument parsing occurs in
src/index.tswith command-specific execution logic insrc/npm-scripts/
Frequently Asked Questions
What is the difference between the setup and remote commands?
The setup command installs or updates the DesktopCommanderMCP server in Claude Desktop's configuration according to src/index.ts lines 26-30, while the remote command launches a network-accessible helper that allows AI services to execute commands on your machine from remote locations, as defined at lines 38-42.
How do I prevent the remote session from keeping my computer awake?
Pass the --disable-no-sleep flag when starting the remote helper. According to src/npm-scripts/remote.ts line 6, this disables the default guard that prevents system sleep during long-running operations, allowing your machine to enter normal power-saving states.
Can I install DesktopCommanderMCP without interactive prompts?
Yes. Append --no-onboarding to the setup command as implemented in src/index.ts lines 45-48. This skips the first-time configuration dialogs, enabling fully automated deployments and silent installations in scripted environments.
Which commands support the --debug flag?
Both the setup and remote commands accept --debug, which launches the Node.js process with --inspect-brk for debugger attachment. This is defined in src/npm-scripts/remote.ts lines 5-7 and documented in the README for troubleshooting installation failures or remote connectivity issues.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →