简体中文 · Upstream project · Windows manager
A personal Desktop Commander branch for working with local files and commands from ChatGPT. It adds Terminal and Diff MCP Apps, extends the existing file preview, and adds batch text editing with per-file conditional undo.
The base MCP server is by Eduards Ruzga and the Desktop Commander contributors. My work covers the ChatGPT integration, the interfaces and file-operation changes described below, and a separate Windows tray manager. The original documentation is preserved in README.upstream.md.
| Area | This branch |
|---|---|
| Terminal | Shows the command, process output and completion state in an inline MCP App; supports refreshing long-running output. |
| Diff | Starts with modified content, with an optional before/after comparison, file selector and per-file cancellation. |
| Batch edits | Preflights text replacements in memory and records the actual before/after content from each write. |
| Write coordination | Shares canonical-path locks between writes, edits and undo, including aliases that resolve to the same file. |
| Conditional undo | Restores one file only while its content still matches that snapshot's after-state. Later changes are reported as a conflict. |
| Original files | Returns image/audio content or an embedded MCP resource rather than only extracted text. Batch requests preserve order and report individual errors. |
| ChatGPT recovery | Uses the host bootstrap result and persisted state. Diff recovery is bound to the current tool-call snapshot ID. |
File Preview and the Markdown editor already exist upstream. This branch extends their display and host integration; it does not claim them as new implementations.
These are screenshots from local use. Machine-specific paths have been covered. The companion repository contains the Windows tray and official Tunnel UI screenshots.
Tested with Node.js 22 on Windows. Use a client that supports MCP Apps to display the interfaces; a text-only MCP client can still call the underlying tools.
git clone --branch custom/chatgpt-ui https://github.com/SANG4242/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm ci --ignore-scripts
npm run build
node dist/index.jsThe process uses stdio: configure the MCP client with node as the command and the absolute path to dist/index.js as its argument. Running the upstream npm package will install the upstream version, not these changes.
For ChatGPT web, the setup used here is:
ChatGPT → OpenAI Secure MCP Tunnel → local tunnel-client → this MCP server
The companion manager documents the Windows layout, profiles and service controls. Tunnel access and MCP Apps availability depend on the host and account. The tunnel client itself is an official dependency, not part of this fork.
Build first, then run the focused checks in sequence. The configuration override prevents tests from changing the normal Desktop Commander configuration.
$env:DESKTOP_COMMANDER_CONFIG_DIR = "$PWD/.runtime/test-config"
node test/test-widget-state-runtime.js
node test/test-diff-call-identity.js
node test/test-terminal-ui.js
node test/test-batch-edit-undo.js
node test/test-read-media-file.jsThe batch-edit and media tests retain uniquely named fixture directories for inspection. Remove them after reviewing the results. These focused checks do not represent a full upstream test-suite run.
- Undo snapshots are in memory, with limits of 10 MB per file, 40 MB per batch, and 100 MB / 40 entries / 10 minutes for the store. They are short-term recovery data, not a backup system.
- Undo checks file content; it rejects an older snapshot when the file has since changed.
read_media_file.pathsaccepts up to 10 files with a 50 MiB raw-byte budget. Single-filepathcurrently has no hard size limit; use small files. Concurrent file growth during reading remains a boundary to harden.- Original PDF return has been exercised in ChatGPT. Batch return has local regression coverage; full browser verification remains pending.
- ChatGPT may collapse tool sections after many calls. Display modes and persistence vary by host. Diff call-identity recovery has a mocked-host regression test; the release fix still needs a new live ChatGPT check.
- Other preview Apps retain the upstream/earlier recovery behavior. Cross-card anonymous recovery outside Diff needs further work.
- File allowlists and command checks are guardrails, not process isolation. Review SECURITY.md, authorize only the directories you need, and keep credentials outside that scope.
The branch retains upstream history. Start with src/ui/terminal/, src/ui/diff/, src/tools/batch-edit.ts, src/utils/path-operation-lock.ts, and src/utils/diff-snapshot-store.ts for the personal changes. Development used AI assistance for implementation and iteration, with local debugging and verification.
Keep an upstream remote and merge upstream changes into the customization branch after reviewing conflicts. This fork is distributed as source; the upstream npm and MCP Registry release workflow is gated to the upstream repository.
MIT. Original copyright notices are retained. Personal modifications are also provided under MIT.



