Configure a new MCP server
rules & mcp
// what it does
Define servers in ~/.cursor/mcp.json (global) or .cursor/mcp.json (project). A stdio server gives command, args, and optional env; an HTTP or SSE server just gives a url. The CLI shares this file with the editor, so servers you already set up there work in the terminal with no extra config.
// shell
$ { "mcpServers": { "linear": { "command": "npx", "args": ["-y", "linear-mcp-server"], "env": { "API_KEY": "value" } } } }$ { "mcpServers": { "remote": { "url": "https://my-server.com/mcp" } } }// gotcha
env values are stored in plaintext in mcp.json, so a project-level .cursor/mcp.json with API keys should not be committed. Because the file is shared with the editor, a malformed server entry breaks MCP in both the CLI and the editor at once.