promptgarten ๐ŸŒฑ

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

MORE COMMANDS ยท Cursor CLI

agent mcp listagent mcp list-tools <identifier>agent mcp enable <identifier>agent mcp disable <identifier>agent sandbox enableagent sandbox disableagent sandbox resetagent sandbox run <cmd> [args...]agent sandbox help [command]agent worker startagent worker debugagent worker help [command]

All commands ยท Cursor CLI โ†’

Share:๐•in๐Ÿ’ฌ