[FEATURE] Add claude mcp auth <name> command for on-demand MCP authentication
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
There is currently no way to trigger MCP server authentication from the command line. The only way to authenticate an MCP server that requires OAuth is to start a session and initiate the flow via /mcp.
Proposed Solution
Add an auth (or login) subcommand to claude mcp:
``bash``
# Trigger the OAuth flow for a specific MCP server
claude mcp auth <server-name>
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
``bash``
# Add and authenticate an MCP server in one scripted flow
claude mcp add my-server --transport http --url https://example.com/mcp
claude mcp auth my-server
# Browser opens, user completes OAuth, token is stored
# Server is now ready to use in the next session
Additional Context
Other AI coding tools have already implemented this pattern:
- Codex:
codex mcp login <name>— triggers OAuth authentication for a named MCP server - Cursor:
cursor mcp login <name>— same concept, authenticate an MCP server by name from the CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗