Command reference ยท Cursor CLI
agent mcp login <identifier>
Authenticates with an MCP server configured in mcp.json.
agent mcp login <identifier> is a terminal subcommand and is called directly in the shell. It authenticates you with an MCP server configured in .cursor/mcp.json (project) or ~/.cursor/mcp.json (global) โ needed for servers with their own authentication, such as OAuth. According to the documentation, the CLI uses a streamlined login flow with automatic callback handling for this; right after a successful login, the agent has access to the server's authenticated tools.
In interactive mode there is no separate /mcp login slash command: login there instead runs via the /mcp browser, where you select a server and choose the Login option within it โ functionally identical, just via a menu instead of a direct terminal call.
If an already authenticated server just needs to be enabled globally instead of logged in again, agent mcp enable <identifier> is the right command.
โ WHEN TO USE IT?
Make an OAuth server usable for the first time
Run agent mcp login linear to get access to a server with its own authentication
Renew an expired login
Run agent mcp login <identifier> again if a previously connected server is no longer authenticated
โ WHEN NOT TO?
Just enable a server globally
agent mcp login concerns authentication, not enabling a server.
Better: Use agent mcp enable <identifier>
SOURCES
- Cursor Docs โ CLI Reference: Parameters โ cursor.com
- Cursor Docs โ CLI MCP โ cursor.com
MORE COMMANDS ยท Cursor CLI