Skip to content

Fix duplicate local MCP servers on startup - #3405

Open
mohitdebian wants to merge 1 commit into
different-ai:devfrom
mohitdebian:fix/3325-duplicate-mcp-servers
Open

Fix duplicate local MCP servers on startup#3405
mohitdebian wants to merge 1 commit into
different-ai:devfrom
mohitdebian:fix/3325-duplicate-mcp-servers

Conversation

@mohitdebian

Copy link
Copy Markdown

PR Title

Fix duplicate local MCP servers on startup

PR Body

Fixes #3325

Description

This PR resolves an issue where the Node.js server would mistakenly double-register the primary workspace's local MCP servers during the startup sequence. Because the embedded engine natively loads opencode.json on boot, the subsequent loop pushing all workspace MCPs via the REST API caused duplicate background processes to spawn.

Changes Made

  • Modified syncAllWorkspacesRuntimeMcpToEngine to bypass network POST requests specifically for the primary workspace.
  • Updated syncRuntimeMcpToOpencodeEngine to mock an initial "connected" registration status for the bypassed workspace so the UI immediately reflects the correct state before the first SSE ping arrives.
  • Adjusted test assertions in mcp.engine-sync.e2e.test.ts and agent-context-diagnostics.test.ts to expect the network bypass behavior.

Testing

  • Automated E2E tests (mcp.engine-sync.e2e.test.ts and agent-context-diagnostics.test.ts) updated and passing.
  • Verified process tree generation is correctly deduplicated.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@mohitdebian is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, v0 Jul 31, 2026 11:30pm

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.

[Bug]: Local MCP servers are started twice on launch

1 participant