Cursor mcp.json: location, format and the enable toggle
Cursor reads MCP servers from mcp.json, either one in your home folder or one inside a project. The format is the same mcpServers JSON that Claude Desktop uses, with a few extra fields. The part that surprises people is that the on/off switch is not in the file at all.
| What | macOS | Windows |
|---|---|---|
| Global config | ~/.cursor/mcp.json | %USERPROFILE%\.cursor\mcp.json |
| Project config | .cursor/mcp.json in the project root | |
| Format and key | Plain JSON, servers under mcpServers | |
Global or project? A server in ~/.cursor/mcp.json is available everywhere; one in a project’s .cursor/mcp.json belongs to that project. Cursor’s documentation does not say which one wins when both define the same name, so give a server the same name in both places only if you can tell which one you are testing.
The shape of an entry
A local (stdio) server has a command, optional args and optional env. A remote server has a url and optional headers.
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["mcp-server.py"],
"env": { "API_KEY": "value" }
}
}
}
envFileloads environment variables from a file. It is for local servers only; remote servers do not support it.authis for remote servers and takesCLIENT_ID,CLIENT_SECRETandscopes.
Variables you can use
Cursor expands these in command, args, env, url and headers, which keeps secrets and machine-specific paths out of a file you commit:
${env:NAME}reads an environment variable${userHome}is your home folder${workspaceFolder}is the project root and${workspaceFolderBasename}its name${pathSeparator}(or${/}) is the separator for the operating system
The on/off toggle is not in the file
Cursor lets you switch a server off without removing it, from Customize in the sidebar. That state is stored inside Cursor, not in mcp.json. The file can look completely correct while the server is switched off in the interface, and editing the file cannot turn it back on. If a server is in the file and not running, check the toggle first.
Smaller things that cost time
~/.cursoroutlives Cursor. The folder stays after you uninstall the app, so finding it on a machine is not evidence that Cursor is installed.- Tool limits. Older write-ups describe a cap of 40 tools. Cursor’s current MCP documentation does not mention a tool-count limit.
- Absolute paths. An editor launched from the Dock or Start menu may not see the
PATHof your terminal. Ifnpxoruvxis not found, put the full path incommand; see why your MCP server is not showing up.