Skip to content

fix(opencode): disconnect dynamically added mcp servers#29452

Merged
rekram1-node merged 2 commits into
devfrom
fix/mcp-disconnect-dynamic-server
May 26, 2026
Merged

fix(opencode): disconnect dynamically added mcp servers#29452
rekram1-node merged 2 commits into
devfrom
fix/mcp-disconnect-dynamic-server

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

  • keep dynamically added MCP server configs in instance state
  • let MCP status/connect/disconnect resolve runtime-added servers
  • add HTTP API regression coverage and an SDK proof script for add/disconnect

Tests

  • bun run prove:mcp-disconnect (packages/sdk/js)
  • bun test test/server/httpapi-mcp.test.ts --timeout 30000 (packages/opencode)
  • bun typecheck (packages/opencode)
  • bun typecheck (packages/sdk/js)

@rekram1-node rekram1-node merged commit c0bc020 into dev May 26, 2026
10 checks passed
@rekram1-node rekram1-node deleted the fix/mcp-disconnect-dynamic-server branch May 26, 2026 23:28
Astro-Han added a commit to Astro-Han/pawwork that referenced this pull request Jun 10, 2026
## Summary

- Serialize MCP auth file read-modify-write mutations with EffectFlock so concurrent token and client-info updates do not overwrite each other.
- Preserve runtime-added MCP server config in the MCP service state so status, reconnect, and tool timeout paths can still resolve dynamic servers.
- Add focused MCP auth and lifecycle tests covering concurrent auth mutation and dynamic config persistence.

## Verification

Local verification before PR:

- `bun test test/mcp/auth.test.ts --timeout 30000`: 1 pass, 0 fail.
- `bun test test/mcp/lifecycle.test.ts --timeout 30000`: 26 pass, 0 fail.
- `bun test test/mcp --timeout 30000`: 46 pass, 0 fail.
- `bun run typecheck`: `tsgo --noEmit` passed.
- `git diff --check`: no whitespace errors.

PR verification:

- Fresh-eye review found no actionable P0-P3 issues.
- Gemini Code Assist left no review comments.
- GitHub CI passed, including ci, CodeQL, dependency-review, desktop-smoke, e2e-artifacts, dev-dep-audit, pr-title-lint, pr-triage, and windows-advisory.

## Related

- Upstream-value Line A A2 MCP reliability.
- Upstream references: anomalyco/opencode#29852 and anomalyco/opencode#29452.
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
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