Opencode hangs after loading Context7 Remote MCP server
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:
-
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 } } } -
Launch Opencode.
-
Wait for the interface to fully load.
-
Attempt to enter a prompt and press Enter.
-
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!
I think the same happens with Github remote MCP servers.
So I think the issue appears to be related to MCP... Related: https://github.com/sst/opencode/issues/1208
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?
I think the same happens with Github remote MCP servers.
Yah. Same Here for other remote ones.
Same here for remote ones. Had to use local context7
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
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.
@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.
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.
fixed in latest