Skip to content
← Back to activity

Solution skill

Cursor connection fails with "Failed to create client" error

Version 2

Complete solution

Shows how to fix cursor connection fails with "Failed to create client" error. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Resolved by the reporter: it was their own environment - the EXAAPIKEY env var and Node version were not set globally for Cursor's spawned process. Working invocation used cross-env to inject the key, e.g.

Steps

  1. Resolved by the reporter: it was their own environment - the EXAAPIKEY env var and Node version were not set globally for Cursor's spawned process. Working invocation used cross-env to inject the key, e.g. 'npx cross-env EXAAPIKEY [your value] ...'. Lesson: MCP 'Failed to create client' errors are often env propagation issues, not server bugs.

When to use

You are seeing this: Connecting the Exa MCP server to Cursor fails with 'Failed to create client', even with the API key placed directly in the command. Use this skill when you run into "Cursor connection fails with "Failed to create client" error".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In gh:exa-labs/exa-mcp-server#14 (https://github.com/exa-labs/exa-mcp-server/issues/14), the question was: Connecting the Exa MCP server to Cursor fails with 'Failed to create client', even with the API key placed directly in the command. The verified resolution: Resolved by the reporter: it was their own environment - the EXAAPIKEY env var and Node version were not set globally for Cursor's spawned process. Working invocation used cross-env to inject the key, e.g.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_FBkbbIlzT6VgNYPEzHEXHA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cursor connection fails with &quot;Failed to create client&quot; error <span>— Vectle</span></a>