-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Problem
The Exa MCP remote endpoint (https://mcp.exa.ai/mcp) experiences frequent timeouts and 520 Cloudflare errors when used with OpenCode, while the REST API (api.exa.ai) works without issues.
Error Messages
Timeout Error:
Request timeout after 5000ms
520 Cloudflare Error:
520: Web server returns an unknown error
Configuration Attempted
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp?exaApiKey=...&tools=web_search_exa,deep_search_exa,get_code_context_exa"
}Root Causes
After investigation, there appear to be two separate issues:
1. Timeout Issue (OpenCode-related)
OpenCode v1.1.1 introduced a 5000ms default timeout. The Exa MCP endpoint can take longer than 5 seconds to respond, causing timeout errors.
Fix: Add "timeout": 31000 to the config
2. 520 Cloudflare Error (Exa infrastructure issue)
The 520 error is a Cloudflare error meaning "web server returns an unknown error" - this occurs when Exa's origin server (behind Cloudflare) returns an empty or unexpected response.
Status: Exa team investigated and resolved this issue on January 5, 2026.
Workarounds
Option 1: Add timeout (for timeout issues)
"exa": {
"type": "remote",
"timeout": 31000,
"url": "https://mcp.exa.ai/mcp?exaApiKey=..."
}Option 2: Use local MCP server (recommended for reliability)
"exa": {
"type": "local",
"command": ["npx", "-y", "exa-mcp-server"],
"timeout": 60000,
"environment": {
"EXA_API_KEY": "your-api-key"
}
}The local server uses the REST API (api.exa.ai) directly, which is more stable than the remote MCP endpoint.
Related Issues
- HTTP SSE Endpoint returns 405 Method Not Allowed for standard GET connections (Breaks Generic MCP Clients) exa-labs/exa-mcp-server#86 - HTTP SSE Endpoint issues with remote MCP
- websearch_exa MCP timeout after opencode reinstall code-yeongyu/oh-my-opencode#493 - websearch_exa timeout
Status
- Timeout issue: Resolved with config changes (add timeout parameter)
- 520 Cloudflare errors: Fixed by Exa on January 5, 2026
- Recommended approach: Use local MCP server for best reliability