Skip to content

feat: register codedb in Windsurf + Devin via mcpsync#521

Merged
justrach merged 1 commit into
release/0.2.5824from
feat/windsurf-devin-mcpsync
Jun 1, 2026
Merged

feat: register codedb in Windsurf + Devin via mcpsync#521
justrach merged 1 commit into
release/0.2.5824from
feat/windsurf-devin-mcpsync

Conversation

@justrach

@justrach justrach commented Jun 1, 2026

Copy link
Copy Markdown
Owner

What & why

codedb's installer auto-registers the MCP server in Claude Code, Codex, Gemini CLI, Cursor — but not Windsurf or Devin. This PR adds those two, delegating them to mcpsync (the codegraff tool that keeps MCP servers in sync across AI tools, and already targets both).

Design: augment, not replace. The four existing per-client registrations are untouched; mcpsync's footprint is scoped to exactly Windsurf + Devin. Net diff is +74/−2 across 3 files, no Zig logic rewritten.


Changes, part by part

1. install/install.sh — new register_windsurf_devin() (+62)

Called from main() immediately after register_cursor "$dest". Flow:

  1. Locate mcpsynccommand -v mcpsync, then fall back to ~/.local/bin, ~/bin, /usr/local/bin.
  2. Auto-install if missingcurl -fsSL https://mcpsync.codegraff.com | bash (same trust domain as codedb's own installer). Wrapped in || true and followed by a re-probe; if mcpsync still isn't found it prints windsurf/devin: skip (mcpsync unavailable) and returns — it never fails the codedb install.
  3. Write the source of truth — adds codedb to ~/.mcpconfig.json (mcpsync's single owned config) via python3:
    "codedb": { "command": "<bin>", "args": ["mcp"], "transport": "stdio" }
    We write this file directly rather than calling mcpsync add, because mcpsync add auto-syncs to every detected tool — writing the file ourselves keeps the sync scoped to the two named tools below, so Claude/Codex/Gemini/Cursor (registered above) are not re-touched. A python3-less fallback uses mcpsync add.
  4. Sync only the two new toolsmcpsync sync windsurf devin. This is additive (existing servers untouched) and mcpsync skips tools that aren't installed, so it's a no-op for users without Windsurf/Devin.

2. src/nuke.zig — deregister Windsurf + Devin (+10)

deregisterInstalledIntegrations now also strips codedb from:

  • Windsurf — ~/.codeium/windsurf/mcp_config.json
  • Devin — ~/.config/devin/config.json

Both store servers under a standard mcpServers object, so the existing deregisterJsonIntegrationFile handles them unchanged — other servers and Devin's non-mcpServers keys are preserved. codedb nuke stays a complete uninstall.

3. README.md — docs (+2/−2)

Feature table and the Install section now list Windsurf + Devin and link mcpsync, noting it's auto-installed and that uninstalled tools are skipped.


Config paths (reference)

Tool Path Layout
Windsurf ~/.codeium/windsurf/mcp_config.json { mcpServers: {...} }
Devin ~/.config/devin/config.json mcpServers is a peer of other keys
(source of truth) ~/.mcpconfig.json owned by mcpsync

Testing

End-to-end, against the real install.sh function. Sourced register_windsurf_devin() into a sandboxed HOME with Windsurf + Devin present (each pre-seeded with an unrelated server / extra key):

✓ windsurf/devin → via mcpsync (~/.mcpconfig.json)
  • codedb added to both configs;
  • additive — pre-existing keep-me server and Devin's other key both preserved;
  • separately verified: with neither tool installed, mcpsync sync windsurf devin reports not installed, skipped and writes nothing.

Other checks:

  • bash -n install/install.sh — clean.
  • zig build test670/670 (the nuke change is covered by the existing deregisterJsonIntegrationFile tests; no new test needed).

No real user configs were modified during testing (all in a throwaway HOME).


Safety properties

  • Never breaks the codedb install (mcpsync failures degrade to a skip line).
  • No litter — uninstalled tools are skipped, not created.
  • Additive everywhere — never removes a user's other MCP servers.
  • Idempotent — re-running the installer re-writes the same codedb entry.
  • Complete uninstall — codedb nuke removes codedb from Windsurf/Devin too.

Extends install-time MCP auto-registration beyond Claude/Codex/Gemini/Cursor
to Windsurf and Devin, delegating those two to mcpsync (the codegraff tool
that keeps MCP servers in sync across AI tools). Augment, not replace — the
four existing per-client registrations are untouched.

install/install.sh — new register_windsurf_devin(), called from main() right
after register_cursor:
  - locates mcpsync (PATH, then ~/.local/bin, ~/bin, /usr/local/bin);
  - auto-installs it (curl mcpsync.codegraff.com | bash) if missing, and never
    fails the codedb install if that is unavailable (prints a skip line);
  - writes codedb into mcpsync's source of truth ~/.mcpconfig.json directly via
    python3, NOT `mcpsync add` (which auto-syncs to every detected tool) — this
    keeps mcpsync's footprint to exactly Windsurf + Devin so the tools above are
    not re-touched;
  - runs `mcpsync sync windsurf devin` (named targets, additive; mcpsync skips
    tools that aren't installed, so it is a no-op for users without them);
  - python3-less fallback uses `mcpsync add`.

src/nuke.zig — deregisterInstalledIntegrations now also strips codedb from
Windsurf (~/.codeium/windsurf/mcp_config.json) and Devin
(~/.config/devin/config.json). Both store servers under a standard mcpServers
object, so the existing deregisterJsonIntegrationFile handles them; other
servers and non-mcpServers keys are preserved.

README.md — feature table + install section now list Windsurf and Devin.

Verified by sourcing the real register_windsurf_devin() into a sandboxed HOME
with Windsurf + Devin present: codedb is added to both configs additively
(pre-existing servers and Devin's peer keys preserved); uninstalled tools are
skipped. 670/670 tests pass; install.sh is `bash -n` clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54a7dce00d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install/install.sh
# Auto-install mcpsync if missing (same trust domain as codedb). Never fail the
# codedb install if this is unavailable.
if [ -z "$mcpsync_bin" ]; then
curl -fsSL https://mcpsync.codegraff.com | bash >/dev/null 2>&1 || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop piping unverified mcpsync installer into bash

When mcpsync is not already installed, the codedb installer now executes whatever https://mcpsync.codegraff.com returns without a checksum, signature, pinned version, or even saving it for inspection. This introduces a new remote-code-execution path during a normal install and conflicts with the repo guidance to flag installer scripts that execute untrusted code or skip verification; please download a versioned artifact and verify it, or make this an explicit opt-in step.

Useful? React with 👍 / 👎.

Comment thread src/nuke.zig
Comment on lines +196 to +198
// Windsurf and Devin are registered via mcpsync; both store servers under a
// standard `mcpServers` object, so the JSON deregister handles them too.
const windsurf_config = std.fmt.allocPrint(allocator, "{s}/.codeium/windsurf/mcp_config.json", .{home}) catch return removed;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove codedb from mcpsync's source config on nuke

The installer now writes the codedb entry into ~/.mcpconfig.json before syncing Windsurf/Devin, but nuke only deletes the downstream tool configs here. In any environment where mcpsync remains installed, a later mcpsync sync can recreate a codedb MCP entry that points at the binary this command just removed, so codedb nuke is no longer a complete uninstall for the new registration path.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 91986 90483 -1.63% -1503 OK
codedb_changes 11055 11251 +1.77% +196 OK
codedb_context 943353 964784 +2.27% +21431 OK
codedb_deps 244 234 -4.10% -10 OK
codedb_edit 67170 53999 -19.61% -13171 OK
codedb_find 10502 10299 -1.93% -203 OK
codedb_hot 26553 27032 +1.80% +479 OK
codedb_outline 30717 30264 -1.47% -453 OK
codedb_read 15790 15535 -1.61% -255 OK
codedb_search 22718 22576 -0.63% -142 OK
codedb_snapshot 63733 63857 +0.19% +124 OK
codedb_status 9779 9646 -1.36% -133 OK
codedb_symbol 18459 18192 -1.45% -267 OK
codedb_tree 20681 22155 +7.13% +1474 OK
codedb_word 11948 12195 +2.07% +247 OK

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.

1 participant