1. Conduid
  2. Blockchain
  3. Claude Code Switcher
MCP server · Blockchain

Claude Code Switcher

一个 claude code 命令行工具 API 供应商切换工具

Unclaimed devtools
34Low

Scored 3 days ago · breakdown

About Claude Code Switcher

Claude Code Switcher is an MCP server in the Blockchain category: 一个 claude code 命令行工具 API 供应商切换工具. It has been installed 0 times through Conduid.

Install

Clone
git clone https://github.com/virtuallytd/claude-code-switcher

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Claude Code Switcher

Powered by Claude · Grounded in docs

I know everything about Claude Code Switcher. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • ·Scoped permissionsNot checked yet.

README

ccs - Claude Code Switcher

Release Build Test Go Report Card License Homebrew

A lightweight CLI tool for switching between Claude Code profiles with different MCP server configurations and authentication methods.

Features

  • 🔄 Quick Profile Switching: Interactive TUI for selecting profiles
  • 🔐 Dual Auth Support: Standard Claude account (keychain) and Vertex AI (env vars)
  • ⚙️ MCP Configuration: Automatic merging of MCP server configs
  • 🎨 Beautiful TUI: Clean, keyboard-driven interface with visual indicators
  • 🔒 Secure: Credentials stored in system keyring (macOS Keychain / Linux Secret Service)
  • 📦 Self-Contained: Single binary with no external dependencies

Installation

Homebrew (macOS/Linux)

brew install virtuallytd/tap/claude-code-switcher

Shell Integration — Add to ~/.zshrc or ~/.bashrc:

ccs() {
  # If no arguments, "switch", or "reload", run with eval
  if [[ $# -eq 0 ]] || [[ "$1" == "switch" ]] || [[ "$1" == "reload" ]]; then
    eval "$(command ccs "$@")"
  else
    # Pass through other commands (save, current, version, help) directly
    command ccs "$@"
  fi
}

Reload your shell:

source ~/.zshrc

Verify:

ccs version

For more Homebrew options and tap usage, see virtuallytd/homebrew-tap.

Manual Install

  1. Download the latest binary from releases
  2. Extract and move to your PATH:
    tar -xzf ccs_*.tar.gz
    sudo mv ccs /usr/local/bin/
    
  3. Add the shell function above to your shell config

From Source

git clone https://github.com/virtuallytd/claude-code-switcher
cd claude-code-switcher
make install

Then add the shell function above to your shell config.

How It Works

ccs manages Claude Code profiles by:

  1. Storing profiles in ~/.claude/profiles/<name>/ with their own settings.json
  2. Switching merges the selected profile's MCP server config into ~/.claude.json
  3. Authentication handles two modes:
    • Standard: Copies session tokens between keyring entries (macOS Keychain / Linux Secret Service)
    • Vertex AI: Exports environment variables via shell function

The shell wrapper (eval "$(ccs switch)") is required for environment variable export in Vertex AI profiles.

📖 Want more details? See HOW-IT-WORKS.md for a deep dive into the implementation, architecture, and Claude Code integration.

Usage

Switch Profiles

Interactive profile selector:

ccs

This launches a TUI where you can:

  • Navigate with arrow keys or j/k
  • Select with Enter
  • Quit with q, Esc, or Ctrl+C

Reload Current Profile

Re-apply the current profile without interactive selection (useful after editing settings.json):

ccs reload

Save Session Token

Save your current Claude Code session token for a profile (required once per standard auth profile):

claude login              # Login to Claude first
ccs save personal         # Save token for "personal" profile

This is only needed for standard auth profiles. Vertex AI profiles use gcloud credentials.

Show Current Profile

ccs current

Output example:

work (vertex)

Profile Structure

Profiles live in ~/.claude/profiles/<name>/:

~/.claude/profiles/
├── personal/
│   └── settings.json          # MCP server config (required)
└── work/
    ├── settings.json          # MCP server config (required)
    └── env.zsh                # Vertex AI vars (optional)

Standard Auth Profile (Claude Account)

Create directory and settings:

mkdir -p ~/.claude/profiles/personal

Add settings.json:

{
  "mcpServers": {
    "server-name": {
      "type": "sse",
      "url": "http://localhost:3000/sse"
    }
  }
}

Then save your session token:

claude login
ccs save personal

Vertex AI Profile

Create directory, settings, and env vars:

mkdir -p ~/.claude/profiles/work

Add settings.json (same format as above).

Add env.zsh:

export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=us-east5
export ANTHROPIC_VERTEX_PROJECT_ID=your-project-id

Vertex AI authentication relies on gcloud auth being configured.

How It Works

Switching Process

  1. Profile Discovery: Scans ~/.claude/profiles/ for valid profiles
  2. Interactive Selection: Shows TUI with profile list
  3. Environment Cleanup: Clears Vertex AI vars (prevents leakage)
  4. Authentication:
    • Vertex AI profiles: Sources env.zsh environment variables
    • Standard profiles: Restores session token from keyring to active "Claude Code" entry
  5. Settings Merge: Merges mcpServers from profile into ~/.claude/settings.json
  6. Shell Commands: Outputs export/unset commands to stdout (eval'd by shell function)

Visual Indicators

  • Filled dot = Currently active profile
  • Empty dot = Inactive profile
  • Orange text = Vertex AI profile
  • Blue text = Standard auth profile
  • Cursor on selected item

Platform Support

  • macOS: Uses Keychain for secure token storage
  • Linux: Uses Secret Service (gnome-keyring, KWallet)
  • Windows: Not currently supported

MCP Server Configuration

Transport Types

SSE (Server-Sent Events) for local servers:

{
  "type": "sse",
  "url": "http://localhost:3000/sse"
}

HTTP for OAuth-based remote servers:

{
  "type": "http",
  "url": "https://api.example.com"
}

⚠️ Important: Never use "http" for SSE servers — it will cause OAuth authentication errors.

Security

  • Session tokens: Encrypted in system keyring (Keychain/Secret Service)
  • Vertex AI credentials: Uses gcloud auth (not stored in profiles)
  • Environment isolation: Vertex vars cleared before every switch
  • File permissions: Settings files should be 0644 (readable by owner)

Troubleshooting

"No active Claude session found"

Run claude login first, then switch profiles.

"No saved token for profile"

For standard auth profiles, you need to save the token:

claude login
ccs save <profile-name>

Profile not appearing in list

Ensure the profile directory has a valid settings.json file.

Development

See CONTRIBUTING.md for contribution guidelines.

Build

make build              # Build binary
make test               # Run tests
make snapshot           # Test GoReleaser build locally

Dependencies

Project Structure

ccs/
├── main.go              # CLI entrypoint
├── cmd/
│   ├── switch.go        # Interactive switcher (TUI)
│   ├── current.go       # Show active profile
│   ├── reload.go        # Reload current profile
│   └── save.go          # Save session token
└── internal/
    ├── profile/         # Profile discovery & loading
    ├── keyring/         # Keyring wrapper
    └── config/          # Settings.json merging

Security

See SECURITY.md for security policy and reporting vulnerabilities

License

MIT

Contributing

Issues and pull requests welcome!

README mirrored from the source repository 3 days ago. The original is authoritative.

Questions

About Claude Code Switcher

How do I install Claude Code Switcher?

Run git clone https://github.com/virtuallytd/claude-code-switcher, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Claude Code Switcher safe to use with an AI agent?

Its trust score is 34 out of 100 (low). Conduid hasn't run static security checks on this repository yet, so review the source yourself before granting it credentials. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Claude Code Switcher still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.