How to add an MCP server to Cursor
Last verified against the official documentation linked below.
Cursor can install MCP servers in one click from its Marketplace, or read them from an mcp.json file. That file can live in a project (for that project's tools) or in your home folder (for every project). This guide follows Cursor's own MCP documentation.
Steps
Try the one-click route first
Open Customize in the sidebar and browse the Cursor Marketplace. Click 'Add to Cursor' on an entry to install it and sign in with OAuth if asked.
Source: cursor.com/docs/context/mcp
Or choose where an mcp.json goes
Create .cursor/mcp.json inside a project for project-specific tools, or ~/.cursor/mcp.json in your home folder for tools available everywhere.
Source: cursor.com/docs/context/mcp
Add a local (stdio) server
Give the command that starts the server, its arguments and any environment variables. The command must be on your PATH or be a full path.
{ "mcpServers": { "server-name": { "command": "npx", "args": ["-y", "mcp-server"], "env": { "API_KEY": "${env:API_KEY}" } } } }Source: cursor.com/docs/context/mcp
Or add a remote server
For a server reached over HTTP, give its URL and any headers it needs. Cursor supports OAuth for servers that require it.
{ "mcpServers": { "remote-server": { "url": "https://api.example.com/mcp", "headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" } } } }Source: cursor.com/docs/context/mcp
Keep secrets out of the file
Use ${env:NAME} to pull keys from environment variables instead of typing them into mcp.json. Cursor also resolves ${userHome} and ${workspaceFolder}.
Source: cursor.com/docs/context/mcp
Switch servers on or off
Open Customize in the sidebar and use the toggle next to a server. Disabled servers don't load or appear in chat.
Source: cursor.com/docs/context/mcp
Check it worked
- Ask the agent to use the server by name. Cursor asks for approval before running MCP tools by default; click the arrow next to the tool name to see its arguments. (cursor.com/docs/context/mcp)
- If it fails, open the Output panel (Cmd+Shift+U), pick 'MCP Logs' and look for connection, authentication or crash errors. (cursor.com/docs/context/mcp)
Safety notes
- Only install servers from developers and repositories you trust, check what data and APIs each one can reach, and give it API keys with the smallest permissions that work. (cursor.com/docs/context/mcp)
- For sensitive data, Cursor suggests running servers locally over stdio and reviewing their code first. (cursor.com/docs/context/mcp)
Related listings
More guides
- How to add an MCP server to Claude Desktop
- How to add an MCP server to VS Code
- Remote vs local MCP servers: how they differ and which to use
- MCP server security checklist
Sources: cursor.com/docs/context/mcp. Menus and file paths change between versions: if a step doesn't match what you see, follow the official page linked for that step.