@wonderwhy-er/desktop-commander 0.2.37 β†’ 0.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +239 -100
  2. package/dist/command-manager.js +6 -3
  3. package/dist/config-field-definitions.d.ts +41 -0
  4. package/dist/config-field-definitions.js +37 -0
  5. package/dist/config-manager.d.ts +2 -0
  6. package/dist/config-manager.js +22 -2
  7. package/dist/handlers/filesystem-handlers.js +6 -11
  8. package/dist/handlers/macos-control-handlers.d.ts +16 -0
  9. package/dist/handlers/macos-control-handlers.js +81 -0
  10. package/dist/lib.d.ts +10 -0
  11. package/dist/lib.js +10 -0
  12. package/dist/remote-device/remote-channel.js +1 -1
  13. package/dist/server.js +3 -1
  14. package/dist/tools/config.d.ts +71 -0
  15. package/dist/tools/config.js +117 -2
  16. package/dist/tools/macos-control/ax-adapter.d.ts +55 -0
  17. package/dist/tools/macos-control/ax-adapter.js +438 -0
  18. package/dist/tools/macos-control/cdp-adapter.d.ts +23 -0
  19. package/dist/tools/macos-control/cdp-adapter.js +402 -0
  20. package/dist/tools/macos-control/orchestrator.d.ts +77 -0
  21. package/dist/tools/macos-control/orchestrator.js +136 -0
  22. package/dist/tools/macos-control/role-aliases.d.ts +5 -0
  23. package/dist/tools/macos-control/role-aliases.js +34 -0
  24. package/dist/tools/macos-control/types.d.ts +129 -0
  25. package/dist/tools/macos-control/types.js +1 -0
  26. package/dist/tools/schemas.d.ts +3 -0
  27. package/dist/tools/schemas.js +1 -0
  28. package/dist/types.d.ts +0 -1
  29. package/dist/ui/config-editor/config-editor-runtime.js +14181 -0
  30. package/dist/ui/config-editor/index.html +13 -0
  31. package/dist/ui/config-editor/src/app.d.ts +43 -0
  32. package/dist/ui/config-editor/src/app.js +840 -0
  33. package/dist/ui/config-editor/src/array-modal.d.ts +19 -0
  34. package/dist/ui/config-editor/src/array-modal.js +185 -0
  35. package/dist/ui/config-editor/src/main.d.ts +1 -0
  36. package/dist/ui/config-editor/src/main.js +2 -0
  37. package/dist/ui/config-editor/styles.css +586 -0
  38. package/dist/ui/file-preview/preview-runtime.js +13336 -757
  39. package/dist/ui/file-preview/shared/preview-file-types.js +3 -1
  40. package/dist/ui/file-preview/src/app.d.ts +5 -1
  41. package/dist/ui/file-preview/src/app.js +114 -200
  42. package/dist/ui/file-preview/src/components/html-renderer.d.ts +1 -5
  43. package/dist/ui/file-preview/src/components/html-renderer.js +11 -27
  44. package/dist/ui/file-preview/styles.css +117 -83
  45. package/dist/ui/resources.d.ts +7 -0
  46. package/dist/ui/resources.js +16 -2
  47. package/dist/ui/shared/compact-row.d.ts +11 -0
  48. package/dist/ui/shared/compact-row.js +18 -0
  49. package/dist/ui/shared/host-context.d.ts +15 -0
  50. package/dist/ui/shared/host-context.js +51 -0
  51. package/dist/ui/shared/tool-bridge.d.ts +30 -0
  52. package/dist/ui/shared/tool-bridge.js +137 -0
  53. package/dist/ui/shared/tool-shell.d.ts +9 -0
  54. package/dist/ui/shared/tool-shell.js +46 -4
  55. package/dist/ui/shared/ui-event-tracker.d.ts +9 -0
  56. package/dist/ui/shared/ui-event-tracker.js +27 -0
  57. package/dist/utils/capture.js +3 -3
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/package.json +8 -4
package/README.md CHANGED
@@ -19,10 +19,22 @@ Work with code and text, run processes, and automate tasks, going far beyond oth
19
19
 
20
20
  ## πŸ‘‹ We’re hiring β€” come build with us: https://desktopcommander.app/careers/
21
21
 
22
+ ## πŸ–₯️ Try the Desktop Commander App (Beta)
23
+
24
+ **Want a better experience?** The Desktop Commander App gives you everything the MCP server does, plus:
25
+
26
+ - **Use any AI model** β€” Claude, GPT-4.5, Gemini 2.5, or any model you prefer
27
+ - **See file changes live** β€” visual file previews as AI edits your files
28
+ - **Add custom MCPs and context** β€” extend with your own tools, no config files
29
+ - **Coming soon** β€” skills system, dictation, background scheduled tasks, and more
30
+
31
+ **πŸ‘‰ [Download the App](https://desktopcommander.app/#download)** (macOS & Windows)
32
+
33
+ > The MCP server below still works great with Claude Desktop and other MCP clients β€” the app is for those who want a dedicated, polished experience.
34
+
22
35
  ## Table of Contents
23
36
  - [Features](#features)
24
37
  - [How to install](#how-to-install)
25
- - [Remote MCP (ChatGPT, Claude Web)](#remote-mcp-chatgpt-claude-web)
26
38
  - [Getting Started](#getting-started)
27
39
  - [Usage](#usage)
28
40
  - [Handling Long-Running Commands](#handling-long-running-commands)
@@ -42,23 +54,27 @@ Execute long-running terminal commands on your computer and manage processes thr
42
54
  ## Features
43
55
 
44
56
  - **Remote AI Control** - Use Desktop Commander from ChatGPT, Claude web, and other AI services via [Remote MCP](https://mcp.desktopcommander.app)
57
+ - **File Preview UI** - Visual file previews in Claude Desktop with rendered markdown, inline images, expandable content, and quick "Open in folder" access
45
58
  - **Enhanced terminal commands with interactive process control**
46
59
  - **Execute code in memory (Python, Node.js, R) without saving files**
47
60
  - **Instant data analysis - just ask to analyze CSV/JSON/Excel files**
48
61
  - **Native Excel file support** - Read, write, edit, and search Excel files (.xlsx, .xls, .xlsm) without external tools
49
62
  - **PDF support** - Read PDFs with text extraction, create new PDFs from markdown, modify existing PDFs
63
+ - **DOCX support** - Read, create, edit, and search Word documents (.docx) with surgical XML editing and markdown-to-DOCX conversion
50
64
  - **Interact with running processes (SSH, databases, development servers)**
51
65
  - Execute terminal commands with output streaming
52
66
  - Command timeout and background execution support
53
67
  - Process management (list and kill processes)
54
68
  - Session management for long-running commands
69
+ - **Process output pagination** - Read terminal output with offset/length controls to prevent context overflow
55
70
  - Server configuration management:
56
71
  - Get/set configuration values
57
72
  - Update multiple settings at once
58
73
  - Dynamic configuration changes without server restart
59
74
  - Full filesystem operations:
60
- - Read/write files (text, Excel, PDF)
75
+ - Read/write files (text, Excel, PDF, DOCX)
61
76
  - Create/list directories
77
+ - **Recursive directory listing** with configurable depth and context overflow protection for large folders
62
78
  - Move files/directories
63
79
  - Search files and content (including Excel content)
64
80
  - Get file metadata
@@ -73,14 +89,23 @@ Execute long-running terminal commands on your computer and manage processes thr
73
89
  - All tool calls are automatically logged
74
90
  - Log rotation with 10MB size limit
75
91
  - Detailed timestamps and arguments
92
+ - Security hardening:
93
+ - Symlink traversal prevention on file operations
94
+ - Command blocklist with bypass protection
95
+ - [Docker isolation](#option-6-docker-installation--auto-updates-no-nodejs-required) for full sandboxing
96
+ - See [SECURITY.md](SECURITY.md) for details
76
97
 
77
98
  ## How to install
78
99
 
79
- Desktop Commander offers multiple installation methods to fit different user needs and technical requirements.
100
+ ### Install in Claude Desktop
80
101
 
81
- > **πŸ“‹ Update & Uninstall Information:** Before choosing an installation option, note that **only Options 1, 2, 3, and 6 have automatic updates**. Options 4 and 5 require manual updates. See the sections below for update and uninstall instructions for each option.
102
+ Desktop Commander offers multiple installation methods for Claude Desktop.
103
+
104
+ > **πŸ“‹ Update & Uninstall Information:** Options 1, 2, 3, 4, and 6 have automatic updates. Option 5 requires manual updates. See below for details.
105
+
106
+ <details>
107
+ <summary><b>Option 1: Install through npx ⭐ Auto-Updates (Requires Node.js)</b></summary>
82
108
 
83
- ### Option 1: Install through npx ⭐ **Auto-Updates** **Requires Node.js**
84
109
  Just run this in terminal:
85
110
  ```
86
111
  npx @wonderwhy-er/desktop-commander@latest setup
@@ -101,36 +126,42 @@ Restart Claude if running.
101
126
  **πŸ”„ Manual Update:** Run the setup command again
102
127
  **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
103
128
 
104
- ### Option 2: Using bash script installer (macOS) ⭐ **Auto-Updates** **Installs Node.js if needed**
105
- For macOS users, you can use our automated bash installer which will check your Node.js version, install it if needed, and automatically configure Desktop Commander:
129
+ </details>
130
+
131
+ <details>
132
+ <summary><b>Option 2: Using bash script installer (macOS) ⭐ Auto-Updates (Installs Node.js if needed)</b></summary>
133
+
106
134
  ```
107
135
  curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
108
136
  ```
109
- This script handles all dependencies and configuration automatically for a seamless setup experience.
137
+ This script handles all dependencies and configuration automatically.
110
138
 
111
- **βœ… Auto-Updates:** Yes - requires manual updates
139
+ **βœ… Auto-Updates:** Yes
112
140
  **πŸ”„ Manual Update:** Re-run the bash installer command above
113
141
  **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
114
142
 
115
- ### Option 3: Installing via Smithery ⭐ **Auto-Updates** **Requires Node.js**
143
+ </details>
116
144
 
117
- To install Desktop Commander for Claude Desktop via [Smithery](https://smithery.ai/server/@wonderwhy-er/desktop-commander):
145
+ <details>
146
+ <summary><b>Option 3: Installing via Smithery ⭐ Auto-Updates (Requires Node.js)</b></summary>
118
147
 
119
- 1. **Visit the Smithery page:** https://smithery.ai/server/@wonderwhy-er/desktop-commander
148
+ 1. **Visit:** https://smithery.ai/server/@wonderwhy-er/desktop-commander
120
149
  2. **Login to Smithery** if you haven't already
121
150
  3. **Select your client** (Claude Desktop) on the right side
122
151
  4. **Install with the provided key** that appears after selecting your client
123
152
  5. **Restart Claude Desktop**
124
153
 
125
- The old command-line installation method is no longer supported. Please use the web interface above for the most reliable installation experience.
126
-
127
154
  **βœ… Auto-Updates:** Yes - automatically updates when you restart Claude
128
155
  **πŸ”„ Manual Update:** Visit the Smithery page and reinstall
129
156
 
130
- ### Option 4: Add to claude_desktop_config manually ⭐ **Auto-Updates** **Requires Node.js**
157
+ </details>
158
+
159
+ <details>
160
+ <summary><b>Option 4: Add to claude_desktop_config manually ⭐ Auto-Updates (Requires Node.js)</b></summary>
161
+
131
162
  Add this entry to your claude_desktop_config.json:
132
163
 
133
- - On Mac: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
164
+ - On Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`
134
165
  - On Windows: `%APPDATA%\Claude\claude_desktop_config.json`
135
166
  - On Linux: `~/.config/Claude/claude_desktop_config.json`
136
167
 
@@ -151,10 +182,13 @@ Restart Claude if running.
151
182
 
152
183
  **βœ… Auto-Updates:** Yes - automatically updates when you restart Claude
153
184
  **πŸ”„ Manual Update:** Run the setup command again
154
- **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the "desktop-commander" entry from your claude_desktop_config.json file
185
+ **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the entry from your claude_desktop_config.json
186
+
187
+ </details>
188
+
189
+ <details>
190
+ <summary><b>Option 5: Checkout locally ❌ Manual Updates (Requires Node.js)</b></summary>
155
191
 
156
- ### ### Option 5: Checkout locally ❌ **Manual Updates** **Requires Node.js** ❌ **Manual Updates** **Requires Node.js**
157
- 1. Clone and build:
158
192
  ```bash
159
193
  git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
160
194
  cd DesktopCommanderMCP
@@ -162,27 +196,20 @@ npm run setup
162
196
  ```
163
197
  Restart Claude if running.
164
198
 
165
- The setup command will:
166
- - Install dependencies
167
- - Build the server
168
- - Configure Claude's desktop app
169
- - Add MCP servers to Claude's config if needed
199
+ The setup command will install dependencies, build the server, and configure Claude's desktop app.
170
200
 
171
201
  **❌ Auto-Updates:** No - requires manual git updates
172
202
  **πŸ”„ Manual Update:** `cd DesktopCommanderMCP && git pull && npm run setup`
173
- **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the cloned directory and remove MCP server entry from Claude config
203
+ **πŸ—‘οΈ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove` or remove the cloned directory and MCP server entry from Claude config
174
204
 
175
- ### Option 6: Docker Installation 🐳 ⭐ **Auto-Updates** **No Node.js Required**
176
-
177
- Perfect for users who want complete or partial isolation or don't have Node.js installed. Desktop Commander runs in a sandboxed Docker container with a persistent work environment.
205
+ </details>
178
206
 
179
- #### Prerequisites
180
- - [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed **and running**
181
- - Claude Desktop app installed
207
+ <details>
208
+ <summary><b>Option 6: Docker Installation 🐳 ⭐ Auto-Updates (No Node.js Required)</b></summary>
182
209
 
183
- **Important:** Make sure Docker Desktop is fully started before running the installer.
210
+ Perfect for users who want isolation or don't have Node.js installed. Runs in a sandboxed Docker container with a persistent work environment.
184
211
 
185
- #### Automated Installation (Recommended)
212
+ **Prerequisites:** [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed **and running**, Claude Desktop app installed.
186
213
 
187
214
  **macOS/Linux:**
188
215
  ```bash
@@ -191,29 +218,15 @@ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommande
191
218
 
192
219
  **Windows PowerShell:**
193
220
  ```powershell
194
- # Download and run the installer (one-liner)
195
221
  iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'))
196
222
  ```
197
223
 
198
- The automated installer will:
199
- - Check Docker installation
200
- - Pull the latest Docker image
201
- - Prompt you to select folders for mounting
202
- - Configure Claude Desktop automatically
203
- - Restart Claude if possible
204
-
205
- #### How Docker Persistence Works
206
- Desktop Commander creates a persistent work environment that remembers everything between sessions:
207
- - **Your development tools**: Any software you install (Node.js, Python, databases, etc.) stays installed
208
- - **Your configurations**: Git settings, SSH keys, shell preferences, and other personal configs are preserved
209
- - **Your work files**: Projects and files in the workspace area persist across restarts
210
- - **Package caches**: Downloaded packages and dependencies are cached for faster future installs
211
-
212
- Think of it like having your own dedicated development computer that never loses your setup, but runs safely isolated from your main system.
224
+ The installer will check Docker, pull the image, prompt for folder mounting, and configure Claude Desktop.
213
225
 
214
- #### Manual Docker Configuration
226
+ **Docker persistence:** Your tools, configs, work files, and package caches all survive restarts.
215
227
 
216
- If you prefer manual setup, add this to your claude_desktop_config.json:
228
+ <details>
229
+ <summary>Manual Docker Configuration</summary>
217
230
 
218
231
  **Basic setup (no file access):**
219
232
  ```json
@@ -221,12 +234,7 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
221
234
  "mcpServers": {
222
235
  "desktop-commander-in-docker": {
223
236
  "command": "docker",
224
- "args": [
225
- "run",
226
- "-i",
227
- "--rm",
228
- "mcp/desktop-commander:latest"
229
- ]
237
+ "args": ["run", "-i", "--rm", "mcp/desktop-commander:latest"]
230
238
  }
231
239
  }
232
240
  }
@@ -239,9 +247,7 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
239
247
  "desktop-commander-in-docker": {
240
248
  "command": "docker",
241
249
  "args": [
242
- "run",
243
- "-i",
244
- "--rm",
250
+ "run", "-i", "--rm",
245
251
  "-v", "/Users/username/Desktop:/mnt/desktop",
246
252
  "-v", "/Users/username/Documents:/mnt/documents",
247
253
  "mcp/desktop-commander:latest"
@@ -272,77 +278,208 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
272
278
  }
273
279
  ```
274
280
 
275
- #### Docker Benefits
276
- βœ… **Controlled Isolation:** Runs in sandboxed environment with persistent development state
277
- βœ… **No Node.js Required:** Everything included in the container
278
- βœ… **Cross-Platform:** Same experience on all operating systems
279
- βœ… **Persistent Environment:** Your tools, files, configs, and work survives restarts
280
-
281
- **βœ… Auto-Updates:** Yes - `latest` tag automatically gets newer versions
282
- **πŸ”„ Manual Update:** `docker pull mcp/desktop-commander:latest` then restart Claude
281
+ </details>
283
282
 
284
- #### Docker Management Commands
283
+ <details>
284
+ <summary>Docker Management Commands</summary>
285
285
 
286
286
  **macOS/Linux:**
287
-
288
- Check installation status:
289
287
  ```bash
288
+ # Check status
290
289
  bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --status
291
- ```
292
290
 
293
- Reset all persistent data (removes all installed tools and configs):
294
- ```bash
291
+ # Reset all persistent data
295
292
  bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset
296
293
  ```
297
294
 
298
295
  **Windows PowerShell:**
299
-
300
- Check status:
301
296
  ```powershell
297
+ # Check status
302
298
  $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Status
303
- ```
304
299
 
305
- Reset all data:
306
- ```powershell
300
+ # Reset all data
307
301
  $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Reset
308
- ```
309
302
 
310
- Show help:
311
- ```powershell
303
+ # Show help
312
304
  $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Help
313
305
  ```
314
306
 
315
- Verbose output:
316
- ```powershell
317
- $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -VerboseOutput
318
- ```
319
-
320
- #### Troubleshooting Docker Installation
321
- If you broke the Docker container or need a fresh start:
307
+ **Troubleshooting:** Reset and reinstall from scratch:
322
308
  ```bash
323
- # Reset and reinstall from scratch
324
309
  bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset && bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)
325
310
  ```
326
- This will completely reset your persistent environment and reinstall everything fresh with exception of not touching mounted folders
327
311
 
328
- ## Remote MCP (ChatGPT, Claude Web) 🌐
312
+ </details>
313
+
314
+ **βœ… Auto-Updates:** Yes - `latest` tag automatically gets newer versions
315
+ **πŸ”„ Manual Update:** `docker pull mcp/desktop-commander:latest` then restart Claude
316
+
317
+ </details>
318
+
319
+ ### Install in Other Clients
320
+
321
+ Desktop Commander works with any MCP-compatible client. The standard JSON configuration is:
322
+
323
+ ```json
324
+ {
325
+ "mcpServers": {
326
+ "desktop-commander": {
327
+ "command": "npx",
328
+ "args": ["-y", "@wonderwhy-er/desktop-commander@latest"]
329
+ }
330
+ }
331
+ }
332
+ ```
333
+
334
+ Add this to your client's MCP configuration file at the locations below:
335
+
336
+ <details>
337
+ <summary><b>Cursor</b></summary>
338
+
339
+ [![Install MCP Server in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=desktop-commander&config=eyJjb21tYW5kIjoibnB4IC15IEB3b25kZXJ3aHktZXIvZGVza3RvcC1jb21tYW5kZXJAbGF0ZXN0In0%3D)
329
340
 
330
- Use Desktop Commander from **ChatGPT**, **Claude web**, and other AI services through their MCP/Connector integrations - no Claude Desktop app required.
341
+ Or add manually to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` in your project folder (project-specific).
331
342
 
332
- **πŸ‘‰ Get started at [mcp.desktopcommander.app](https://mcp.desktopcommander.app)**
343
+ See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.
333
344
 
334
- The website provides complete instructions for:
335
- - Installing and running the Remote Device on your computer
336
- - Connecting your AI service (ChatGPT, Claude, etc.)
337
- - Managing your devices and sessions
345
+ </details>
346
+
347
+ <details>
348
+ <summary><b>Windsurf</b></summary>
349
+
350
+ Add to `~/.codeium/windsurf/mcp_config.json`. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/cascade/mcp) for more info.
351
+
352
+ </details>
353
+
354
+ <details>
355
+ <summary><b>VS Code / GitHub Copilot</b></summary>
338
356
 
339
- ### How It Works
357
+ Add to `.vscode/mcp.json` in your project or VS Code User Settings (JSON). Make sure MCP is enabled under Chat > MCP. Works in Agent mode.
340
358
 
359
+ See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.
360
+
361
+ </details>
362
+
363
+ <details>
364
+ <summary><b>Cline</b></summary>
365
+
366
+ Configure through the Cline extension settings in VS Code. Open the Cline sidebar, click the MCP Servers icon, and add the JSON configuration above. See [Cline MCP docs](https://docs.cline.bot/mcp/configuring-mcp-servers) for more info.
367
+
368
+ </details>
369
+
370
+ <details>
371
+ <summary><b>Roo Code</b></summary>
372
+
373
+ Add to your Roo Code MCP configuration file. See [Roo Code MCP docs](https://docs.roocode.com/features/mcp/using-mcp-in-roo) for more info.
374
+
375
+ </details>
376
+
377
+ <details>
378
+ <summary><b>Claude Code</b></summary>
379
+
380
+ ```sh
381
+ claude mcp add --scope user desktop-commander -- npx -y @wonderwhy-er/desktop-commander@latest
382
+ ```
383
+
384
+ Remove `--scope user` to install for the current project only. See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/claude-code/mcp) for more info.
385
+
386
+ </details>
387
+
388
+ <details>
389
+ <summary><b>Trae</b></summary>
390
+
391
+ Use the "Add manually" feature and paste the JSON configuration above. See [Trae MCP docs](https://docs.trae.ai/ide/model-context-protocol?_lang=en) for more info.
392
+
393
+ </details>
394
+
395
+ <details>
396
+ <summary><b>Kiro</b></summary>
397
+
398
+ Navigate to `Kiro` > `MCP Servers`, click `+ Add`, and paste the JSON configuration above. See [Kiro MCP docs](https://kiro.dev/docs/mcp/configuration/) for more info.
399
+
400
+ </details>
401
+
402
+ <details>
403
+ <summary><b>Codex (OpenAI)</b></summary>
404
+
405
+ Codex uses TOML configuration. Run this command to add Desktop Commander:
406
+
407
+ ```sh
408
+ codex mcp add desktop-commander -- npx -y @wonderwhy-er/desktop-commander@latest
409
+ ```
410
+
411
+ Or manually add to `~/.codex/config.toml`:
412
+
413
+ ```toml
414
+ [mcp_servers.desktop-commander]
415
+ command = "npx"
416
+ args = ["-y", "@wonderwhy-er/desktop-commander@latest"]
417
+ ```
418
+
419
+ See [Codex MCP docs](https://developers.openai.com/codex/mcp/) for more info.
420
+
421
+ </details>
422
+
423
+ <details>
424
+ <summary><b>JetBrains (AI Assistant)</b></summary>
425
+
426
+ In JetBrains IDEs, go to **Settings β†’ Tools β†’ AI Assistant β†’ Model Context Protocol (MCP)**, click `+` Add, select **As JSON**, and paste the JSON configuration above. See [JetBrains MCP docs](https://www.jetbrains.com/help/ai-assistant/configure-an-mcp-server.html) for more info.
427
+
428
+ </details>
429
+
430
+ <details>
431
+ <summary><b>Gemini CLI</b></summary>
432
+
433
+ Add to `~/.gemini/settings.json`:
434
+
435
+ ```json
436
+ {
437
+ "mcpServers": {
438
+ "desktop-commander": {
439
+ "command": "npx",
440
+ "args": ["-y", "@wonderwhy-er/desktop-commander@latest"]
441
+ }
442
+ }
443
+ }
444
+ ```
445
+
446
+ See [Gemini CLI docs](https://github.com/google-gemini/gemini-cli) for more info.
447
+
448
+ </details>
449
+
450
+ <details>
451
+ <summary><b>Augment Code</b></summary>
452
+
453
+ Press `Cmd/Ctrl+Shift+P`, open the Augment panel, and add a new MCP server named `desktop-commander` with the JSON configuration above. See [Augment Code MCP docs](https://docs.augmentcode.com/setup-augment/mcp) for more info.
454
+
455
+ </details>
456
+
457
+ <details>
458
+ <summary><b>Qwen Code</b></summary>
459
+
460
+ Run this command to add Desktop Commander:
461
+
462
+ ```sh
463
+ qwen mcp add desktop-commander -- npx -y @wonderwhy-er/desktop-commander@latest
464
+ ```
465
+
466
+ Or add to `.qwen/settings.json` (project) or `~/.qwen/settings.json` (global). See [Qwen Code MCP docs](https://qwenlm.github.io/qwen-code-docs/en/developers/tools/mcp-server/) for more info.
467
+
468
+ </details>
469
+
470
+ <details>
471
+ <summary><b>ChatGPT / Claude Web (Remote MCP)</b></summary>
472
+
473
+ Use Desktop Commander from **ChatGPT**, **Claude web**, and other AI services via Remote MCP β€” no desktop app required.
474
+
475
+ **πŸ‘‰ [Get started at mcp.desktopcommander.app](https://mcp.desktopcommander.app)**
476
+
477
+ How it works:
341
478
  1. You run a lightweight **Remote Device** on your computer
342
479
  2. It connects securely to the cloud Remote MCP service
343
480
  3. Your AI sends commands through the cloud to your device
344
481
  4. Commands execute locally, results return to your AI
345
- 5. **You stay in control** - stop anytime with `Ctrl+C`
482
+ 5. **You stay in control** β€” stop anytime with `Ctrl+C`
346
483
 
347
484
  ### Security
348
485
 
@@ -350,6 +487,8 @@ The website provides complete instructions for:
350
487
  - βœ… Commands execute under your user permissions
351
488
  - βœ… Secure OAuth authentication and encrypted communication channel
352
489
 
490
+ </details>
491
+
353
492
  ## Updating & Uninstalling Desktop Commander
354
493
 
355
494
  ### Automatic Updates (Options 1, 2, 3, 4 & 6)
@@ -229,9 +229,12 @@ class CommandManager {
229
229
  }
230
230
  catch (error) {
231
231
  console.error('Error validating command:', error);
232
- // If there's an error, default to allowing the command
233
- // This is less secure but prevents blocking all commands due to config issues
234
- return true;
232
+ capture('server_validate_command_error', {
233
+ error: error instanceof Error ? error.message : String(error)
234
+ });
235
+ // Fail closed: deny the command if validation encounters an error.
236
+ // This prevents a config read failure from bypassing all command filtering.
237
+ return false;
235
238
  }
236
239
  }
237
240
  }
@@ -0,0 +1,41 @@
1
+ export type ConfigFieldValueType = 'string' | 'number' | 'boolean' | 'array' | 'null';
2
+ export type ConfigFieldDefinition = {
3
+ label: string;
4
+ description: string;
5
+ valueType: ConfigFieldValueType;
6
+ };
7
+ export declare const CONFIG_FIELD_DEFINITIONS: {
8
+ readonly blockedCommands: {
9
+ readonly label: "Blocked Commands";
10
+ readonly description: "This is your personal safety blocklist. If a command appears here, Desktop Commander will refuse to run it even if a prompt asks for it. Add risky commands you never want executed by mistake.";
11
+ readonly valueType: "array";
12
+ };
13
+ readonly allowedDirectories: {
14
+ readonly label: "Allowed Folders";
15
+ readonly description: "These are the folders Desktop Commander is allowed to read and edit. Think of this as a permission list. Keeping it small is safer. If this list is empty, Desktop Commander can access your entire filesystem.";
16
+ readonly valueType: "array";
17
+ };
18
+ readonly defaultShell: {
19
+ readonly label: "Default Shell";
20
+ readonly description: "This is the shell used for new command sessions (for example /bin/bash or /bin/zsh). Only change this if you know your environment requires a specific shell.";
21
+ readonly valueType: "string";
22
+ };
23
+ readonly telemetryEnabled: {
24
+ readonly label: "Anonymous Telemetry";
25
+ readonly description: "When on, Desktop Commander sends anonymous usage information that helps improve product quality. When off, no telemetry data is sent.";
26
+ readonly valueType: "boolean";
27
+ };
28
+ readonly fileReadLineLimit: {
29
+ readonly label: "File Read Limit";
30
+ readonly description: "Maximum number of lines returned from a file in one read action. Lower numbers keep responses short and safer; higher numbers return more text at once.";
31
+ readonly valueType: "number";
32
+ };
33
+ readonly fileWriteLineLimit: {
34
+ readonly label: "File Write Limit";
35
+ readonly description: "Maximum number of lines that can be written in one edit operation. This helps prevent accidental oversized writes and keeps file changes predictable.";
36
+ readonly valueType: "number";
37
+ };
38
+ };
39
+ export type ConfigFieldKey = keyof typeof CONFIG_FIELD_DEFINITIONS;
40
+ export declare const CONFIG_FIELD_KEYS: ConfigFieldKey[];
41
+ export declare function isConfigFieldKey(value: string): value is ConfigFieldKey;
@@ -0,0 +1,37 @@
1
+ // Single source of truth for user-editable configuration fields.
2
+ export const CONFIG_FIELD_DEFINITIONS = {
3
+ blockedCommands: {
4
+ label: 'Blocked Commands',
5
+ description: 'This is your personal safety blocklist. If a command appears here, Desktop Commander will refuse to run it even if a prompt asks for it. Add risky commands you never want executed by mistake.',
6
+ valueType: 'array',
7
+ },
8
+ allowedDirectories: {
9
+ label: 'Allowed Folders',
10
+ description: 'These are the folders Desktop Commander is allowed to read and edit. Think of this as a permission list. Keeping it small is safer. If this list is empty, Desktop Commander can access your entire filesystem.',
11
+ valueType: 'array',
12
+ },
13
+ defaultShell: {
14
+ label: 'Default Shell',
15
+ description: 'This is the shell used for new command sessions (for example /bin/bash or /bin/zsh). Only change this if you know your environment requires a specific shell.',
16
+ valueType: 'string',
17
+ },
18
+ telemetryEnabled: {
19
+ label: 'Anonymous Telemetry',
20
+ description: 'When on, Desktop Commander sends anonymous usage information that helps improve product quality. When off, no telemetry data is sent.',
21
+ valueType: 'boolean',
22
+ },
23
+ fileReadLineLimit: {
24
+ label: 'File Read Limit',
25
+ description: 'Maximum number of lines returned from a file in one read action. Lower numbers keep responses short and safer; higher numbers return more text at once.',
26
+ valueType: 'number',
27
+ },
28
+ fileWriteLineLimit: {
29
+ label: 'File Write Limit',
30
+ description: 'Maximum number of lines that can be written in one edit operation. This helps prevent accidental oversized writes and keeps file changes predictable.',
31
+ valueType: 'number',
32
+ },
33
+ };
34
+ export const CONFIG_FIELD_KEYS = Object.keys(CONFIG_FIELD_DEFINITIONS);
35
+ export function isConfigFieldKey(value) {
36
+ return Object.prototype.hasOwnProperty.call(CONFIG_FIELD_DEFINITIONS, value);
37
+ }
@@ -13,6 +13,8 @@ export interface ClientInfo {
13
13
  name: string;
14
14
  version: string;
15
15
  }
16
+ export declare function normalizeTelemetryEnabledValue(value: unknown): unknown;
17
+ export declare function isTelemetryDisabledValue(value: unknown): boolean;
16
18
  /**
17
19
  * Singleton config manager for the server
18
20
  */
@@ -5,6 +5,22 @@ import { mkdir } from 'fs/promises';
5
5
  import os from 'os';
6
6
  import { VERSION } from './version.js';
7
7
  import { CONFIG_FILE } from './config.js';
8
+ export function normalizeTelemetryEnabledValue(value) {
9
+ if (typeof value !== 'string') {
10
+ return value;
11
+ }
12
+ const normalized = value.trim().toLowerCase();
13
+ if (normalized === 'true') {
14
+ return true;
15
+ }
16
+ if (normalized === 'false') {
17
+ return false;
18
+ }
19
+ return value;
20
+ }
21
+ export function isTelemetryDisabledValue(value) {
22
+ return normalizeTelemetryEnabledValue(value) === false;
23
+ }
8
24
  /**
9
25
  * Singleton config manager for the server
10
26
  */
@@ -154,12 +170,16 @@ class ConfigManager {
154
170
  */
155
171
  async setValue(key, value) {
156
172
  await this.init();
173
+ if (key === 'telemetryEnabled') {
174
+ value = normalizeTelemetryEnabledValue(value);
175
+ }
157
176
  // Special handling for telemetry opt-out
158
- if (key === 'telemetryEnabled' && value === false) {
177
+ if (key === 'telemetryEnabled' && isTelemetryDisabledValue(value)) {
159
178
  // Get the current value before changing it
160
179
  const currentValue = this.config[key];
180
+ const telemetryAlreadyDisabled = isTelemetryDisabledValue(currentValue);
161
181
  // Only capture the opt-out event if telemetry was previously enabled
162
- if (currentValue !== false) {
182
+ if (!telemetryAlreadyDisabled) {
163
183
  // Import the capture function dynamically to avoid circular dependencies
164
184
  const { capture } = await import('./utils/capture.js');
165
185
  // Send a final telemetry event noting that the user has opted out