claude-account-switcher
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
claude-account-switcher
Switch between your own Claude Code accounts on macOS (for example personal and work, or a Pro plan and a Team seat) without losing your conversations or memory.
Claude Code has no built-in account switcher in the Desktop app. Signing out and in again works, but it's easy to lose track of logins and settings. This tool saves each account as a named profile and swaps between them in one command. It works for both the Terminal claude CLI and the Desktop app, because both read ~/.claude.json, ~/.claude/ and the macOS Keychain.
Use it only with accounts that belong to you. Sharing a Claude account, or signing into someone else's account to get past your usage limits, is against Anthropic's terms and can get the accounts suspended. If you keep hitting limits, look at a higher plan, extra usage, or an API key.
How it works
Profiles keep a copy of
~/.claude.json, and optionally your conversations (~/.claude/projects,~/.claude/sessions).Login tokens stay in the macOS Keychain. They're saved under the Keychain service
ClaudeAccountSwitcher(one item per profile), never in plain files. They're written throughsecurity -ion stdin, so they never show up in a process's command-line arguments.Default switch = login only. Your conversations, memory, settings, plugins and MCP servers stay exactly where they are, and only the account changes. Per-account caches in
~/.claude.jsonare cleared so Claude Code fetches fresh ones for the new account.Tokens stay fresh. Claude Code refreshes OAuth tokens over time. When you switch away from an account, its profile is updated with the latest token first, so switching back doesn't hand you an expired login.
Backups: every switch first backs up your config and conversations to
~/Library/Application Support/ClaudeAccountSwitcher/backups/(the latest 10 are kept).
Related MCP server: claude-projects-mcp-server
Install
Requires macOS and Node 18+.
git clone https://github.com/mannudev97/claude-account-switcher.git
cd claude-account-switcher
./install.shThis builds the CLI, links claude-switch globally, and registers the MCP server with Claude Code (if the claude CLI is on your PATH; otherwise it prints the JSON to add yourself).
Usage
claude-switch save work # save the account you're signed into
# In Claude Code, sign out and sign in with your other account, then:
claude-switch save personal
claude-switch list # * marks the active profile
claude-switch info # signed-in account + Keychain status
claude-switch use work # switch login; conversations stay
claude-switch use personal --full # also swap conversations (see below)
claude-switch backup # manual backup
claude-switch delete old # remove a profile and its saved loginQuit Claude Code completely (Cmd+Q) before switching, and reopen it afterwards. If Claude Code is running while you switch, it may write its old settings back over the new ones.
Login only (default) vs --full
Default |
| |
Account / login | switched | switched |
Conversations + memory | kept, shared by both accounts | replaced with the profile's copy |
Settings, MCP servers, plugins | kept | config replaced with the profile's copy |
With --full, the current conversations are saved to the outgoing profile before the swap, so nothing is lost. You can switch back with --full to get them again.
Inside Claude Code (MCP)
Ask things like "list my saved accounts" or "save this account as work". Tools: current_account, list_profiles, save_profile, switch_profile, backup_current, delete_profile, list_projects, list_sessions, clear_keychain (signs you out; requires confirm: true).
Tool calls run one at a time, so overlapping requests can't interleave. Remember that a switch needs a Claude Code restart to take effect.
Keychain prompts
macOS may ask whether security can access a Claude Code Keychain item. Click Allow (or Always Allow). After a switch, Claude Code itself may ask once to access its login item, because the item was rewritten. No sudo is needed.
Testing
The test suite runs everything against a throwaway home folder and a fake security command, so it never touches your real account or Keychain:
npm testKnown limits
macOS only.
Profiles with
--fullcopies of conversations can take a lot of disk space.--symlinkmode from v0.2 was removed because it hid~/.claudesettings and plugins. If you used it, the nextsaveoruseturns the symlinks back into real files.Upgrading from v0.2: old
keychain.jsontoken files in profiles are moved into the Keychain and deleted the first time each profile is used. Delete old backups in~/Library/Application Support/ClaudeAccountSwitcher/backups/yourself, because v0.2 backups may contain plain token files.
Uninstall
npm unlink -g claude-account-switcher
claude mcp remove claude-account-switcherThen delete ~/Library/Application Support/ClaudeAccountSwitcher, and remove the ClaudeAccountSwitcher items in Keychain Access if you want the saved logins gone.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Use several Claude accounts at once: see which one has usage left, continue your chat in another.
A profile you control: gives your AI your role, projects and preferences, across ChatGPT and Claude.
Your versioned prompt library: search, read, save and version prompts from Claude Code.
Share context and questions between Claude instances — VS Code, claude.ai web, and mobile.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceBrowse, search, rename, split, and clean up Claude Code sessions via MCP, Web UI, or VSCode extension.22MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to read, create, update, and delete Claude Cowork/claude.ai projects and their knowledge documents, including syncing local folders to projects, with safety features like backups and overwrite protection.171MIT
- FlicenseNot gradedqualityCmaintenanceEnables Claude Code sessions to list projects and sessions and export session transcripts to readable text files, including its own or another project's history.-
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code and Codex to work with multiple accounts of the same MCP server at once, such as two Gmail inboxes or several Slack and Notion workspaces. It presents a single toolset where every tool takes a required account argument, with per-account OAuth sign-in and credentials isolated in the macOS Keychain.14 npm1MIT