# PromptBranch

Local-first prompt versioning and library for developers. Lets coding agents query templates, log test runs, and submit revisions without altering active instructions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: PromptBranch
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PromptBranch/promptbranch
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/mcp/promptbranch

## What it does

This MCP server links your coding agent to a local SQLite database at `library.db`. The same file serves the desktop application and the CLI tool. Through exposed tools, the agent looks up prompt entries by ID or title, pulls instruction text, and records evaluation logs.

Integration enforces a strict boundary: agents can only propose edits. Calling `suggest_variation` writes an unlisted candidate version into a pending queue instead of modifying current content. Humans must inspect and approve these suggestions inside the desktop interface before they take effect.

All prompt data stays on your local filesystem. You can redirect storage to an alternate file by configuring `PROMPTBRANCH_DB`. Launching the server requires Node.js along with `npx`.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add promptbranch -- npx -y @promptbranch/mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add promptbranch -- npx -y @promptbranch/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "promptbranch": {
            "command": "npx",
            "args": [
                "-y",
                "@promptbranch/mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "promptbranch": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@promptbranch/mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add promptbranch npx -y @promptbranch/mcp
```

## When to use it
- retrieve prompt templates by title or partial search query
- log model evaluation outcomes and notes directly to the local catalog
- draft prompt variations without overwriting working versions
- keep complete prompt history on the local machine

## Example prompts
- Search PromptBranch for our security audit prompt and display the text.
- Log a test run for the security-audit prompt with outcome score 4.
- Suggest a variation for the code review prompt with focused constraints.

## Similar
- [agentic-jujutsu](https://affpapa.org/en/nevibecode/skills/agentic-jujutsu.md) — skill · 1200 installs
- [git-notes](https://affpapa.org/en/nevibecode/skills/git-notes.md) — skill · 1100 installs
- [git-workflow](https://affpapa.org/en/nevibecode/skills/bobmatnyc-git-workflow.md) — skill · 556 installs
- [here-be-git](https://affpapa.org/en/nevibecode/skills/here-be-git.md) — skill · 527 installs
- [spatie-version-control](https://affpapa.org/en/nevibecode/skills/spatie-version-control.md) — skill · 480 installs
- [git-rebase](https://affpapa.org/en/nevibecode/skills/git-rebase.md) — skill · 376 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
