Skip to main content
Glama
GitChanger MCP Server

GitChanger MCP Server

by culcat
README.md
# GitChanger MCP Server ⚡

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![MCP](https://img.shields.io/badge/MCP-Model%20Context%20Protocol-green.svg)](https://modelcontextprotocol.io)
[![GitHub](https://img.shields.io/badge/github-culcat%2FGitChangerMCP-blue)](https://github.com/culcat/GitChangerMCP)

Official **Model Context Protocol (MCP)** server for [GitChanger](https://github.com/culcat/GitChangerCLI) (`gitchanger`).

Allows AI assistants (**Claude Desktop**, **Cursor**, **Antigravity / Gemini CLI**, **VS Code / Roo Code / Cline**) to seamlessly inspect Git repositories, switch between multiple Git accounts and SSH configurations, and synchronize **GitHub MCP Personal Access Tokens** automatically.

---

## 🚀 Features

- **🔄 Automatic Git Account Switching**: Let your AI assistant switch your active Git profile (author name, email, SSH keys, signing keys, and remote URLs) per repository or globally.
- **🤖 GitHub MCP Token Synchronization**: Synchronize GitHub Personal Access Tokens (PATs) across all your MCP-enabled tools (`@modelcontextprotocol/server-github`) when changing profiles.
- **🔍 Diagnostics & Scanning**: Query Git identities, active remotes, loaded SSH keys, and system MCP configurations on demand.
- **🛡 Security by Design**: Masked tokens by default, atomic configuration updates, and full compatibility with existing `~/.ssh/config` blocks.

---

## 🛠 Available MCP Tools

| Tool | Description |
|---|---|
| `gitchanger_status` | Show current repository Git identity, matching profile, remote URLs, and active MCP token status. |
| `gitchanger_list` | List all configured Git profiles in GitChanger. |
| `gitchanger_switch` | Switch active Git profile for current repository or globally (auto-updates SSH agent & MCP tokens). |
| `gitchanger_add` | Add a new Git profile (name, email, transport, key, host alias, GitHub token). |
| `gitchanger_delete` | Delete a Git profile and optionally clean up SSH host configuration. |
| `gitchanger_set_default` | Set a profile as the default Git profile. |
| `gitchanger_test_ssh` | Test SSH network and key authentication for a specific profile. |
| `gitchanger_scan` | Scan `~/.ssh` and SSH config for keys and hosts, and find all MCP client configs. |
| `gitchanger_mcp_status` | Show status of GitHub MCP tokens across profiles and detected AI client configurations. |
| `gitchanger_mcp_set` | Set GitHub Personal Access Token for a profile or directly in MCP client configs. |
| `gitchanger_mcp_get` | Retrieve configured GitHub MCP token for a profile or active configuration. |
| `gitchanger_mcp_sync` | Sync a profile's GitHub token to all detected MCP client configuration files. |
| `gitchanger_mcp_test` | Test and verify token validity, login, and OAuth scopes against GitHub API. |
| `gitchanger_mcp_remove` | Remove GitHub MCP token from a profile and/or MCP client configs. |

---

## 📦 Resources

| URI | MIME Type | Description |
|---|---|---|
| `gitchanger://profiles` | `application/json` | List of all configured Git profiles in JSON format. |
| `gitchanger://status` | `text/plain` | Formatted status of current repository and active Git identity. |

---

## 📦 Installation & Setup

### Prerequisites

1. Install **GitChanger CLI**:
   ```bash
   git clone https://github.com/culcat/GitChangerCLI.git
   cd GitChangerCLI
   cargo install --path .
   ```
   Ensure `gitchanger` is accessible in your `$PATH` (typically `~/.cargo/bin`).

2. Clone and build **GitChangerMCP**:
   ```bash
   git clone git@github.com:culcat/GitChangerMCP.git
   cd GitChangerMCP
   npm install
   npm run build
   ```

---

## ⚙️ Configuration in AI Clients

### 1. Google Antigravity / Gemini CLI (`~/.gemini/config/mcp_config.json`)

```json
{
  "mcpServers": {
    "gitchanger": {
      "command": "node",
      "args": ["/path/to/GitChangerMCP/dist/index.js"]
    }
  }
}
```

### 2. Claude Desktop

- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "gitchanger": {
      "command": "node",
      "args": ["/path/to/GitChangerMCP/dist/index.js"]
    }
  }
}
```

### 3. Cursor (`~/.cursor/mcp.json` or project `.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "gitchanger": {
      "command": "node",
      "args": ["/path/to/GitChangerMCP/dist/index.js"]
    }
  }
}
```

### 4. VS Code (Cline / Roo Code)

Add under `mcpServers` in your extension settings:

```json
{
  "gitchanger": {
    "command": "node",
    "args": ["/path/to/GitChangerMCP/dist/index.js"]
  }
}
```

---

## 💬 Example Prompts

Once configured, you can simply ask your AI assistant:

- *"What Git account am I currently using in this repository?"*
- *"Switch this repo to my 'work' profile and verify the SSH connection."*
- *"List all my configured Git profiles and show which one is default."*
- *"Add a new Git profile for 'freelance' with email dev@client.com using SSH."*
- *"Sync my GitHub MCP token with my work profile."*
- *"Verify my GitHub MCP token against the GitHub API."*

---

## 📄 License

Distributed under the [MIT](LICENSE) License.  
Author: [culcat](https://github.com/culcat)

TDQS

B3.4/5.0

Scored across 14 tools

Disambiguation4/5

Most tools target clearly distinct operations (add/delete/switch/scan/test_ssh vs. MCP token set/get/remove/sync/test). The main potential confusion is gitchanger_status vs gitchanger_mcp_status and gitchanger_list, which all report state, but descriptions make the split (identity/remote vs. token status vs. profile inventory) reasonably clear.

Naming Consistency5/5

All tools use a consistent gitchanger_ prefix with snake_case verb/noun suffixes, and the MCP subgroup cleanly nests as gitchanger_mcp_*. No mixed camelCase or inconsistent verb styles.

Tool Count5/5

14 tools is well within a reasonable range and each maps to a concrete operation across two coherent sub-domains (profile lifecycle and MCP token lifecycle). No obvious filler tools.

Completeness4/5

Profile CRUD is largely covered (add, delete, list, switch, set_default, status) plus SSH testing/scanning and full MCP token management (set/get/remove/sync/status/test). The notable gap is an update/edit operation for an existing profile's fields (e.g., changing name/email/SSH key without deleting and re-adding).

Maintenance

ActivityMaintained
ResponsivenessSyncing