anthropics / anthropics/claude-code

Feature request: store MCP OAuth tokens separately from the Claude account credential (multi-account machines)

Ouverte
#92,748 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:auth area:mcp enhancement
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

### What feature would you like?

Separate storage (or native partitioning) of MCP OAuth tokens from the Claude account login credential.

Today `~/.claude/.credentials.json` holds both `claudeAiOauth` (the Claude login itself) and `mcpOAuth` (every MCP server sign-in) in one file. For users who run multiple Claude accounts on one machine (e.g. switching between subscription accounts by swapping config/credentials, or via `CLAUDE_CONFIG_DIR` layouts), MCP sign-ins get forked into whichever account context was live at the time: sign in to an MCP server under account A, switch to account B, and B has no memory of that sign-in — the user must re-authenticate every MCP server per account, even though the MCP identity is the same human.

Requested: store `mcpOAuth` in its own file (e.g. `~/.claude/.mcp-credentials.json`), or provide a supported setting to point MCP credential storage at a shared location independent of the account credential. Either would let MCP sign-ins survive account switches without third-party tooling having to rebuild a mixed credentials file.

### Additional context

Multi-account users currently have no supported way to split the two credential families; the whole config dir relocates as one unit via `CLAUDE_CONFIG_DIR`, and the credentials file moves as one unit within it. A native split would also reduce the blast radius of any tooling that snapshots/restores account credentials.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start by tracing how ~/.claude/.credentials.json is read and written, especially claudeAiOauth and mcpOAuth, and how CLAUDE_CONFIG_DIR changes its location. Compare the requested storage approaches and verify that MCP sign-ins remain available after switching account credential contexts without duplicating credentials.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
authentication, security
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.