anomalyco / anomalyco/opencode
Remote Streamable HTTP MCP: GET /mcp 405 (POST-only server) treated as fatal — all tool invocations fail with generic 'An error occurred invoking'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
OpenCode 1.18.31, Linux. Remote MCP server (type: remote, url http://host:8310/mcp, Authorization header) implements POST-only Streamable HTTP: it returns 405 for GET /mcp (spec-conformant — GET stream is optional; server signals no stream support) while POST initialize → 200, notifications/initialized → 202, tools/list → 200 (verified with a minimal hand-rolled client).
Observed: any tool invocation in opencode run fails with the generic wrapper 'An error occurred invoking '. Server access logs show the failing sequence begins with GET /mcp → 405 from opencode, after which no tools/call POST is ever sent. The generic error hides the transport cause.
Expected: per the Streamable HTTP transport contract, a 405/406 response to the GET stream must be tolerated (client falls back to POST-only); tool calls should proceed over POST.
Minimal reproducer: (1) run any MCP Streamable HTTP server that does not implement GET stream (e.g. servers returning 405 on GET); (2) configure remote MCP in opencode.json; (3) call any tool via opencode run → generic invoke error; server log shows GET /mcp 405 preceding the failure.
Wire sequence (secret-safe): GET /mcp 405 → (client aborts) → zero POST tools/call. Same request set via a standards-conformant POST-only client succeeds end-to-end against the identical server.
Impact: all remote Streamable HTTP servers without GET-stream support are unusable through the normal MCP consumer path.
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.
Research direction
Reproduce the failure with a POST-only remote MCP server, the remote MCP settings in opencode.json, and opencode run. Trace the GET /mcp request that returns 405 and verify the client proceeds to a POST tools/call instead of aborting. Done means tool invocations succeed and the transport error is no longer reported only as a generic invocation failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100