Skip to main content
Glama
Claude Desktop Coder MCP

Claude Desktop Coder MCP

by Mars-Shamim
README.md
# Claude Desktop Coder MCP

**Turn Claude Desktop (even the free tier & free Sonnet models) into a full local Claude Code alternative — 100% free, zero paid subscriptions, zero external runtime dependencies.**

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-3776AB.svg)](https://www.python.org/)
[![MCP Protocol](https://img.shields.io/badge/MCP-stdio%20%7C%20HTTP%20%7C%20SSE-3fb27f.svg)](#transports--clients)
[![58 Tools](https://img.shields.io/badge/Tools-58%20Built--in-4c9aff.svg)](#58-built-in-mcp-tools)
[![Zero Dependencies](https://img.shields.io/badge/Runtime%20Deps-Standard%20Library%20Only-success.svg)](#quick-start)

> **[বাংলা গাইড (Bengali Guide)](README.bn.md)** · **[Releases & Desktop Installer](https://github.com/Mars-Shamim/claude-desktop-coder-mcp/releases)**

**Claude Desktop Coder MCP** (CLI: `codebase-mcp`) is a local, dependency-free **Model Context Protocol (MCP) server** and lightweight **Desktop Web IDE** (`codebase_ui.html`). Connect **Claude Desktop** (free tier / Sonnet), **Claude Code**, **Codex CLI**, **Gemini CLI**, **Cursor**, or **ChatGPT** directly to your PC so any AI can search large codebases via SQLite FTS5, edit files safely with automatic undo backups, run `get_diagnostics` and tests, use git tools, launch interactive ConPTY/PTY terminals, monitor embedded serial boards (ESP32/Arduino), and preserve plans, tasks, and checkpoints across free-tier usage limits.

---

## Why Claude Desktop Coder MCP?

- **Free Claude Code alternative inside Claude Desktop:** Use Claude Desktop's free Sonnet/Claude tier on real local repositories—index files, find references, edit code, run `get_diagnostics` + test suites, inspect `git_diff`, and commit locally.
- **Zero-dependency Python 3.9+ runtime:** Uses only the Python standard library — no `pip install`, no Docker, no heavy vector DBs.
- **Persistent Cross-AI Handoff Memory:** Hit a 5-hour usage limit mid-task? Plans, task lists, pinned notes, auto-checkpoints, and file/command activity survive in SQLite (`~/.codebase_mcp/index.db`) so another AI (Claude, Codex, Gemini, or ChatGPT) resumes from the exact line where the previous one stopped.
- **Built-in Desktop App & Live Web IDE:** File tree, syntax-highlighted editor with disk-conflict detection, live ConPTY/PTY terminal dock (`Ctrl+\``), Handoff prompt generator, Plan revisions, Task board, Activity timeline, and Notes.
- **58 MCP Tools + Safety Net:** Every write/edit/patch/delete creates an automatic backup in `~/.codebase_mcp` (`undo` & `edit_history`). Supports `--read-only`, `--no-shell`, and project-root path sandboxing.

---

## Architecture

```
Claude Desktop / Claude Code / Codex / Gemini CLI / Cursor / ChatGPT
        │  MCP (stdio, Streamable HTTP /mcp, or Legacy SSE /sse)
        ▼
  codebase_mcp.py ──► ~/.codebase_mcp/index.db (SQLite FTS5 + symbols + notes + tasks + checkpoints)
        │
        ├──► cbmcp_terminal.py (ConPTY / POSIX PTY / pipe interactive terminal dock)
        ├──► cbmcp_hardware.py (USB serial monitors + ESP-IDF/PlatformIO/Arduino detection)
        └──► codebase_ui.html  (Live local Web IDE on http://127.0.0.1:8765)
```

---

## Quick Start

### Option A: Windows Desktop App (No Python Needed)
1. Download `ClaudeDesktopCoderMCP-Setup-*.exe` (or portable `CodebaseMCP-win32.zip`) from [**Releases**](https://github.com/Mars-Shamim/claude-desktop-coder-mcp/releases).
2. Run the installer — it installs `CodebaseMCP.exe` and `codebase-mcp.exe` to `%LOCALAPPDATA%\Programs\CodebaseMCP`, creates Start Menu & Desktop shortcuts, adds `codebase-mcp` to your `PATH`, and can auto-register **Claude Desktop**.

### Option B: Run or Install from Source (Windows / macOS / Linux)
```bash
git clone https://github.com/Mars-Shamim/claude-desktop-coder-mcp.git
cd claude-desktop-coder-mcp

# 1. Verify everything works (runs 106 end-to-end checks)
python selftest.py

# 2. One-click register in Claude Desktop (supports both standard & Windows Store MSIX)
python codebase_mcp.py --install-claude

# 3. Or launch the Web IDE + HTTP MCP server directly
python codebase_mcp.py --transport http --project /path/to/your/repo --open
```

On Windows, you can also double-click `install.bat` (or run `powershell -ExecutionPolicy Bypass -File install.ps1`) to build & install the standalone Desktop App locally.

---

## Transports & Clients

- **Claude Desktop (auto-setup):** `python codebase_mcp.py --install-claude` (writes `claude_desktop_config.json` with `--ui-port 8765`, then restart Claude Desktop).
- **Claude Code:** `claude mcp add codebase -- python /path/to/codebase_mcp.py --project /path/to/repo`
- **Codex CLI (`~/.codex/config.toml`):**
  ```toml
  [mcp_servers.codebase]
  command = "python"
  args = ["/path/to/codebase_mcp.py", "--project", "/path/to/repo"]
  ```
- **Gemini CLI (`~/.gemini/settings.json`):**
  ```json
  { "mcpServers": { "codebase": { "command": "python", "args": ["/path/to/codebase_mcp.py", "--project", "/path/to/repo"] } } }
  ```
- **Web ChatGPT / Remote Connectors:** Run `python codebase_mcp.py --transport http --project /path/to/repo` behind `cloudflared tunnel --url http://127.0.0.1:8765` and connect `https://<tunnel>/mcp?token=<TOKEN>` (use `--read-only` or `--no-shell` when exposing remotely).

---

## 58 Built-in MCP Tools

| Category | Tools |
|---|---|
| **Project & Context** | `project_add`, `project_list`, `project_remove`, `project_reindex`, `project_overview`, **`get_context`** |
| **Search & Symbols** | **`search_code`** (BM25 + camelCase/snake_case splitting), `grep` (regex), `find_symbol`, **`find_references`**, `file_outline` |
| **Files (Read)** | `read_file` (line ranges), `read_files`, `list_dir`, `glob` |
| **Files (Edit + Undo)** | `write_file`, `edit_file`, `replace_lines`, `apply_patch`, `move_path`, `delete_path`, `make_dir`, `edit_history`, `undo` |
| **Diagnostics, Git & Web** | **`get_diagnostics`**, `git_status`, `git_diff`, `git_log`, `git_commit`, `web_fetch` |
| **Shell & Processes** | `run_command`, `bg_start`, `bg_output`, `bg_stop`, `bg_list`, `system_info` |
| **Interactive Terminal** | `term_open`, `term_send`, `term_read`, `term_list`, `term_close` (shared with the UI terminal dock) |
| **Hardware & Serial** | `hardware_info`, `serial_open`, `serial_read`, `serial_write`, `serial_reset`, `serial_list`, `serial_close` |
| **Memory & Handoff** | `note_save`, `note_search`, `note_delete`, `plan_set`, `plan_get`, `task_upsert`, `task_list`, `task_delete`, **`checkpoint`**, **`handoff_get`** |

---

## Building the Standalone Desktop Bundle

```bash
pip install pyinstaller
python build.py --zip       # creates dist/CodebaseMCP/ and dist/CodebaseMCP-win32.zip
iscc setup.iss              # optional (Inno Setup 6): builds Output/ClaudeDesktopCoderMCP-Setup-1.0.1.exe
```

---

## Security

- File tools are sandboxed to registered project roots by default (use `--unrestricted` only if you want full PC access).
- `run_command`, `bg_start`, and `term_*` run with your user permissions; use `--no-shell` or `--read-only` for untrusted/remote sessions.
- HTTP/UI endpoints require a bearer token (`python codebase_mcp.py --print-token` / `--rotate-token`) and bind to `127.0.0.1` by default.
- See [SECURITY.md](SECURITY.md) for reporting vulnerabilities.

## Contributing & License

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) and run `python selftest.py` before submitting a PR.
Licensed under the [MIT License](LICENSE).