Repository navigation
feat(mcp): add dcd mcp install, and lead the docs with the standalone binary - #267
Merged
Merged
Conversation
… binary dcd mcp install [claude-code|claude-desktop|cursor|vscode] adds the server to an AI tool: through claude mcp add or code --add-mcp, or by merging an entry into the Claude Desktop / Cursor JSON config. Entries start dcd by full path, since desktop apps don't see the shell's PATH. The install scripts point at dcd mcp install and print the full path. The README leads with dcd mcp install, then full-path configs for each client (with VS Code's own format), with npx as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The MCP docs told people to start the server with
npx. That needs Node 22+, checks npm every time the server starts, can run a different version than the user'sdcd, and bypasses the standalone binary the README tells people to install. A bare"command": "dcd"isn't a fix either: desktop apps (Claude Desktop, Cursor) opened from the Dock or Start menu don't read the shell rc that puts~/.dcd/binon PATH, so they fail with "command not found".What
dcd mcp install [client](new)claude-code,claude-desktop,cursor,vscode. Asks when left out (needs a TTY; otherwise errors with the list).claude mcp add --scope user devicecloud -- …, removing an olderdevicecloudentry first.code --add-mcp '{…}'(adds it to the user profile).claude_desktop_config.json/~/.cursor/mcp.jsonand keeps everything else in the file. A file that isn't plain JSON is left alone, and the error shows the entry to add by hand.process.execPath;nodeon PATH that is the same file (/opt/homebrew/bin/node), not Homebrew's versioned Cellar path thatbrew upgraderemoves, andargv[1]as started, not resolved, so the npm bin link survives upgrades.--read-only,--print(show what would be added, change nothing) and--json.runafter its subcommand, sodcd mcp'srunnow returns early when a subcommand is given. Plaindcd mcpstill starts the server as before.Install scripts
install.shandinstall.ps1listdcd mcp installunder "Get started" and print the binary's full path for hand-written configs.README
dcd login+dcd mcp install.serversplus"type": "stdio"), which the oldmcpServersexample didn't cover.npxstays as the fallback for npm users.CLAUDE.md: a note on the install command and the citty guard.
Testing
pnpm typecheck,pnpm lint(0 errors),pnpm test:unit: 471 passing, 9 new intest/unit/mcp-install.test.ts.dist/:--printfor all four clients; a real write to a temporary Cursor config (other entries and keys kept, second run reports "Updated", a non-JSON file left untouched);--json; unknown client and no-TTY errors;dcd mcp --read-onlystill starts the server.claude mcp add/remove --scopeandcode --add-mcpflags checked against their--help. Not run for real against Claude Code or VS Code, and not tested on Windows. On Windows,claudeandcodeare often.cmdshims, which a spawn without a shell can't find; the command then prints the line to run by hand.process.execPath).Related: devicecloud-dev/dcd#1820 (the same setup as a dashboard config generator).
🤖 Generated with Claude Code