Skip to content

MCP client failing makes opencode hang. #3273

Closed

Description

@cvkmohan

Description

Suppose we configure opencode with an MCP server - for example tidewave. Now tidewave will run well as long as phx.server is running fine. For whatever reason, suppose there is a compilation error and at that time, phx.server gets stopped - tidewave also gets stopped. Now, opencode which has in its config a running MCP tidewave server also stops working. I think it is not the desired behavior. If an MCP server fails to init - opencode should ignore it and move on - rather than becoming non-functional.

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

OpenCode version

No response

Activity

  1. github-actions commented on Oct 19, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Contributor

    I think dax addressed this in a version of opencode that ships next week

  3. venzen commented on Nov 14, 2025

    @venzen

    I have a related issue in v0.15.31 where the LLM becomes unresponsive when an MCP connection closes during a session:

    8597 |   }
    8598 |   onClose() {
    8599 |     if (this.isClosed)
    8600 |       return;
    8601 |     this.isClosed = true;
    8602 |     const error = new MCPClientError({
                             ^
    MCPClientError: Connection closed
          cause: undefined,
     vercel.ai.error: true,
     vercel.ai.error.AI_MCPClientError: true,
    
          at onClose (../../node_modules/.bun/ai@5.0.8+d6123d32214422cb/node_modules/ai/dist/index.mjs:8602:19)
          at close (../../node_modules/.bun/@modelcontextprotocol+sdk@1.15.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:137:9)
          at close (../../node_modules/.bun/@modelcontextprotocol+sdk@1.15.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:133:9)
          at close (../../node_modules/.bun/ai@5.0.8+d6123d32214422cb/node_modules/ai/dist/index.mjs:8444:60)
          at close (../../node_modules/.bun/ai@5.0.8+d6123d32214422cb/node_modules/ai/dist/index.mjs:8440:17)
          at map (1:11)
          at <anonymous> (src/mcp/index.ts:40:7)
          at <anonymous> (src/mcp/index.ts:38:11)
    

    Is this expected behavior or shall I open a new bug for this?

  4. rekram1-node commented on Nov 14, 2025

    @rekram1-node
    Contributor

    @venzen if u run opencode upgrade 1.0.65 I think this was fixex

  5. lovato commented on Dec 19, 2025

    @lovato

    I dug to find something similar to my problem, and I think this is it. On my company, the MCP server I am testing through OAuth needs both VPN and Proxy (not in prod yet). Fair. But if it happens for my laptop to just be disconnected from the VPN and I just need to do other stuff using opencode, it just hangs, since THAT MCP server isn't reachable right now. I could put helpers to inject/remove the config for this test phase, but maybe there is a better way to approach the problem. On VSCode, all MCP configuration are just configuration bits, and you turn on/off they as you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions