anomalyco / anomalyco/opencode
fernando-brain MCP SSE transport: tools/call returns -32602 after successful handshake
Open
@rekram1-node is already working on this.
Since Jul 25, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Description
The fernando-brain MCP server over SSE transport returns -32602 on all tools/call requests from the opencode client (v1.18.5). The SSE handshake succeeds (HTTP 200, correct endpoint event), but every tool invocation fails.
Steps to reproduce
- Configure a remote MCP server with SSE transport:
{ "mcp": { "fernando-brain": { "type": "remote", "url": "https://srv1300387.hstgr.cloud/sse", "enabled": true } } } - Start opencode. The server connects (
endpointevent received, tools list populated). - Call any MCP tool (e.g.,
retrieve_context). Result:-32602(Invalid params).
Evidence
- The SSE handshake succeeds (HTTP 200,
endpointevent formessage?sessionId=...). tools/listreturns correctly (tools are visible in the client).tools/callfails with-32602.- Using
curldirectly against the SSE endpoint works fine — the server responds correctly. - The issue is specifically in the opencode client SSE transport layer.
Root cause hypothesis
Two possibilities:
- Missing initialize handshake: opencode may skip the JSON-RPC initialize/initialized handshake for SSE transport (as opposed to Streamable HTTP). The server may reject calls without prior initialization.
- Parameter encoding mismatch: opencode may encode the
argumentsfield differently than the server expects over SSE.
Related upstream issues
- #25287
- #37626
Workaround
Test manually with curl, or switch to streamable-http transport if the server supports it.
Environment
- opencode version: 1.18.5
- Platform: macOS
- MCP transport: SSE (remote)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.