Guide · Cursor IDE

MCP server with Cursor IDE

Cursor has native MCP support, letting you connect custom tools that appear directly in Agent mode alongside Cursor's built-in capabilities. The config file lives in two places depending on whether you want the server available globally or only in a specific project. Cursor supports both stdio (local subprocess) and HTTP transport (remote servers). Once connected, Cursor's MCP panel lets you inspect which tools are loaded and test them — but it won't tell you if a remote server degrades between sessions. This guide covers setup, transport selection, and monitoring.

TL;DR

For a global server (all projects): edit ~/.cursor/mcp.json. For a project-scoped server: create .cursor/mcp.json in the project root and add it to .gitignore if it contains secrets. Use command + args for local stdio servers; use url for remote HTTP servers. Reload MCP servers from Cursor's Settings → Features → MCP or the command palette (MCP: Reload Servers). Verify in the MCP panel that your server shows a green dot and lists its tools. For remote servers, add the public URL to AliveMCP for continuous protocol-level monitoring between Cursor sessions.

Config file locations

Cursor reads MCP server configuration from two places, processed in priority order:

If both files exist, project-scoped config takes precedence for servers with the same name. Servers with unique names from both files are merged into a single list.

The format follows the same structure used by Claude Desktop's claude_desktop_config.json:

{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"]
    }
  }
}

Store project-scoped configs with secrets in .cursor/mcp.json and add that path to .gitignore. Commit a .cursor/mcp.json.example with placeholder values so teammates know what variables to fill in.

stdio transport: local server setup

For servers running on the same machine as Cursor, stdio is the simplest transport. Cursor spawns your server as a subprocess when a session starts, communicates via stdin/stdout, and terminates it when the session ends.

// ~/.cursor/mcp.json
{
  "mcpServers": {
    "my-tools": {
      "command": "node",
      "args": ["/Users/you/projects/my-mcp-server/dist/index.js"],
      "env": {
        "DATABASE_URL": "postgresql://localhost/mydb",
        "LOG_LEVEL": "error"
      }
    }
  }
}

Use absolute paths for both the command and args. Cursor's subprocess environment may not include your shell's PATH or custom environment setup from .zshrc / .bash_profile. If node isn't found, use the full path: /usr/local/bin/node (find it with which node).

For TypeScript projects using tsx or ts-node:

{
  "mcpServers": {
    "my-ts-server": {
      "command": "/usr/local/bin/npx",
      "args": ["tsx", "/Users/you/projects/my-server/src/index.ts"]
    }
  }
}

Keep server startup fast — Cursor's Agent mode calls tools synchronously and users notice lag during initialization. Avoid connecting to remote databases or external APIs during the initialize handshake; defer those connections to the first tool call or use connection pooling with pre-warmed connections. See MCP server cold start optimization for techniques.

HTTP transport: remote server setup

Cursor supports HTTP transport for MCP servers, enabling connections to servers deployed on Railway, Render, Fly.io, or any public HTTPS endpoint. The SSE endpoint URL goes in the url field:

{
  "mcpServers": {
    "remote-tools": {
      "url": "https://my-mcp-server.fly.dev/sse"
    }
  }
}

If your server requires authentication, add a headers field:

{
  "mcpServers": {
    "remote-tools": {
      "url": "https://my-mcp-server.fly.dev/sse",
      "headers": {
        "Authorization": "Bearer your-api-key"
      }
    }
  }
}

For the StreamableHTTP transport variant (used by newer MCP SDK versions), the URL points to the main endpoint rather than a dedicated SSE path. Cursor's HTTP client handles both SSE streaming and standard HTTP request-response patterns, so the same url field works for both transport variants — the server negotiates which mode to use during the initialize exchange.

See MCP server SSE transport and MCP server HTTP transport for server-side implementation details.

Reloading servers without restarting Cursor

Unlike Claude Desktop, Cursor doesn't require a full restart to reload MCP config changes. You can reload servers from:

After reloading, Cursor re-reads the config files and restarts all server connections. For stdio servers, this means killing and respawning the subprocess. For HTTP servers, this means closing and reopening the SSE connection.

During development, save the config file and run "MCP: Reload Servers" to pick up changes without losing your Cursor window state. If a server fails to connect after reload, the error appears in the MCP panel immediately rather than silently.

Inspecting servers in Cursor's MCP panel

Cursor shows connected MCP servers in its settings panel. Navigate to Settings → Features → MCP to see:

When Cursor's Agent mode is active, tools from all connected MCP servers appear in the tool use area. Cursor automatically selects which tools to call based on the conversation — you don't need to explicitly reference tool names unless you want to force a specific tool call.

If a tool is not appearing, verify in the MCP panel that the server is connected and that the tool name matches what the server advertises via tools/list. Tool names are case-sensitive.

Troubleshooting connection failures

Common failure patterns and how to diagnose them:

Server shows red in MCP panel:

Server connects but tools don't appear:

Tools call but return errors:

stdio server crashes on startup:

See MCP server debugging for a comprehensive troubleshooting workflow.

Monitoring remote MCP servers used from Cursor

Cursor's MCP panel only checks server status when you open Settings or reload servers. Between sessions, there's no visibility into whether a remote server has gone down, had its SSL certificate expire, or is returning errors for tool calls.

For remote MCP servers connected to Cursor, add the server URL to AliveMCP. AliveMCP runs the full initializetools/list handshake from an external network on a regular schedule and alerts you when the protocol layer fails. This means you learn about outages before a Cursor session tries to use a tool and gets a cryptic failure rather than after.

See MCP server observability for how to combine external monitoring with Cursor's MCP panel for full visibility.

Related questions

Does Cursor's MCP support work in all modes (Chat, Composer, Agent)?

MCP tool calls are available in Cursor's Agent mode. In standard Chat mode, Cursor uses its own built-in tools (codebase search, file reads, terminal). Agent mode enables external MCP tool calls alongside Cursor's native tools. If you're not seeing your MCP tools invoked, verify you're in Agent mode (not standard Chat mode) when sending the request.

Can I share an MCP config with my team via a committed file?

Yes, but exclude secrets. Commit .cursor/mcp.json with placeholder values and a comment directing teammates to copy and fill in their own credentials. For team-wide tools that don't require per-user secrets (a shared company knowledge base, for example), a committed config works fine. For tools needing personal API keys, use the global ~/.cursor/mcp.json which stays on each developer's machine.

How does Cursor decide which MCP tool to call?

Cursor uses the tool name and description in tools/list to select tools. Write tool descriptions that clearly state what the tool does and when it should be used. Include example scenarios in the description — Cursor's Agent mode uses these to match user intent to the right tool. Ambiguous or generic descriptions lead to tools being called inappropriately or not at all.

Does Cursor support MCP resources and prompts (not just tools)?

Cursor's MCP integration primarily surfaces tools — the tools/list endpoint. Resources and prompts from the MCP spec are not currently exposed in Cursor's UI. If you need to surface file contents or templates, model them as tool calls that return the relevant content rather than as MCP resources. This is a Cursor product decision independent of the MCP spec.

Further reading