Claude Code Bridge
Provides read-only Git observation tools for repository status, diff statistics, and full diffs, plus repository initialization, enabling review of changes made by Claude Code tasks.
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 Code Bridge
A Model Context Protocol (MCP) server that enables Claude.ai to orchestrate long-running Claude Code CLI tasks.
Overview
Claude Code Bridge eliminates the copy-paste workflow between Claude.ai and Claude Code by providing:
Asynchronous task execution - Start Claude Code tasks and poll for status
Native filesystem tools - Fast, cheap exploration of codebases
Git observation tools - Read-only repository status and diffs
Session management - One task per project with automatic locking
Related MCP server: Cursor MCP Server
Features
15 MCP tools for task orchestration, filesystem access, and git operations
3 MCP resources for logs, active tasks, and configuration
PTY-based task execution with auto-approval of prompts
Path whitelisting for security
TypeScript implementation with full type safety
Comprehensive test suite with MockPty
Installation
Install globally via npm:
npm install -g claude-code-bridgeOr install from source:
git clone https://github.com/your-username/claude-code-bridge.git
cd claude-code-bridge
npm install
npm run buildConfiguration
Create ~/.config/mcp-claude-bridge/config.json:
{
"allowed_roots": [
"/Users/your-username/Projects",
"/Users/your-username/Work"
],
"default_timeout_seconds": 3600,
"log_level": "info"
}Configuration Options
Option | Type | Default | Description |
| string[] | Required | Directories Claude Code can access |
| number | 3600 | Task timeout (1 hour) |
| number | 10485760 | Log file rotation size (10MB) |
| number | 20 | Tasks kept in history |
| number | 2 | File tree depth |
| number | 51200 | Git diff truncation limit (50KB) |
| string | /bin/bash | Shell for PTY |
| string | claude | Claude Code CLI command |
| string | info | Log verbosity (debug, info, warn, error) |
Environment Variables
Override config values with environment variables:
MCP_ALLOWED_ROOTS- Comma-separated pathsMCP_DEFAULT_TIMEOUT- Timeout in secondsMCP_LOG_LEVEL- debug, info, warn, error
Claude Desktop Integration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"claude-code-bridge": {
"command": "npx",
"args": ["claude-code-bridge"]
}
}
}Tools
Task Management
start_task- Start a Claude Code task asynchronously with a prompt and project pathget_task_status- Poll task status, elapsed time, and last outputkill_task- Terminate a running task
Project Management
set_active_project- Set default working directory for subsequent operationsget_active_project- Get the current active project directorycreate_directory- Create directories with parent creationwrite_file- Write content to filesinit_git_repo- Initialize a git repository
Filesystem
list_files- List directory contents (respects .gitignore)read_file- Read entire file contents or header linesread_file_range- Read specific line ranges from large filesfile_tree- Get recursive directory tree structure
Git (Read-Only)
git_status- Repository status including branch, staged, modified, and untracked filesgit_diff_stat- Compact diff statistics showing files changed and lines added/removedgit_diff- Full diff output (truncated to 50KB for large diffs)
Resources
logs://{task_id}- Full log output for a completed or running task (text/plain)tasks://active- List of currently running tasks (application/json)config://current- Server configuration, read-only (application/json)
Usage Example
Claude.ai: "I want to add authentication to my Express app at /Users/me/Projects/my-api"
1. set_active_project("/Users/me/Projects/my-api")
2. file_tree() - Explore project structure
3. read_file("src/server.ts") - Understand current code
4. git_status() - Check for uncommitted changes
5. start_task("Add JWT authentication with bcrypt and express-jwt...") - Start Claude Code
6. get_task_status(task_id) - Poll until complete
7. git_diff_stat() - Review changes madeSecurity
All file operations restricted to
allowed_rootsOne task per project prevents concurrent access conflicts
Automatic process termination on timeout
No shell injection (prompts piped via files)
Filesystem validation rejects path traversal attempts
CCB CLI
Control the MCP server from your terminal using the ccb command.
Global Flags
--json- Output in JSON format-q, --quiet- Suppress non-essential output-v, --version- Show version-h, --help- Show help for commands
Commands
Task Management
ccb task start [prompt] - Start a Claude Code task
Options:
-p, --path <dir>- Project directory path-f, --file <file>- Read prompt from file-t, --timeout <seconds>- Task timeout (default: 3600)-d, --detach- Return immediately with task ID
Examples:
ccb task start "Add JWT authentication" --path ./my-api
ccb task start --file spec.md --path ./my-api
cat prompt.md | ccb task start --path ./my-api
ccb task start "Fix ESLint errors" --detachccb task status [task-id] - Get task status
Shows current status, elapsed time, and recent output. Uses last task if ID omitted.
ccb task kill [task-id] - Terminate running task
Stops task execution. Uses last task if ID omitted.
ccb task watch [task-id] - Attach to running task
Follow task output in real-time. Ctrl+C to detach or kill. Uses last task if ID omitted.
ccb task logs [task-id] - View full task logs
Display complete log output. Uses last task if ID omitted.
ccb task list - List recent and active tasks
Options:
-a, --all- Show all tasks, not just current project
Filesystem Operations
ccb fs list <path> - List directory contents
Options:
-a, --all- Show hidden files
Respects .gitignore patterns.
ccb fs read <path> - Read file contents
Options:
-l, --lines <range>- Line range (e.g., "1:50", "100:150")
Examples:
ccb fs read src/server.ts
ccb fs read src/server.ts --lines 1:50ccb fs tree [path] - Show directory tree
Options:
-d, --depth <n>- Maximum depth (default: 3)
Examples:
ccb fs tree
ccb fs tree ./src --depth 2Git Operations
ccb git status [path] - Show repository status
Shows branch, staged files, modified files, untracked files.
ccb git diff [path] - Show diff output
Options:
--stat- Show diff statistics only--cached- Show staged changes
Examples:
ccb git diff
ccb git diff --stat
ccb git diff --cachedProject Management
ccb project set <path> - Set default project path
Sets the default working directory for subsequent commands.
ccb project init <path> - Create and initialize project directory
Options:
--git- Initialize git repository
ccb project info - Show current project information
Displays current project path, source detection method, and last task info.
Configuration
ccb config show - Display merged configuration
Shows both server config (~/.config/mcp-claude-bridge/config.json) and CLI config (~/.config/ccb/config.json).
ccb config edit - Open configuration in editor
Options:
--server- Edit server config instead of CLI config--cli- Edit CLI config (default)
Uses $EDITOR environment variable (falls back to nano).
Diagnostics
ccb doctor - Diagnose environment issues
Checks:
Node.js version (>=20 required)
MCP server package installed
Claude Code CLI available
Server configuration exists
CLI configuration
allowed_rootsconfiguredMCP server connection
CLI Configuration
Create ~/.config/ccb/config.json to customize CLI behavior:
{
"default_project": "/Users/your-username/Projects/my-app",
"output_format": "human",
"color": true,
"poll_interval_ms": 1000
}Options:
default_project- Default working directory when path not specifiedoutput_format- "human" or "json" (overridden by--jsonflag)color- Enable/disable colored outputpoll_interval_ms- Task polling interval (default: 1000ms)
Exit Codes
0- Success1- General error (invalid arguments, operation failed)2- Task not found or missing task ID127- Task failed/timeout/killed
Project Context Detection
CCB automatically detects project root using:
--pathflag (highest priority)CLI config
default_projectNearest
.gitdirectory (searches up from cwd)Current working directory (fallback)
State Management
CCB tracks last task per project in <project-root>/.ccb/state.json. This enables commands like ccb task status without specifying task ID.
State includes:
last_task_id- Most recent task ID for projectlast_task_status- Final status (running, completed, failed, etc.)last_task_time- Timestamp of last task
Development
npm run dev # Run with tsx
npm run test # Run tests with vitest
npm run test:coverage # Run tests with coverage
npm run lint # Check linting with eslint
npm run format # Format code with prettier
npm run build # Compile TypeScript
npm run typecheck # Type check without emittingLicense
MIT
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 your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides Claude Desktop with direct access to your local file system for development tasks, enabling file operations (read, write, edit), directory browsing, command execution, and codebase search within a configured projects directory.6MIT
- FlicenseNot gradedqualityDmaintenanceTurns Claude Desktop into a Cursor-like assistant for code browsing, editing, searching, linting, formatting, and version control.-
- AlicenseNot gradedqualityCmaintenanceLets Codex delegate coding and repository work to an installed Claude Code CLI with permission-aware inspect/write access, model and effort selection, resumable and cloud-attached sessions, and durable synchronous or asynchronous jobs.MIT
- FlicenseAqualityBmaintenanceEnables Claude conversations to send tasks to a local Claude Code CLI instance and retrieve results, bridging chat to laptop-based builds via stdio or HTTPS/tunnel modes.3-