OpenCode version: 1.15.13
OS: Linux
MCP Server: Custom JSON-RPC server on VPS (Streamable HTTP)
Configuration
Expected behavior
With oauth: false explicitly set, OpenCode should send the static headers on every request to the remote MCP server.
Actual behavior
opencode mcp list shows "✓ Bot connected"
opencode mcp debug Bot returns "401 Unauthorized"
- Tools from this MCP are not available to agents
- Direct curl to the same endpoint with same headers WORKS:
curl -X POST http://<vps-ip>:8899/jsonrpc \
-H "Content-Type: application/json" \
-H "X-Bot-Token: <token>" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"run_bot","arguments":{"message":"test"}},"id":1}' \
# Returns successful response from MCP server
Analysis
This appears similar to:
But the specific case of static custom headers with oauth: false returning 401 does not match exactly.
The server appears "connected" in mcp list but the actual tool calls fail with 401. This suggests OpenCode may be trying OAuth anyway despite oauth: false, or headers are being dropped during the tool call request phase.
Workaround
Using curl directly works:
curl -s -X POST http://<vps-ip>:8899/jsonrpc \
-H "Content-Type: application/json" \
-H "X-Bot-Token: <token>" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"run_bot","arguments":{"message":"\$1"}},"id":1}'
OpenCode version: 1.15.13
OS: Linux
MCP Server: Custom JSON-RPC server on VPS (Streamable HTTP)
Configuration
Expected behavior
With
oauth: falseexplicitly set, OpenCode should send the staticheaderson every request to the remote MCP server.Actual behavior
opencode mcp listshows "✓ Bot connected"opencode mcp debug Botreturns "401 Unauthorized"Analysis
This appears similar to:
But the specific case of static custom headers with oauth: false returning 401 does not match exactly.
The server appears "connected" in
mcp listbut the actual tool calls fail with 401. This suggests OpenCode may be trying OAuth anyway despiteoauth: false, or headers are being dropped during the tool call request phase.Workaround
Using curl directly works: