Opencode hangs after loading Context7 Remote MCP server #876

Closed
opened 2026-02-16 17:28:38 -05:00 by yindo · 10 comments
Owner

Originally created by @lichman0405 on GitHub (Jul 23, 2025).

Originally assigned to: @thdxr on GitHub.

Description:

We are experiencing a critical issue when attempting to load a remote MCP server in Opencode using the context7 endpoint.

After launching Opencode with the following configuration, the interface loads but completely freezes upon trying to send a message. The input prompt becomes unresponsive, and no messages are sent or rendered.

Reproduction Steps:

  1. Add the following configuration to opencode.json:
    { "$schema": "https://opencode.ai/config.json", "theme": "opencode", "provider": { "moonshot": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://api.moonshot.ai/v1" }, "models": { "kimi-k2-0711-preview": {} } } }, "autoshare": false, "autoupdate": true, "mcp": { "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "enabled": true } } }

  2. Launch Opencode.

  3. Wait for the interface to fully load.

  4. Attempt to enter a prompt and press Enter.

  5. Observe: the interface freezes — no response, no error message shown.

Please advise if:

There's a known compatibility issue with this endpoint?

MCPs require specific response schema to be valid?

Additional debugging or logs are needed from our side?

Thanks in advance for your support!

Originally created by @lichman0405 on GitHub (Jul 23, 2025). Originally assigned to: @thdxr on GitHub. Description: We are experiencing a critical issue when attempting to load a remote MCP server in Opencode using the context7 endpoint. After launching Opencode with the following configuration, the interface loads but completely freezes upon trying to send a message. The input prompt becomes unresponsive, and no messages are sent or rendered. Reproduction Steps: 1. Add the following configuration to opencode.json: `{ "$schema": "https://opencode.ai/config.json", "theme": "opencode", "provider": { "moonshot": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://api.moonshot.ai/v1" }, "models": { "kimi-k2-0711-preview": {} } } }, "autoshare": false, "autoupdate": true, "mcp": { "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "enabled": true } } }` 2. Launch Opencode. 3. Wait for the interface to fully load. 4. Attempt to enter a prompt and press Enter. 5. Observe: the interface freezes — no response, no error message shown. Please advise if: There's a known compatibility issue with this endpoint? MCPs require specific response schema to be valid? Additional debugging or logs are needed from our side? Thanks in advance for your support!
yindo closed this issue 2026-02-16 17:28:38 -05:00
Author
Owner

@ingwarsw commented on GitHub (Jul 23, 2025):

I think the same happens with Github remote MCP servers.

@ingwarsw commented on GitHub (Jul 23, 2025): I think the same happens with Github remote MCP servers.
Author
Owner

@RoRep1ay commented on GitHub (Jul 23, 2025):

So I think the issue appears to be related to MCP... Related: https://github.com/sst/opencode/issues/1208

@RoRep1ay commented on GitHub (Jul 23, 2025): So I think the issue appears to be related to MCP... Related: https://github.com/sst/opencode/issues/1208
Author
Owner

@lichman0405 commented on GitHub (Jul 23, 2025):

So I think the issue appears to be related to MCP... Related: #1208

Truely. I am working on it to find out the issue.

BTW: DeepSeek-Chat is not able to "call tools", have you ever try?

@lichman0405 commented on GitHub (Jul 23, 2025): > So I think the issue appears to be related to MCP... Related: [#1208](https://github.com/sst/opencode/issues/1208) Truely. I am working on it to find out the issue. BTW: DeepSeek-Chat is not able to "call tools", have you ever try?
Author
Owner

@lichman0405 commented on GitHub (Jul 23, 2025):

I think the same happens with Github remote MCP servers.

Yah. Same Here for other remote ones.

@lichman0405 commented on GitHub (Jul 23, 2025): > I think the same happens with Github remote MCP servers. Yah. Same Here for other remote ones.
Author
Owner

@dan-myles commented on GitHub (Jul 23, 2025):

Same here for remote ones. Had to use local context7

@dan-myles commented on GitHub (Jul 23, 2025): Same here for remote ones. Had to use local context7
Author
Owner

@BasixKOR commented on GitHub (Jul 23, 2025):

Seems like this is what I have been experiencing now. As a note, it seems like after about 5 minutes of waiting the agent "times out" and works on a first retry.

My log: https://gist.github.com/BasixKOR/2a30a9be382e63ce3d51ff9acae2785d

@BasixKOR commented on GitHub (Jul 23, 2025): Seems like this is what I have been experiencing now. As a note, it seems like after about 5 minutes of waiting the agent "times out" and works on a first retry. My log: https://gist.github.com/BasixKOR/2a30a9be382e63ce3d51ff9acae2785d
Author
Owner

@adrielp commented on GitHub (Jul 24, 2025):

This is an issue with multiple MCPs that doesn't occur in other tools. I haven't been able to get any remote MCPs to work since before *.46. I have three I use mainly, Honeycomb, Context7, and then one I wrote. None work within OpenCode. All work within other tools. Log's don't provide any information.

@adrielp commented on GitHub (Jul 24, 2025): This is an issue with multiple MCPs that doesn't occur in other tools. I haven't been able to get any remote MCPs to work since before *.46. I have three I use mainly, Honeycomb, Context7, and then one I wrote. None work within OpenCode. All work within other tools. Log's don't provide any information.
Author
Owner

@adrielp commented on GitHub (Jul 24, 2025):

@lichman0405 - if you set https://mcp.context7.com/mcp to https://mcp.context7.com/sse it should work. Basically, the current MCP code for Remote only supports sse which is deprecated (IIRC) in favor of http streaming. The current ai library being used in opencode is a pretty minimal client that doesn't full support the current MCP spec. To get http streamable to work we'd need to pass in the http streamable transport directly.

@adrielp commented on GitHub (Jul 24, 2025): @lichman0405 - if you set `https://mcp.context7.com/mcp` to `https://mcp.context7.com/sse` it should work. Basically, the current MCP code for Remote only supports [sse](https://github.com/sst/opencode/blob/dev/packages/opencode/src/mcp/index.ts#L35-L41) which is [deprecated](https://mcp-framework.com/docs/Transports/sse/) (IIRC) in favor of `http streaming`. The current `ai` library being used in opencode is a pretty minimal client that doesn't full support the current MCP spec. To get http streamable to work we'd need to pass in the http streamable transport directly.
Author
Owner

@lichman0405 commented on GitHub (Jul 24, 2025):

Thanks for the insight, @adrielp . I’ve also deployed a few scientific-computation-oriented MCPs on a private cloud. The architecture looks like this: host → client → fastMCP → FastAPI (containerized). These MCPs are callable via OpenCode without issue.

However, context7 seems to be the only one that fails in this setup. I had suspected it might be due to transport protocol incompatibilities—possibly related to the server not responding correctly to the SSE expectations or the client mishandling HTTP streaming fallback.

I’m still actively debugging this and will share more once I have concrete findings.

@lichman0405 commented on GitHub (Jul 24, 2025): Thanks for the insight, @adrielp . I’ve also deployed a few scientific-computation-oriented MCPs on a private cloud. The architecture looks like this: host → client → fastMCP → FastAPI (containerized). These MCPs are callable via OpenCode without issue. However, context7 seems to be the only one that fails in this setup. I had suspected it might be due to transport protocol incompatibilities—possibly related to the server not responding correctly to the SSE expectations or the client mishandling HTTP streaming fallback. I’m still actively debugging this and will share more once I have concrete findings.
Author
Owner

@thdxr commented on GitHub (Jul 25, 2025):

fixed in latest

@thdxr commented on GitHub (Jul 25, 2025): fixed in latest
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#876