You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These might all be symptoms of a broader regression introduced in the 1.0.137 update. You may want to check if reverting or identifying the specific change in that version resolves multiple issues.
🔧 Fix for z.ai MCP Servers Stopped Working in v1.0.137
Problem
After updating to OpenCode v1.0.137, z.ai MCP servers (Web Search and Web Reader) stopped working and show connection failures in /status.
Root Cause
OpenCode v1.0.137 introduced OAuth authentication auto-detection for all remote MCP servers. This breaks existing API key-based authentication used by z.ai servers.
What changed:
OAuth is now enabled by default for all remote MCP servers
Custom headers (like API keys) are only used when OAuth is explicitly disabled
The system attempts OAuth authentication first, which fails for API key setups
Solution ✅
Update your OpenCode configuration to explicitly disable OAuth for z.ai MCP servers:
Check API Key: Ensure your z.ai API key is valid and active
Verify URLs: Confirm the MCP server URLs are correct
Check Network: Ensure you can reach the z.ai API endpoints
Restart OpenCode: Sometimes a full restart is required
Common Errors
needs_auth: OAuth is trying to authenticate → Add "oauth": false
failed: Connection error → Check API key and URL
disabled: Server is explicitly disabled → Remove "enabled": false
Migration Summary
This fix ensures backward compatibility while allowing the new OAuth feature to work with servers that support it. Most existing MCP server configurations will need the "oauth": false flag to continue working with API key authentication.
Related Issue: #5278 Version: OpenCode v1.0.137+ Last Updated: 2025-12-09
Activity
github-actions commentedon Dec 9, 2025
This issue appears to be related to changes in version 1.0.137. Several other issues were reported in the same version around the same time:
These might all be symptoms of a broader regression introduced in the 1.0.137 update. You may want to check if reverting or identifying the specific change in that version resolves multiple issues.
renanwilliam commentedon Dec 9, 2025
downgraded to
1.0.134and works fine:renanwilliam commentedon Dec 9, 2025
🔧 Fix for z.ai MCP Servers Stopped Working in v1.0.137
Problem
After updating to OpenCode v1.0.137, z.ai MCP servers (Web Search and Web Reader) stopped working and show connection failures in
/status.Root Cause
OpenCode v1.0.137 introduced OAuth authentication auto-detection for all remote MCP servers. This breaks existing API key-based authentication used by z.ai servers.
What changed:
Solution ✅
Update your OpenCode configuration to explicitly disable OAuth for z.ai MCP servers:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "zai-search": { "type": "remote", "url": "https://api.z.ai/mcp/search", "oauth": false, "headers": { "Authorization": "Bearer YOUR_ZAI_API_KEY" } }, "zai-reader": { "type": "remote", "url": "https://api.z.ai/mcp/reader", "oauth": false, "headers": { "Authorization": "Bearer YOUR_ZAI_API_KEY" } } } }Key changes:
"oauth": falseto each z.ai MCP server configurationheaders.AuthorizationfieldYOUR_ZAI_API_KEYwith your actual z.ai API keyConfiguration File Location
Your OpenCode configuration is typically located at:
~/.opencode/config.json%USERPROFILE%\.opencode\config.jsonVerification Steps
/statusto verify servers showconnectedstatusExpected Status After Fix
For Other MCP Servers
If you have other remote MCP servers using API key authentication, apply the same fix by adding
"oauth": falseto their configurations:{ "mcp": { "your-mcp-server": { "type": "remote", "url": "https://your-mcp-server.com", "oauth": false, "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }OAuth vs API Key Authentication
OAuth Authentication
Use when MCP server supports OAuth 2.0 flow:
{ "oauth": { "clientId": "your-client-id", "clientSecret": "your-client-secret", "scope": "required-scopes" } }API Key Authentication
Use
"oauth": false+headers.Authorizationfor API key authentication:{ "oauth": false, "headers": { "Authorization": "Bearer YOUR_API_KEY" } }Troubleshooting
Still Not Working?
Common Errors
needs_auth: OAuth is trying to authenticate → Add"oauth": falsefailed: Connection error → Check API key and URLdisabled: Server is explicitly disabled → Remove"enabled": falseMigration Summary
This fix ensures backward compatibility while allowing the new OAuth feature to work with servers that support it. Most existing MCP server configurations will need the
"oauth": falseflag to continue working with API key authentication.Related Issue: #5278
Version: OpenCode v1.0.137+
Last Updated: 2025-12-09
fix: add oauth: false to OpenCode MCP gateway config