#112

fix: make mcp config writes idempotent

Opentakagibit18wants to merge intofrom

Summary

This PR makes dev3000’s automatic MCP config updates idempotent and safer when config files already contain a dev3000 entry.

  • Add a shared upsertMcpServerConfig helper for Claude, Cursor, and OpenCode config shapes
  • Update stale dev3000 localhost MCP URLs when the MCP port changes
  • Avoid rewriting config files when the dev3000 entry is already up to date
  • Preserve existing MCP servers and top-level config fields
  • Preserve OpenCode enabled: false
  • Avoid overwriting custom user-managed dev3000 entries

Why

dev3000 keeps MCP client config files around between runs. If the MCP port changes, an existing dev3000 entry can point at a stale localhost URL, while repeated runs should not rewrite files that are already current.

This keeps the auto-config behavior useful while making the write path more conservative and predictable.

Tests

  • pnpm.cmd test src\utils\mcp-configs.test.ts
  • pnpm.cmd exec tsc --noEmit --pretty false
  • pnpm.cmd exec biome check src\dev-environment.ts src\utils\mcp-configs.ts src\utils\mcp-configs.test.ts
  • git diff --check

Activity

2
vercel[bot]5mo ago

@takagibit18 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.