Repository navigation
feat(mcp): ship the MCP server with the app and add a "Connect an AI client" card - #124
Merged
Merged
Conversation
- bundle services/mcp-server with esbuild into one ESM file (npm run bundle) and ship it as the mcp-server extraResource; dist, dist:mac and dist:linux stage it first via npm run stage:mcp - main resolves the bundle path (copied to ~/.wdc/mcp-server for AppImage) and preload exposes it with the MCP token file status - MCP hub card with copy buttons for claude mcp add, Claude Desktop and Cursor, the mcp.enabled switch and live status (enabled, token file, last MCP call) - mcp_disabled responses carry a hint on where to enable MCP - READMEs describe the claude mcp add flow and the current tool counts
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Summary
Stacked on #98. Before this change, connecting an AI client meant cloning the repo and building
services/mcp-serverby hand, because the server was not in the installer. The GUI also had no setup instructions.Packaging.
npm run bundlebuilds the MCP server with esbuild into a single ESMindex.js(about 800 KB).npm run stage:mcpstages it beforeelectron-vite buildindist,dist:macanddist:linux, and it ships as themcp-serverextraResource. CI needs no workflow change.node_modulestree in electron-builder.resources/mcp-server/index.js, and that file answersinitializeandtools/listover stdio. A vitest test builds the bundle and checks the tool count over stdio.Path resolution. Main resolves the bundle path:
resources/mcp-server/index.js~/.wdc/mcp-server/index.js, because the AppImage mount path changes on every launchPreload exposes the path with the token-file status.
"Connect an AI client" card on the MCP page:
mcp.enabledswitch (the same setting as Settings → Advanced)mcp:tool-callclaude mcp add --scope user nks-wdc -- node "<path>"(syntax checked againstclaude mcp add --help)claude_desktop_config.json) and Cursor (.cursor/mcp.json):{"mcpServers":{"nks-wdc":{"command":"node","args":["<path>"]}}}mcp_disabledresponses now carry a hint saying where to enable MCP.READMEs describe the
claude mcp addflow. The tool counts are counted from source (72 tools; 33 in--readonly); before, the READMEs said 48 and 67.Screenshots
Verification
Needs a manual check in packaged builds:
node(18+) on the user's PATH runs it;.jsresource.