# User Guide ## Getting Started ### Prerequisites Before using ClaudeCode MCP Manager, ensure you have: 1. **Claude Code CLI** installed and configured ```bash # Verify installation claude --version ``` 2. **Go 1.21+** (if building from source) ```bash go version ``` 3. **Existing MCP Configuration** (optional) - The manager works with or without existing MCPs - Can add MCPs directly through the TUI ### Installation Choose one of these methods: #### Method 1: From Source (Recommended) ```bash # Clone the repository git clone https://github.com/donmecca/claudecode-mcp-manager cd claudecode-mcp-manager # Build the binary go build -o mcp-manager # Install globally sudo mv mcp-manager /usr/local/bin/ # Or install to local bin (add to PATH if needed) mv mcp-manager ~/bin/ ``` #### Method 2: Go Install ```bash go install github.com/donmecca/claudecode-mcp-manager@latest ``` #### Method 3: Download Binary (Future) Pre-built binaries will be available in GitHub Releases. ### First Launch ```bash # Start the manager mcp-manager ``` You should see: - Title bar with "ClaudeCode MCP Manager" - List of your configured MCPs (if any) - Status indicators (✓ for enabled, □ for disabled) - Status bar at the bottom with server counts - Help hint: "Press ? for help" ## Interface Overview ### Main List View ``` ┌────────────────────────────────────────────────┐ │ ClaudeCode MCP Manager │ │ Profile: default │ │ │ │ ▶ ✓ ● fetch-mcp node /path/to/server.js │ │ □ ○ brave-search npx -y @org/package │ │ ✓ ● perplexity-mcp npx -y @perplexity │ │ │ │ Total: 3 Enabled: 2 Connected: 2 │ │ Profile: default Last backup: 5 mins ago │ │ Press ? for help │ └────────────────────────────────────────────────┘ ``` #### Status Indicators - **✓** = Enabled (in `enabledMcpjsonServers`) - **□** = Disabled (not in array) - **●** = Connected (running) - **○** = Disconnected (not running) - **✗** = Error state - **▶** = Current selection (cursor) ### Status Bar Shows: - **Total**: Number of configured MCPs - **Enabled**: MCPs in `enabledMcpjsonServers` - **Connected**: MCPs currently running - **Profile**: Active profile name - **Last backup**: Relative time of most recent backup ## Core Operations ### Navigating the List | Key | Action | |-----|--------| | `↑` or `k` | Move cursor up | | `↓` or `j` | Move cursor down | | Home / `g` | Jump to top (future) | | End / `G` | Jump to bottom (future) | ### Toggle MCP On/Off **Purpose**: Enable or disable an MCP without removing it 1. Navigate to the desired MCP 2. Press `Space` or `Enter` 3. See status change: `✓` ↔ `□` 4. Automatic backup created 5. Config updated instantly **What happens**: - **Toggle ON**: Adds MCP name to `enabledMcpjsonServers` array - **Toggle OFF**: Removes MCP name from array - Claude Code will use only enabled MCPs on next start **Use case**: Temporarily disable MCPs to save context tokens without deleting them. ### Add New MCP **Purpose**: Add a new MCP server to your configuration 1. Press `a` from the main list 2. Fill in the form: - **Server Name**: Unique identifier (e.g., `my-custom-mcp`) - **Command**: Executable (e.g., `npx`, `node`, `python`) - **Arguments**: Command args (e.g., `-y @org/package` or `/path/to/script.js`) 3. Press `Tab` or `↓` to move between fields 4. Press `Enter` to submit 5. Press `ESC` to cancel **Form Validation**: - Server name is required - Command is required - Arguments are optional - No special characters in server name (/, \, :, *, ?, ", <, >, |) **Example**: ``` ┌────────────────────────────────────────────────┐ │ Add New MCP Server │ │ │ │ Server Name: │ │ my-custom-mcp_ │ │ │ │ Command: │ │ npx │ │ │ │ Arguments (optional): │ │ -y @modelcontextprotocol/server-custom │ │ │ │ Tab to navigate • Enter to submit • ESC to cancel │ └────────────────────────────────────────────────┘ ``` **What happens**: - Executes: `claude mcp add my-custom-mcp npx -y @org/package` - Creates automatic backup - Updates config - Refreshes server list - Returns to main view ### Delete MCP **Purpose**: Completely remove an MCP from configuration 1. Navigate to the MCP you want to delete 2. Press `d` or `x` 3. Confirm deletion: - Press `y` or `Y` to confirm - Press `n`, `N`, or `ESC` to cancel **Confirmation Dialog**: ``` ┌────────────────────────────────────────────────┐ │ ⚠️ Delete Server │ │ │ │ Are you sure you want to delete 'fetch-mcp'? │ │ │ │ This will remove the server from your │ │ configuration. You can add it back later │ │ if needed. │ │ │ │ [Y] Yes, delete [N] No, cancel │ │ │ │ Press ESC to cancel │ └────────────────────────────────────────────────┘ ``` **What happens**: - Executes: `claude mcp remove [name]` - Creates automatic backup - Updates config - Refreshes server list - Returns to main view ### Restore from Backup **Purpose**: Restore configuration from a previous backup 1. Press `r` from the main list 2. Browse available backups 3. Navigate with `↑`/`↓` or `j`/`k` 4. Press `Enter` to restore selected backup 5. Press `ESC` to cancel **Backup List**: ``` ┌────────────────────────────────────────────────┐ │ 📦 Restore from Backup │ │ │ │ ▶ Jan 03, 2025 14:23:15 (12.4 KB) │ │ Jan 03, 2025 12:45:30 (11.8 KB) │ │ Jan 03, 2025 09:15:22 (11.2 KB) │ │ Jan 02, 2025 18:30:45 (10.9 KB) │ │ │ │ ⚠️ This will replace your current │ │ configuration. A backup of the current │ │ state will be created first. │ │ │ │ ↑/↓ to navigate • Enter to restore • ESC to cancel │ └────────────────────────────────────────────────┘ ``` **What happens**: 1. Creates backup of current config (safety!) 2. Validates backup file (checks JSON integrity) 3. Atomically replaces config with backup 4. Refreshes server list 5. Shows success message **Safety**: A backup of your current state is always created before restoring, so you can undo if needed. ### Switch Profile **Purpose**: View and get instructions for switching profiles 1. Press `p` from the main list 2. Browse available profiles 3. Press `Enter` to see switching instructions 4. Press `ESC` to go back **Profile List**: ``` ┌────────────────────────────────────────────────┐ │ 👤 Switch Profile │ │ │ │ ▶ default [ACTIVE] │ │ ~/.claude │ │ │ │ glm │ │ ~/.claude-glm │ │ │ │ staging │ │ ~/.claude-staging │ │ │ │ ⚠️ Switching profiles requires restart. │ │ Set CLAUDE_CONFIG_DIR to switch. │ │ │ │ ↑/↓ to navigate • Enter to view • ESC to cancel │ └────────────────────────────────────────────────┘ ``` **Profile Switching**: To actually switch profiles, you need to: ```bash # Option 1: Set environment variable export CLAUDE_CONFIG_DIR=~/.claude-glm mcp-manager # Option 2: One-liner CLAUDE_CONFIG_DIR=~/.claude-glm mcp-manager ``` See [Profiles Guide](profiles.md) for detailed setup. ### View Help Press `?` or `h` to view keyboard shortcuts: ``` ┌────────────────────────────────────────────────┐ │ Keyboard Shortcuts │ │ │ │ Navigation │ │ ↑/k move up │ │ ↓/j move down │ │ │ │ Actions │ │ space/enter toggle server │ │ a add new server │ │ d/x delete server │ │ │ │ Advanced │ │ r restore from backup │ │ p switch profile │ │ ctrl+r refresh list │ │ │ │ Global │ │ ?/h toggle help │ │ esc go back │ │ q quit │ │ │ │ Press any key to return │ └────────────────────────────────────────────────┘ ``` ## Common Workflows ### Scenario 1: Temporarily Disable an MCP **Goal**: Save context tokens by disabling an MCP you're not currently using 1. Launch `mcp-manager` 2. Navigate to the MCP 3. Press `Space` to toggle it off (□) 4. Press `q` to quit 5. Restart Claude Code The MCP will not load, saving tokens. Toggle back on when needed. ### Scenario 2: Add a Custom MCP **Goal**: Add your own MCP server 1. Launch `mcp-manager` 2. Press `a` 3. Fill in: - Name: `my-project-mcp` - Command: `node` - Args: `/Users/me/projects/my-mcp/server.js` 4. Press `Enter` 5. MCP is added and ready to use ### Scenario 3: Recover from Bad Config **Goal**: Your config got corrupted or you want to undo changes 1. Launch `mcp-manager` 2. Press `r` (restore) 3. Select a backup from before the issue 4. Press `Enter` 5. Config is restored, current state is backed up first ### Scenario 4: Manage Multiple Claude Instances **Goal**: Use different MCPs for regular Claude vs GLM See [Profiles Guide](profiles.md) for complete setup, but in short: ```bash # Default Claude - with all MCPs mcp-manager # GLM Claude - with vision and search MCPs only CLAUDE_CONFIG_DIR=~/.claude-glm mcp-manager ``` ## Tips & Tricks ### Vim-Style Navigation The interface uses Vim-style keys for familiarity: - `j` = down - `k` = up - `h` = help - `q` = quit Arrow keys also work if you prefer. ### Automatic Backups Every change creates a backup automatically: - Location: Same directory as config - Format: `settings.local.json.YYYY-MM-DD-HHMMSS.bak` - Retention: Last 10 backups kept - Cleanup: Automatic (old backups deleted) Check backup times in the status bar. ### Quick Refresh Press `Ctrl+R` to manually refresh the server list if state seems out of sync. ### Keyboard-Only Operation The entire interface is keyboard-driven. No mouse needed! ## Troubleshooting ### "claude mcp list not found" **Problem**: Claude Code CLI is not installed or not in PATH **Solution**: ```bash # Verify Claude CLI installation which claude # If not found, reinstall Claude Code # See: https://claude.ai/docs ``` ### "Failed to read config" **Problem**: `settings.local.json` doesn't exist or has invalid JSON **Solution**: ```bash # Check if file exists ls -la ~/.claude/settings.local.json # View contents cat ~/.claude/settings.local.json # Restore from backup if corrupted mcp-manager # Press 'r' to restore ``` ### "Permission denied" **Problem**: Can't write to `~/.claude/` directory **Solution**: ```bash # Check permissions ls -la ~/.claude/ # Fix ownership sudo chown -R $USER ~/.claude/ ``` ### MCPs Not Loading in Claude **Problem**: Toggled MCP on but it's not available in Claude **Solution**: 1. Verify MCP is enabled (✓ indicator) 2. Restart Claude Code completely 3. Check `claude mcp list` shows the server 4. Check Claude Code logs for errors ### Backup List Empty **Problem**: No backups showing in restore view **Solution**: - Backups are created on first config change - Make a change (toggle, add, delete) to create first backup - Check `~/.claude/` for `.bak` files ## Advanced Usage ### Scripting While the manager is interactive, you can script profile switches: ```bash #!/bin/bash # Use GLM profile for this session export CLAUDE_CONFIG_DIR=~/.claude-glm mcp-manager ``` ### Multiple Profiles Workflow ```bash # Morning: Work project with project-specific MCPs CLAUDE_CONFIG_DIR=~/.claude-work mcp-manager # Afternoon: Personal project with different MCPs CLAUDE_CONFIG_DIR=~/.claude-personal mcp-manager # Evening: Minimal setup for testing CLAUDE_CONFIG_DIR=~/.claude-minimal mcp-manager ``` ## Keyboard Reference Card **Quick reference for common operations:** | Action | Keys | |--------|------| | Move Up | ↑ or k | | Move Down | ↓ or j | | Toggle | Space or Enter | | Add | a | | Delete | d or x | | Restore | r | | Profiles | p | | Help | ? or h | | Refresh | Ctrl+R | | Back | Esc | | Quit | q or Ctrl+C | Print this page for quick reference! ## Next Steps - [Architecture](architecture.md) - Understand how it works - [Profiles Guide](profiles.md) - Set up multiple profiles - [Development](development.md) - Contribute to the project