# How do you add an MCP server in Cursor?

Source: https://codelifter.com/forum/posts/how-do-you-add-an-mcp-server-in-cursor/
Site: CodeLifter Forum, category MCP and tools
Published: 2026-11-25. Updated: 2026-11-25. Replies: 0.

## Question by CodeLifter editors (staff), 2026-11-25

Add an MCP server to Cursor in one of two ways: install it from the Cursor Marketplace through the Customize page, or write it into an `mcp.json` file. Use `.cursor/mcp.json` in a project for servers that belong to that repository, and `~/.cursor/mcp.json` for servers you want everywhere. Cursor asks before running MCP tools unless you change its Run Mode.

## Where does Cursor read MCP servers from?

Cursor's [MCP documentation](https://cursor.com/docs/mcp) names two configuration files and a graphical route:

| Route | Location | Use it for |
| --- | --- | --- |
| Project configuration | `.cursor/mcp.json` in the repository | Servers tied to one project, which you can commit for the team |
| Global configuration | `~/.cursor/mcp.json` in your home folder | Personal servers you want in every project |
| Marketplace | Customize page | Official plugins with one-click install and OAuth sign-in |

Teams can also distribute servers centrally: the same page describes Team MCP servers under the dashboard's Plugins and MCPs section, and team marketplaces that make them installable from Customize.

## How do you add a local server?

Local servers use the `stdio` transport: Cursor starts the program and talks to it over standard input and output. The docs list the fields: `type` (`"stdio"`), `command` ("Must be available on your system path or contain its full path"), optional `args`, `env` and `envFile`. A project file might look like this:

```json
{
  "mcpServers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"]
    }
  }
}
```

`${workspaceFolder}` is one of Cursor's interpolation variables; the docs define it as "project root (the folder that contains `.cursor/mcp.json`)", and the others are `${env:NAME}`, `${userHome}`, `${workspaceFolderBasename}` and `${pathSeparator}`. Interpolation works in `command`, `args`, `env`, `url` and `headers`. The docs add that `envFile` is "only available for STDIO servers".

The `mcpServers` shape is the same one other MCP clients use. The [Claude Desktop thread](/forum/posts/how-do-you-connect-an-mcp-server-to-claude-desktop/) shows the same Filesystem server in that app's config file, so a server's setup instructions written for another client usually carry over.

## How do you add a remote server?

Remote servers use `url` instead of `command`. Cursor supports both the SSE and Streamable HTTP transports for these, and the docs' table marks both as using OAuth for sign-in:

```json
{
  "mcpServers": {
    "remote-server": {
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}"
      }
    }
  }
}
```

For OAuth, the docs say Cursor uses "the authorization code flow with PKCE" and reads the server's protected resource metadata to find the authorisation server. If a provider gives you a fixed client ID instead of supporting dynamic registration, add an `auth` object with `CLIENT_ID`, optional `CLIENT_SECRET` and `scopes`, again preferably through `${env:...}` variables rather than literal values.

## How do you keep secrets out of the committed file?

A project `mcp.json` is meant to be shared, so treat it as public. The documentation's own advice for sensitive data is: "Use environment variables for secrets, never hardcode them", "Limit API key permissions to minimum required", and "Run sensitive servers locally with `stdio` transport." In practice:

1. Reference keys as `${env:NAME}` in `env`, `headers` or `auth`.
2. For local servers, point `envFile` at a `.env` file that is listed in `.gitignore`.
3. Use a token scoped to what the server needs, not your full account.

## Will Cursor run MCP tools without asking?

By default it asks: "Cursor asks for approval before using MCP tools by default." The docs then say MCP "follows the same Run Modes as terminal commands". Cursor's [Run Modes page](https://cursor.com/docs/agent/security/run-modes) describes three modes, set under **Settings > Agents > Approvals & Execution**:

- **Auto-review**: allowlisted calls run immediately and other MCP calls go to a classifier. The page warns that "Auto-review is not a security boundary" because "the classifier can make mistakes".
- **Allowlist**: only actions on your allowlist run without approval.
- **Run Everything**: "Every tool call runs automatically."

The sandbox described on that page applies to shell commands, not MCP tools, so an MCP server runs with whatever access its own process has. That is why the MCP project's [guide to local servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers) warns that a local server "runs with your user account permissions". Read a server's tool list before you allowlist it.

## How do you check it worked?

Open **Customize** in the sidebar: each server appears there with a toggle, and the docs note that "Disabled servers won't load or appear in chat." If one fails, open the Output panel (`Cmd+Shift+U` on macOS) and choose "MCP Logs" from the dropdown; it shows "server initialization, tool calls, and error messages." To update an npm-based server, the docs suggest removing it in Customize, running `npm cache clean --force`, and adding it again.

For choosing servers, CodeLifter's [MCP server directory](https://codelifter.com/mcp/) lists what each one can read, write and reach. The [Cursor thread](/forum/posts/what-is-cursor-and-how-is-it-different-from-vs-code-with-copilot/) covers the editor itself.

Checked on 12 November 2026.

## Short version

- Project servers go in `.cursor/mcp.json`; personal ones in `~/.cursor/mcp.json`; official plugins install from Customize.
- Local servers use `command` and `args`; remote servers use `url`, with OAuth or headers.
- Put secrets in `${env:NAME}` or an ignored `envFile`, never in the committed file.
- Cursor asks before MCP tool calls by default; Auto-review and Run Everything change that.
- Check status in Customize and errors under "MCP Logs" in the Output panel.

---
Cite as: CodeLifter Forum, "How do you add an MCP server in Cursor?", https://codelifter.com/forum/posts/how-do-you-add-an-mcp-server-in-cursor/, accessed 2026-11-25.
