Cursor mcp.json: how to add an MCP server to Cursor
Cursor can install some servers in one click from Customize > MCPs. Anything else goes in an mcp.json file: one in the project for the team, and one in your home folder for you. Both use a top-level mcpServers object.
Checked against Cursor's MCP documentation and help page on November 28, 2026.
Where the file goes
| File | Applies to | Commit it? |
|---|---|---|
.cursor/mcp.json in the project | That project | Yes, so teammates get the same servers. No real keys in it. |
~/.cursor/mcp.json | Every project you open in the editor or CLI | No, it is personal |
Cursor merges the two. If the same server name is in both, the project file wins. Hosted Cloud Agents do not read ~/.cursor/mcp.json; they use the servers set up at cursor.com/agents and your team's servers. Save the file and restart Cursor, then check the server's toggle under Customize > MCPs.
A local (stdio) server
Cursor starts the program on your machine. command must be on your PATH or a full path.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
}
}
} | Field | What it does |
|---|---|
type | "stdio". Cursor's reference lists it; its own examples often leave it out. |
command, args | The executable and its arguments, as an array. |
env | Environment variables for the server, ideally as ${env:NAME} references. |
envFile | A file of extra variables, such as ${workspaceFolder}/.env. Local servers only. |
A remote (HTTP or SSE) server
For a hosted server, give its URL instead of a command, plus headers if it takes a key:
{
"mcpServers": {
"my-service": {
"url": "https://api.example.com/mcp",
"headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" }
}
}
}
Variables, so keys stay out of the file
Cursor resolves variables in command, args, env, url and headers. Note the syntax differs from Claude Code and Copilot's ${NAME}:
${env:NAME}: an environment variable ${userHome}: your home folder ${workspaceFolder} and ${workspaceFolderBasename}: the project root (the folder that contains .cursor/mcp.json) and its name ${pathSeparator} or ${/}: the OS path separator
Remote servers cannot use envFile, so for them set the variable in your shell profile or system environment. If a server relies on a variable from your shell profile, restart Cursor after changing it.
OAuth with a fixed client ID
By default Cursor registers itself with an OAuth server automatically (dynamic client registration). When a provider gives you a fixed client ID instead, or requires an approved redirect URL, or does not support dynamic registration, add an auth object with CLIENT_ID, optional CLIENT_SECRET and scopes to the remote entry. These accept the same ${env:NAME} references.
When a server does not show up or start
- Check the path and name:
mcp.json inside a .cursor folder, in the project root or your home folder. - Check the JSON. A trailing comma or missing brace makes the whole file invalid.
- Open the Output panel (Cmd/Ctrl+Shift+U) and pick MCP Logs: start-up errors, failed sign-ins and crashes show there.
- Toggle the server off and on under Customize > MCPs, or remove and re-add it.
mcp.json entries for popular servers
Built from each server's entry in the official MCP Registry, the same as on their Socketlist pages. Data as of November 11, 2026. Replace anything in <angle brackets>.
playwright-mcp score 90
{
"mcpServers": {
"playwright-mcp": {
"command": "npx",
"args": [
"-y",
"@playwright/mcp"
]
}
}
}
Context7 score 90
{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
],
"env": {
"CONTEXT7_API_KEY": "${env:CONTEXT7_API_KEY}"
}
}
}
}
Figma-Context-MCP score 97
{
"mcpServers": {
"figma-context-mcp": {
"command": "npx",
"args": [
"-y",
"figma-developer-mcp",
"--stdio"
],
"env": {
"FIGMA_API_KEY": "${env:FIGMA_API_KEY}"
}
}
}
}
GitHub score 80
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"127.0.0.1:8085:8085",
"-e",
"GITHUB_OAUTH_CALLBACK_PORT=8085",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN=<token>",
"ghcr.io/github/github-mcp-server:2.1.0"
]
}
}
}
Every listed server has its Cursor entry on its own page; browse developer tools or search. Cursor Enterprise admins can limit which servers run: see MCP server allowlists. Before adding anything that touches real data, run through the security checklist.