In this categoryCursor ยท 26
- How to Install Cursor and Import VS Code Settings (6 Minutes)Start
- Cursor Setup Guide: From Install to Your First AI Edit
- How to Set Up Project Rules in the .cursor/rules Folder
- How to Set Up Codebase Indexing in Cursor
- How to Enforce Project Conventions with Cursor Rules
- How to Write a Team Rule That Applies Only to Certain Files
- How to Migrate a Legacy .cursorrules File to the New Rules Folder
- How to Use Cursor Rules to Guide AI Edits
- How to Set Project Rules in Cursor
- How to Add a .cursorrules File to Steer Cursor
- How to Customize Cursor Keyboard Shortcuts
- How to Edit Multiple Files at Once with Cursor Composer
- How to Use Cursor Tab Completion Effectively
- How to Edit Code Inline with Cmd+K in Cursor
- How to Add Context to Cursor Chat with @ Mentions
- How to Choose and Switch AI Models in Cursor
- How to Add Library Docs as Context with @Docs in Cursor
- How to Generate and Maintain Tests with Cursor Composer
- How to Undo a Composer Change with Checkpoints in Cursor
- How to Use Cursor Agent Mode to Build a Feature End to End
- How to Connect an MCP Server to Cursor
- How to Refactor Across Your Whole Codebase in Cursor
- How to Query Your Database from Cursor with a Postgres MCP Server
- How to Let Cursor Run Commands Automatically (and Keep It Safe)
- How to Build a Full Feature Across Frontend and Backend with Composer
- How to Debug an MCP Server That Will Not Connect in Cursor
How to Debug an MCP Server That Will Not Connect in Cursor
Diagnose a red or failing MCP server in Cursor and get its tools showing up to the agent again.
You added an MCP server, but Cursor shows a red dot and the agent cannot see its tools. MCP failures almost always come down to a handful of causes: a bad command path, a missing runtime, a wrong argument, or a crash on startup. This guide walks through diagnosing each so you can get the server connected.
- An MCP server configured but showing as failed in Cursor
- A terminal to test the command by hand
- The server's documentation for its required arguments
Read the server's error in Cursor
Open the MCP settings page and look at the failing server. Cursor surfaces a short error and often a log toggle. The message usually points straight at the problem, such as a command not found or a missing argument.
Run the exact command yourself
Copy the command and args from your config and run them in a normal terminal. If it fails there too, the problem is the command, not Cursor. This isolates the issue in seconds.
Fix the common causes
Most failures map to one of these fixes. Work through them against the error you saw.
| Symptom | Likely fix |
|---|---|
spawn npx ENOENT | Install Node, or use an absolute path to the command in your config. |
| Connects then immediately drops | A required argument is missing; check the server docs and add it. |
| Authentication or 401 errors | An env var or token is missing; add it to the server's env block. |
| Works in terminal, fails in Cursor | PATH differs in the app; use a full path to node and the package. |
Pass environment variables correctly
If the server needs a token, add an env block to its config entry rather than relying on your shell environment, which Cursor may not inherit.
{
"mcpServers": {
"my-server": {
"command": "/usr/local/bin/node",
"args": ["/abs/path/to/server.js"],
"env": {
"API_TOKEN": "your-token-here"
}
}
}
}Result: a clear path from a red, failing server to a green one. Reproduce the command, read the error, apply the matching fix, and the agent sees the server's tools again.
Watch related tutorials
19:27
33:42
41:18
28:05
3:12
26:54New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.