@wonderwhy-er/desktop-commander 0.2.36 → 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 (94) hide show
  1. package/README.md +240 -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.d.ts +8 -3
  13. package/dist/remote-device/remote-channel.js +68 -21
  14. package/dist/search-manager.d.ts +13 -0
  15. package/dist/search-manager.js +146 -0
  16. package/dist/server.js +29 -1
  17. package/dist/test-docx.d.ts +1 -0
  18. package/dist/tools/config.d.ts +71 -0
  19. package/dist/tools/config.js +117 -2
  20. package/dist/tools/docx/builders/table.d.ts +2 -0
  21. package/dist/tools/docx/builders/table.js +60 -16
  22. package/dist/tools/docx/dom.d.ts +74 -1
  23. package/dist/tools/docx/dom.js +221 -1
  24. package/dist/tools/docx/index.d.ts +2 -2
  25. package/dist/tools/docx/ops/index.js +3 -0
  26. package/dist/tools/docx/ops/replace-paragraph-text-exact.d.ts +15 -3
  27. package/dist/tools/docx/ops/replace-paragraph-text-exact.js +25 -10
  28. package/dist/tools/docx/ops/replace-table-cell-text.d.ts +25 -0
  29. package/dist/tools/docx/ops/replace-table-cell-text.js +85 -0
  30. package/dist/tools/docx/ops/set-color-for-paragraph-exact.d.ts +2 -1
  31. package/dist/tools/docx/ops/set-color-for-paragraph-exact.js +9 -8
  32. package/dist/tools/docx/ops/set-color-for-style.d.ts +4 -0
  33. package/dist/tools/docx/ops/set-color-for-style.js +11 -7
  34. package/dist/tools/docx/ops/table-set-cell-text.js +8 -40
  35. package/dist/tools/docx/read.d.ts +2 -2
  36. package/dist/tools/docx/read.js +137 -17
  37. package/dist/tools/docx/types.d.ts +32 -3
  38. package/dist/tools/docx/xml-view-test.d.ts +1 -0
  39. package/dist/tools/docx/xml-view-test.js +63 -0
  40. package/dist/tools/docx/xml-view.d.ts +56 -0
  41. package/dist/tools/docx/xml-view.js +169 -0
  42. package/dist/tools/edit.js +57 -27
  43. package/dist/tools/macos-control/ax-adapter.d.ts +55 -0
  44. package/dist/tools/macos-control/ax-adapter.js +438 -0
  45. package/dist/tools/macos-control/cdp-adapter.d.ts +23 -0
  46. package/dist/tools/macos-control/cdp-adapter.js +402 -0
  47. package/dist/tools/macos-control/orchestrator.d.ts +77 -0
  48. package/dist/tools/macos-control/orchestrator.js +136 -0
  49. package/dist/tools/macos-control/role-aliases.d.ts +5 -0
  50. package/dist/tools/macos-control/role-aliases.js +34 -0
  51. package/dist/tools/macos-control/types.d.ts +129 -0
  52. package/dist/tools/macos-control/types.js +1 -0
  53. package/dist/tools/schemas.d.ts +3 -0
  54. package/dist/tools/schemas.js +2 -1
  55. package/dist/types.d.ts +0 -1
  56. package/dist/ui/config-editor/config-editor-runtime.js +14181 -0
  57. package/dist/ui/config-editor/index.html +13 -0
  58. package/dist/ui/config-editor/src/app.d.ts +43 -0
  59. package/dist/ui/config-editor/src/app.js +840 -0
  60. package/dist/ui/config-editor/src/array-modal.d.ts +19 -0
  61. package/dist/ui/config-editor/src/array-modal.js +185 -0
  62. package/dist/ui/config-editor/src/main.d.ts +1 -0
  63. package/dist/ui/config-editor/src/main.js +2 -0
  64. package/dist/ui/config-editor/styles.css +586 -0
  65. package/dist/ui/file-preview/preview-runtime.js +13337 -752
  66. package/dist/ui/file-preview/shared/preview-file-types.js +3 -1
  67. package/dist/ui/file-preview/src/app.d.ts +5 -1
  68. package/dist/ui/file-preview/src/app.js +114 -200
  69. package/dist/ui/file-preview/src/components/html-renderer.d.ts +1 -5
  70. package/dist/ui/file-preview/src/components/html-renderer.js +11 -27
  71. package/dist/ui/file-preview/styles.css +117 -83
  72. package/dist/ui/resources.d.ts +7 -0
  73. package/dist/ui/resources.js +16 -2
  74. package/dist/ui/shared/compact-row.d.ts +11 -0
  75. package/dist/ui/shared/compact-row.js +18 -0
  76. package/dist/ui/shared/host-context.d.ts +15 -0
  77. package/dist/ui/shared/host-context.js +51 -0
  78. package/dist/ui/shared/tool-bridge.d.ts +30 -0
  79. package/dist/ui/shared/tool-bridge.js +137 -0
  80. package/dist/ui/shared/tool-shell.d.ts +9 -0
  81. package/dist/ui/shared/tool-shell.js +46 -4
  82. package/dist/ui/shared/ui-event-tracker.d.ts +9 -0
  83. package/dist/ui/shared/ui-event-tracker.js +27 -0
  84. package/dist/utils/capture.js +173 -11
  85. package/dist/utils/files/base.d.ts +3 -1
  86. package/dist/utils/files/docx.d.ts +28 -15
  87. package/dist/utils/files/docx.js +622 -88
  88. package/dist/utils/files/factory.d.ts +6 -5
  89. package/dist/utils/files/factory.js +18 -6
  90. package/dist/utils/system-info.js +1 -1
  91. package/dist/utils/usageTracker.js +5 -0
  92. package/dist/version.d.ts +1 -1
  93. package/dist/version.js +1 -1
  94. package/package.json +8 -3
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  ### Search, update, manage files and run terminal commands with AI
3
3
 
4
4
  [![npm downloads](https://img.shields.io/npm/dw/@wonderwhy-er/desktop-commander)](https://www.npmjs.com/package/@wonderwhy-er/desktop-commander)
5
+ [![AgentAudit Verified](https://agentaudit.dev/api/badge/desktop-commander)](https://agentaudit.dev/skills/desktop-commander)
5
6
  [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/wonderwhy-er/DesktopCommanderMCP)](https://archestra.ai/mcp-catalog/wonderwhy-er__desktopcommandermcp)
6
7
  [![smithery badge](https://smithery.ai/badge/@wonderwhy-er/desktop-commander)](https://smithery.ai/server/@wonderwhy-er/desktop-commander)
7
8
  [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-yellow.svg)](https://www.buymeacoffee.com/wonderwhyer)
@@ -18,10 +19,22 @@ Work with code and text, run processes, and automate tasks, going far beyond oth
18
19
 
19
20
  ## 👋 We’re hiring — come build with us: https://desktopcommander.app/careers/
20
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
+
21
35
  ## Table of Contents
22
36
  - [Features](#features)
23
37
  - [How to install](#how-to-install)
24
- - [Remote MCP (ChatGPT, Claude Web)](#remote-mcp-chatgpt-claude-web)
25
38
  - [Getting Started](#getting-started)
26
39
  - [Usage](#usage)
27
40
  - [Handling Long-Running Commands](#handling-long-running-commands)
@@ -41,23 +54,27 @@ Execute long-running terminal commands on your computer and manage processes thr
41
54
  ## Features
42
55
 
43
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
44
58
  - **Enhanced terminal commands with interactive process control**
45
59
  - **Execute code in memory (Python, Node.js, R) without saving files**
46
60
  - **Instant data analysis - just ask to analyze CSV/JSON/Excel files**
47
61
  - **Native Excel file support** - Read, write, edit, and search Excel files (.xlsx, .xls, .xlsm) without external tools
48
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
49
64
  - **Interact with running processes (SSH, databases, development servers)**
50
65
  - Execute terminal commands with output streaming
51
66
  - Command timeout and background execution support
52
67
  - Process management (list and kill processes)
53
68
  - Session management for long-running commands
69
+ - **Process output pagination** - Read terminal output with offset/length controls to prevent context overflow
54
70
  - Server configuration management:
55
71
  - Get/set configuration values
56
72
  - Update multiple settings at once
57
73
  - Dynamic configuration changes without server restart
58
74
  - Full filesystem operations:
59
- - Read/write files (text, Excel, PDF)
75
+ - Read/write files (text, Excel, PDF, DOCX)
60
76
  - Create/list directories
77
+ - **Recursive directory listing** with configurable depth and context overflow protection for large folders
61
78
  - Move files/directories
62
79
  - Search files and content (including Excel content)
63
80
  - Get file metadata
@@ -72,14 +89,23 @@ Execute long-running terminal commands on your computer and manage processes thr
72
89
  - All tool calls are automatically logged
73
90
  - Log rotation with 10MB size limit
74
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
75
97
 
76
98
  ## How to install
77
99
 
78
- Desktop Commander offers multiple installation methods to fit different user needs and technical requirements.
100
+ ### Install in Claude Desktop
79
101
 
80
- > **📋 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>
81
108
 
82
- ### Option 1: Install through npx ⭐ **Auto-Updates** **Requires Node.js**
83
109
  Just run this in terminal:
84
110
  ```
85
111
  npx @wonderwhy-er/desktop-commander@latest setup
@@ -100,36 +126,42 @@ Restart Claude if running.
100
126
  **🔄 Manual Update:** Run the setup command again
101
127
  **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
102
128
 
103
- ### Option 2: Using bash script installer (macOS) ⭐ **Auto-Updates** **Installs Node.js if needed**
104
- 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
+
105
134
  ```
106
135
  curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
107
136
  ```
108
- This script handles all dependencies and configuration automatically for a seamless setup experience.
137
+ This script handles all dependencies and configuration automatically.
109
138
 
110
- **✅ Auto-Updates:** Yes - requires manual updates
139
+ **✅ Auto-Updates:** Yes
111
140
  **🔄 Manual Update:** Re-run the bash installer command above
112
141
  **🗑️ Uninstall:** Run `npx @wonderwhy-er/desktop-commander@latest remove`
113
142
 
114
- ### Option 3: Installing via Smithery ⭐ **Auto-Updates** **Requires Node.js**
143
+ </details>
115
144
 
116
- 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>
117
147
 
118
- 1. **Visit the Smithery page:** https://smithery.ai/server/@wonderwhy-er/desktop-commander
148
+ 1. **Visit:** https://smithery.ai/server/@wonderwhy-er/desktop-commander
119
149
  2. **Login to Smithery** if you haven't already
120
150
  3. **Select your client** (Claude Desktop) on the right side
121
151
  4. **Install with the provided key** that appears after selecting your client
122
152
  5. **Restart Claude Desktop**
123
153
 
124
- The old command-line installation method is no longer supported. Please use the web interface above for the most reliable installation experience.
125
-
126
154
  **✅ Auto-Updates:** Yes - automatically updates when you restart Claude
127
155
  **🔄 Manual Update:** Visit the Smithery page and reinstall
128
156
 
129
- ### 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
+
130
162
  Add this entry to your claude_desktop_config.json:
131
163
 
132
- - On Mac: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
164
+ - On Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`
133
165
  - On Windows: `%APPDATA%\Claude\claude_desktop_config.json`
134
166
  - On Linux: `~/.config/Claude/claude_desktop_config.json`
135
167
 
@@ -150,10 +182,13 @@ Restart Claude if running.
150
182
 
151
183
  **✅ Auto-Updates:** Yes - automatically updates when you restart Claude
152
184
  **🔄 Manual Update:** Run the setup command again
153
- **🗑️ 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>
154
191
 
155
- ### ### Option 5: Checkout locally ❌ **Manual Updates** **Requires Node.js** ❌ **Manual Updates** **Requires Node.js**
156
- 1. Clone and build:
157
192
  ```bash
158
193
  git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
159
194
  cd DesktopCommanderMCP
@@ -161,27 +196,20 @@ npm run setup
161
196
  ```
162
197
  Restart Claude if running.
163
198
 
164
- The setup command will:
165
- - Install dependencies
166
- - Build the server
167
- - Configure Claude's desktop app
168
- - 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.
169
200
 
170
201
  **❌ Auto-Updates:** No - requires manual git updates
171
202
  **🔄 Manual Update:** `cd DesktopCommanderMCP && git pull && npm run setup`
172
- **🗑️ 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
173
204
 
174
- ### Option 6: Docker Installation 🐳 ⭐ **Auto-Updates** **No Node.js Required**
175
-
176
- 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>
177
206
 
178
- #### Prerequisites
179
- - [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed **and running**
180
- - Claude Desktop app installed
207
+ <details>
208
+ <summary><b>Option 6: Docker Installation 🐳 ⭐ Auto-Updates (No Node.js Required)</b></summary>
181
209
 
182
- **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.
183
211
 
184
- #### Automated Installation (Recommended)
212
+ **Prerequisites:** [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed **and running**, Claude Desktop app installed.
185
213
 
186
214
  **macOS/Linux:**
187
215
  ```bash
@@ -190,29 +218,15 @@ bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommande
190
218
 
191
219
  **Windows PowerShell:**
192
220
  ```powershell
193
- # Download and run the installer (one-liner)
194
221
  iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'))
195
222
  ```
196
223
 
197
- The automated installer will:
198
- - Check Docker installation
199
- - Pull the latest Docker image
200
- - Prompt you to select folders for mounting
201
- - Configure Claude Desktop automatically
202
- - Restart Claude if possible
203
-
204
- #### How Docker Persistence Works
205
- Desktop Commander creates a persistent work environment that remembers everything between sessions:
206
- - **Your development tools**: Any software you install (Node.js, Python, databases, etc.) stays installed
207
- - **Your configurations**: Git settings, SSH keys, shell preferences, and other personal configs are preserved
208
- - **Your work files**: Projects and files in the workspace area persist across restarts
209
- - **Package caches**: Downloaded packages and dependencies are cached for faster future installs
210
-
211
- 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.
212
225
 
213
- #### Manual Docker Configuration
226
+ **Docker persistence:** Your tools, configs, work files, and package caches all survive restarts.
214
227
 
215
- If you prefer manual setup, add this to your claude_desktop_config.json:
228
+ <details>
229
+ <summary>Manual Docker Configuration</summary>
216
230
 
217
231
  **Basic setup (no file access):**
218
232
  ```json
@@ -220,12 +234,7 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
220
234
  "mcpServers": {
221
235
  "desktop-commander-in-docker": {
222
236
  "command": "docker",
223
- "args": [
224
- "run",
225
- "-i",
226
- "--rm",
227
- "mcp/desktop-commander:latest"
228
- ]
237
+ "args": ["run", "-i", "--rm", "mcp/desktop-commander:latest"]
229
238
  }
230
239
  }
231
240
  }
@@ -238,9 +247,7 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
238
247
  "desktop-commander-in-docker": {
239
248
  "command": "docker",
240
249
  "args": [
241
- "run",
242
- "-i",
243
- "--rm",
250
+ "run", "-i", "--rm",
244
251
  "-v", "/Users/username/Desktop:/mnt/desktop",
245
252
  "-v", "/Users/username/Documents:/mnt/documents",
246
253
  "mcp/desktop-commander:latest"
@@ -271,77 +278,208 @@ If you prefer manual setup, add this to your claude_desktop_config.json:
271
278
  }
272
279
  ```
273
280
 
274
- #### Docker Benefits
275
- ✅ **Controlled Isolation:** Runs in sandboxed environment with persistent development state
276
- ✅ **No Node.js Required:** Everything included in the container
277
- ✅ **Cross-Platform:** Same experience on all operating systems
278
- ✅ **Persistent Environment:** Your tools, files, configs, and work survives restarts
279
-
280
- **✅ Auto-Updates:** Yes - `latest` tag automatically gets newer versions
281
- **🔄 Manual Update:** `docker pull mcp/desktop-commander:latest` then restart Claude
281
+ </details>
282
282
 
283
- #### Docker Management Commands
283
+ <details>
284
+ <summary>Docker Management Commands</summary>
284
285
 
285
286
  **macOS/Linux:**
286
-
287
- Check installation status:
288
287
  ```bash
288
+ # Check status
289
289
  bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --status
290
- ```
291
290
 
292
- Reset all persistent data (removes all installed tools and configs):
293
- ```bash
291
+ # Reset all persistent data
294
292
  bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset
295
293
  ```
296
294
 
297
295
  **Windows PowerShell:**
298
-
299
- Check status:
300
296
  ```powershell
297
+ # Check status
301
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
302
- ```
303
299
 
304
- Reset all data:
305
- ```powershell
300
+ # Reset all data
306
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
307
- ```
308
302
 
309
- Show help:
310
- ```powershell
303
+ # Show help
311
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
312
305
  ```
313
306
 
314
- Verbose output:
315
- ```powershell
316
- $script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -VerboseOutput
317
- ```
318
-
319
- #### Troubleshooting Docker Installation
320
- If you broke the Docker container or need a fresh start:
307
+ **Troubleshooting:** Reset and reinstall from scratch:
321
308
  ```bash
322
- # Reset and reinstall from scratch
323
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)
324
310
  ```
325
- This will completely reset your persistent environment and reinstall everything fresh with exception of not touching mounted folders
326
311
 
327
- ## 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)
328
340
 
329
- 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).
330
342
 
331
- **👉 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.
332
344
 
333
- The website provides complete instructions for:
334
- - Installing and running the Remote Device on your computer
335
- - Connecting your AI service (ChatGPT, Claude, etc.)
336
- - 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>
337
356
 
338
- ### 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.
339
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:
340
478
  1. You run a lightweight **Remote Device** on your computer
341
479
  2. It connects securely to the cloud Remote MCP service
342
480
  3. Your AI sends commands through the cloud to your device
343
481
  4. Commands execute locally, results return to your AI
344
- 5. **You stay in control** - stop anytime with `Ctrl+C`
482
+ 5. **You stay in control** stop anytime with `Ctrl+C`
345
483
 
346
484
  ### Security
347
485
 
@@ -349,6 +487,8 @@ The website provides complete instructions for:
349
487
  - ✅ Commands execute under your user permissions
350
488
  - ✅ Secure OAuth authentication and encrypted communication channel
351
489
 
490
+ </details>
491
+
352
492
  ## Updating & Uninstalling Desktop Commander
353
493
 
354
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