How to add an MCP server to Cursor
Checked against the official docs:
MCP (Model Context Protocol) servers give Cursor's Agent extra tools, such as reading GitHub issues, driving a browser or looking up current library docs. There are two ways to add one: one click from Cursor's Customize panel, or a few lines in an mcp.json file. This guide covers both, with copy-paste configs and fixes for the errors people hit most.
Quick answer
- Create
~/.cursor/mcp.json(all your projects) or.cursor/mcp.jsonin your project folder (that project only). - Add the server under an
mcpServerskey: acommandfor a local server, or aurlfor a remote one (examples below). - Save the file and restart Cursor.
- Open Customize in the sidebar, then MCPs, and check the server is listed and switched on.
Prefer not to edit JSON? Use the one-click install first and come back to mcp.json for anything it doesn't list.
Option 1: one-click install from Customize
- Open Customize in Cursor's sidebar and click MCPs.
- Browse or search for the server you want.
- Click Add to Cursor next to it.
- Follow the sign-in (OAuth) prompts if the server asks for them.
These entries come from the Cursor Marketplace. Cursor also points to cursor.directory for community plugins and MCP servers; community servers aren't reviewed by Cursor, so check who publishes them before installing.
Option 2: add a server with mcp.json
Where the file goes
- Global (just you, every project):
~/.cursor/mcp.jsonin your home folder. - Project (this project, can be shared with your team through git):
.cursor/mcp.jsonin the project root.
Cursor merges both files. If the same server name appears in both, the project file wins.
A local (stdio) server
A local server is a program Cursor starts on your machine. You give it a command and optional args and env. This adds Playwright MCP, which lets the Agent open and control a browser (it needs Node.js 18 or newer):
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}The key (playwright here) is just a label you choose. The command has to be on your system PATH or be a full path to the program.
A remote server (URL)
A remote server is hosted by the provider and reached over HTTP. Cursor supports Streamable HTTP and SSE endpoints with a url. This adds the Notion MCP server. After saving, enable it in Customize and complete Notion's OAuth sign-in to connect your workspace:
{
"mcpServers": {
"notion": {
"url": "https://mcp.notion.com/mcp"
}
}
}A remote server that needs a token
Some servers take an API key or token in a header instead of OAuth. The GitHub MCP Server's Cursor guide uses a GitHub personal access token as a Bearer header. Rather than pasting the token into the file, read it from an environment variable with ${env:NAME}:
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${env:GITHUB_PAT}"
}
}
}
}Set GITHUB_PAT in your shell profile (for example export GITHUB_PAT=... in ~/.zshrc), then restart Cursor so it picks up the variable. Give the token only the repositories and permissions you want the Agent to have.
Several servers in one file
Each server is one entry inside the same mcpServers object. Separate entries with a comma, and don't leave a comma after the last one:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
},
"notion": {
"url": "https://mcp.notion.com/mcp"
}
}
}Keep API keys out of mcp.json
A project .cursor/mcp.json is meant to be committed, so never put real keys in it. Cursor resolves these variables in command, args, env, url and headers:
${env:NAME}: an environment variable.${userHome}: your home folder.${workspaceFolder}: the project root (the folder that contains.cursor/mcp.json).${workspaceFolderBasename}: the project folder's name.${pathSeparator}or${/}: the OS path separator.
Local (stdio) servers can also load variables from a file with envFile, for example "envFile": "${workspaceFolder}/.env". Remote servers don't support envFile, so use ${env:NAME} for them. Keep .env in .gitignore.
{
"mcpServers": {
"my-local-server": {
"command": "npx",
"args": ["-y", "some-mcp-server"],
"envFile": "${workspaceFolder}/.env"
}
}
}Check that it works
- Open Customize → MCPs. The server should be listed with its toggle on.
- In the Agent chat, ask for something only that server can do, for example "Use playwright to open https://example.com and tell me the page title".
- Approve the tool call. Cursor asks for approval before running MCP tools unless your approval settings (Cursor Settings → Agents → Approvals & Execution) let them run; click the arrow next to the tool name to see the arguments it will send.
Common errors and fixes
The server doesn't show up
- Check the path and name: the file must be
mcp.jsoninside a.cursorfolder, either in your home folder or in the project root. - Check the JSON. A trailing comma, a missing quote or a missing closing brace makes the file invalid. Paste it into any JSON validator.
- Restart Cursor after editing the file.
Read the MCP logs
Open the Output panel (Cmd+Shift+U on Mac, Ctrl+Shift+U on Windows/Linux) and pick MCP Logs from the dropdown. It shows connection errors, authentication problems and server crashes, which usually name the fix.
"command not found" or the server exits immediately
- Most local servers start with
npxoruvx, so install Node.js (fornpx) or uv (foruvx) first, then restart Cursor. - If Cursor still can't find it, use the full path to the program in
command(runwhich npxon macOS/Linux orwhere npxon Windows to get it). - Run the same command in a terminal (for example
npx @playwright/mcp@latest). If it errors there, the message tells you what's missing. If it starts and waits silently, the server works and the problem is in the config. - On Windows, some servers' READMEs (such as the official Filesystem server) launch
npxthroughcmd /c: set"command": "cmd"and put"/c", "npx"at the start ofargs.
The server can't see my API key
If the server relies on variables set in your shell profile, make sure Cursor can see them and restart Cursor after changing the profile. For local servers, putting the key in env or an envFile avoids the problem.
Authentication fails on a remote server
- For token servers, check the header format (
Authorization: Bearer <token>), that the token hasn't expired, and that it has the permissions the tool needs. - For OAuth servers, remove the server in Customize → MCPs and add it again to restart the sign-in.
A Docker-based server won't start
Servers that run with "command": "docker" (such as the local version of the GitHub MCP Server) need Docker Desktop installed and running before Cursor starts them.
An npm-based server is stuck on an old version
Cursor's docs suggest removing the server in Customize, running npm cache clean --force, then adding it again.
Too many tools
Every server adds tools the Agent has to choose from. Switch off servers you're not using with their toggle in Customize → MCPs; disabled servers don't load or appear in chat, and you keep their config.
Stay safe with MCP servers
- Install servers from the company or project that makes them. Our listings link to each official repo or docs page.
- Use the narrowest key you can: read-only modes, restricted tokens, a single project or repository.
- Read tool calls before approving them, especially ones that write, delete or spend money.
- Be careful with servers that read outside content (web pages, issues, emails): that text can carry prompt-injection instructions.
Good servers to try first
- Context7: current, version-specific library docs in the chat.
- GitHub MCP Server: issues, pull requests and Actions runs.
- Playwright MCP or Chrome DevTools MCP: let the Agent open and check your app in a real browser.
- Figma MCP Server: design context from a Figma frame link.
- Linear MCP or Notion MCP: tickets and specs.
- Supabase MCP Server or Neon MCP Server: your database (start in read-only mode).
See every server we list in MCP Servers. Each page has setup steps checked against the official docs.
FAQ
Should I use the global or the project mcp.json?
Use ~/.cursor/mcp.json for personal tools you want everywhere, and .cursor/mcp.json for tools a project's team should share. Keep keys out of the project file with ${env:NAME}.
Which transports does Cursor support?
stdio (a local command Cursor starts), SSE and Streamable HTTP (both by URL). If a provider offers both a /sse and an /mcp endpoint, use the one its docs recommend for Cursor.
Can I turn a server off without deleting it?
Yes. Use the toggle next to it in Customize → MCPs.
Using Claude Code too?
Claude Code reads the same kind of mcpServers entries but stores them differently. See the best MCP servers for Claude Code for the claude mcp add commands.
Sources
Commands and config above come from these official docs. Tools change often, so check them for the latest steps.
- Cursor docs: Model Context Protocol (MCP)
- Cursor help: MCP integrations
- GitHub MCP Server: install in Cursor
- Playwright MCP README
- Notion docs: Get started with MCP
- Filesystem MCP server README (Windows config)
PluginStack is independent and not affiliated with or endorsed by the companies mentioned. Spotted something out of date? Email pluginstackai@gmail.com.
Tools in this guide
- MCP Servers · Upstash
Context7
Pulls up-to-date, version-specific library documentation and code examples into your prompt, so the AI stops relying on outdated training data or made-up APIs.
- MCP Servers · GitHub
GitHub MCP Server
Official MCP server from GitHub that lets AI tools read repositories and code, manage issues and pull requests, check GitHub Actions runs and review security findings, all through natural language.
- MCP Servers · Microsoft
Playwright MCP
Microsoft's MCP server that gives an AI agent a real browser via Playwright. It works from the page's structured accessibility snapshot instead of screenshots, so no vision model is needed.
- MCP Servers · Figma
Figma MCP Server
Brings design context from your Figma files into AI coding tools so they can generate code that matches your designs. The remote server can also write to the canvas (in beta), creating and editing content in your Figma files.
- MCP Servers · Notion
Notion MCP
Notion's hosted MCP server that lets AI tools search, read, create and update pages and databases you have access to in your Notion workspace.
- Rules & Prompts · Cursor
Cursor Rules
Cursor's rules feature gives the Agent persistent instructions. Project rules are .mdc files in .cursor/rules, and there are also User Rules, Team Rules and plain AGENTS.md files.