Skip to content

Exa MCP endpoint (mcp.exa.ai) timing out while REST API works #6878

@chindris-mihai-alexandru

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.

Reference: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-520/

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

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions