Skip to content

feat(mcp): ship the MCP server with the app and add a "Connect an AI client" card - #124

Merged
lukyrys merged 3 commits into
mainfrom
feat/mcp-connect-ai-client
Oct 27, 2026
Merged

lukyrys merged 3 commits into
mainfrom
feat/mcp-connect-ai-client

Conversation

@blackenzee

@blackenzee blackenzee commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

Stacked on #98. Before this change, connecting an AI client meant cloning the repo and building services/mcp-server by hand, because the server was not in the installer. The GUI also had no setup instructions.

  • Packaging. npm run bundle builds the MCP server with esbuild into a single ESM index.js (about 800 KB).

    • npm run stage:mcp stages it before electron-vite build in dist, dist:mac and dist:linux, and it ships as the mcp-server extraResource. CI needs no workflow change.
    • A single file keeps the installer small and avoids a second node_modules tree in electron-builder.
    • Verified: an unpacked Linux package contains resources/mcp-server/index.js, and that file answers initialize and tools/list over stdio. A vitest test builds the bundle and checks the tool count over stdio.
  • Path resolution. Main resolves the bundle path:

    • packaged: resources/mcp-server/index.js
    • AppImage: copied to ~/.wdc/mcp-server/index.js, because the AppImage mount path changes on every launch
    • dev: the repo build

    Preload exposes the path with the token-file status.

  • "Connect an AI client" card on the MCP page:

    • the mcp.enabled switch (the same setting as Settings → Advanced)
    • live status: enabled, token file present, bundle found, and the last MCP call, refreshed on mcp:tool-call
    • copy buttons:
      • Claude Code: claude mcp add --scope user nks-wdc -- node "<path>" (syntax checked against claude mcp add --help)
      • Claude Desktop (claude_desktop_config.json) and Cursor (.cursor/mcp.json): {"mcpServers":{"nks-wdc":{"command":"node","args":["<path>"]}}}
  • mcp_disabled responses now carry a hint saying where to enable MCP.

  • READMEs describe the claude mcp add flow. The tool counts are counted from source (72 tools; 33 in --readonly); before, the READMEs said 48 and 67.

Screenshots

First run Connected
Expanded snippets Czech, narrow

Verification

dotnet build WebDevConsole.sln -c Release && dotnet test WebDevConsole.sln -c Release --no-build   # 202 + 972
cd src/frontend && npx vue-tsc --noEmit && npx electron-vite build
cd services/mcp-server && npx tsc --noEmit && npx vitest run

Needs a manual check in packaged builds:

  • the path shown on Windows, macOS and AppImage;
  • that node (18+) on the user's PATH runs it;
  • that macOS signing accepts the extra .js resource.

- 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
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7be791d6-0a4a-468c-948c-727fc6784e45

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lukyrys
lukyrys changed the base branch from refactor/program-endpoints-2 to main October 27, 2026 15:03
@lukyrys
lukyrys merged commit bc256b9 into main Oct 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants