Programmatically register MCP servers using the Cursor extension API
mcp.json
files directly. This is particularly useful for enterprise environments, onboarding tools, or MDM systems that need to dynamically configure MCP servers.
mcp.json
mcp.json
modificationsvscode.cursor.mcp.registerServer
config: ExtMCPServerConfig
- The server configuration objectvscode.cursor.mcp.unregisterServer
serverName: string
- The name of the server to unregistername
: Unique identifier for the serverserver.url
: The HTTP endpoint URLserver.headers
(optional): HTTP headers for authentication or other purposesname
: Unique identifier for the serverserver.command
: The executable commandserver.args
: Command line argumentsserver.env
: Environment variables