mcp

Cursor MCP server won't connect: 7 checks before you rewrite auth

When an MCP server won't connect in Cursor, check the boring layers before you touch OAuth: which `mcp.json` file holds the entry, whether the entry matches the transport, whether a local command can actually start, and whether the environment variables it needs resolve. Only after that is it worth looking at the auth layer: client registration and the redirect URL. Cursor's docs say its MCP logs show "connection errors, authentication issues, or server crashes," so read them before each change. Restart the client so it re-reads the MCP config after every edit.

Who this is for

You added a server to Cursor, it doesn't connect, and you're about to rewrite your OAuth code. Run these in order first.

The 7 checks

#CheckWhat Cursor's docs sayGo deeper
1Right fileProject config lives in `.cursor/mcp.json`; global config in `~/.cursor/mcp.json`.—
2Entry matches transport`stdio` servers take a shell command; SSE and Streamable HTTP servers take a URL. Remote entries use `url`.MCP OAuth for Cursor and Claude
3Command can startA stdio `command` "Must be available on your system path or contain its full path."—
4Env vars resolve`envFile` is stdio-only. Remote servers don't support it; use `${env:NAME}` interpolation with variables set in your shell profile or system environment.—
5Read the logsMCP logs show "server initialization, tool calls, and error messages."MCP Inspector OAuth debugging
6Client registrationFor providers without Dynamic Client Registration, or with a fixed Client ID, add an `auth` object with `CLIENT_ID` (required), optional `CLIENT_SECRET` and `scopes`.Static client ID in mcp.json · When you need DCR
7Redirect URL registeredCursor uses fixed callbacks: `https://www.cursor.com/agents/mcp/oauth/callback` (web and Cursor Agents) and `http://localhost:8787/callback` (desktop). Register both if users sign in from both.Cursor OAuth redirect URI

Checks 1–5 are config and transport. Checks 6–7 are auth. If 1–5 fail, no amount of OAuth work will help.

Pitfalls

  • Editing the wrong file. Cursor has a project file and a global file. Confirm which one you changed.
  • Expecting `envFile` on a remote server. It only works for stdio. Remote entries need interpolated environment variables.
  • Hardcoding secrets. Cursor's docs say to use environment variables for Client ID and Client Secret instead of hardcoding them.
  • Treating a 401 as a connect failure. If the server answers 401, transport works and you're in the auth layer. Read the failure card and WWW-Authenticate and protected resource metadata in plain English before you change code.
  • Omitting scopes without knowing the fallback. If `scopes` is omitted, Cursor uses `/.well-known/oauth-authorization-server` to discover `scopes_supported`, so that endpoint has to answer.

How to check it

  1. Open the `mcp.json` you edited and confirm the server name, `command` or `url`, and env references.
  2. For stdio, run the same command in a terminal from the project root.
  3. Restart the client so it re-reads the MCP config.
  4. Read the MCP logs for the first error and fix only that.
  5. If the error is auth-related, move to checks 6 and 7 and the linked posts.

Where ShipKits fits

If you're building your own MCP server and want working servers to start from, the MCP Starter Kit ($27) is five Python FastMCP servers plus client-examples/claude-desktop-config.json. Connect Claude Desktop (and any MCP-compatible client, including Cursor) with the same python command, for example `python servers/filesystem/server.py`. If you only need to debug someone else's server, the checks above and the free templates at /free are enough. Cheat Sheet for the skim checklist mindset.

Soft next step

Run checks 1–5 now, before you open your auth code. For free templates, start at /free. When you want ready-made servers to connect and test against, the MCP Starter Kit ($27) has five.

FAQ

Why won't my MCP server connect in Cursor?+

Most failures come down to one of three layers: the config entry, the transport (the server not starting or the URL not answering), or auth. Check them in that order before changing any code.

How do I tell a config problem from an auth problem?+

If the server never starts or the URL never answers, it's config or transport. If the server answers with 401, the connection works and the problem is authorization, which needs its own checklist.

Should I rewrite my OAuth setup when the connection fails?+

Not first. Confirm the server runs and responds without the client, then work through the auth flow step by step; rewriting auth rarely fixes a server that isn't reachable.

What if the browser sign-in opens but the connection still fails?+

That usually points at the redirect or the token step, not the server. Debug the redirect URI and token exchange on their own rather than re-checking the whole setup.

Can I test the server outside Cursor?+

Yes. Use a standalone MCP client or inspector to connect directly; if it fails there too, the problem is the server, not Cursor.

Do I need to restart anything after editing the config?+

Restart the client so it re-reads the MCP config, then check the server's logs again before changing anything else.

Get the free starter

Value first, then a kit when you are ready. No fake urgency. Start with Harness Desk Starter at /free.