# selvage

selvage gives coding agents focused Git-change context for code review, bug detection, and security checks.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 36
- Author: selvage-lab
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/selvage-lab/selvage
- Updated: 2026-07-19
- HTML: https://affpapa.org/en/nevibecode/mcp/selvage

## What it does

selvage is an MCP server for reviewing Git changes. It handles staged and unstaged diffs, plus comparisons between branches or commits. Its Tree-sitter AST pass selects code around changed lines and includes related dependency statements, so the host agent can review a focused context.

The server can use OpenAI, Claude, or Gemini through OpenRouter. When the context grows beyond the model limit, it splits the work across multiple turns. With `get_review_context`, the host receives structured diff data, extracted context, and review instructions, then uses its own model to produce the review.

OpenRouter mode requires `OPENROUTER_API_KEY`; without it, that route will not start. Add the server to Claude Code with `claude mcp add selvage -- uvx selvage`.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add selvage -- uvx selvage
```
uvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>

### Codex

**Platform CLI**
```bash
codex mcp add selvage -- uvx selvage
```
uvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "selvage": {
            "command": "uvx",
            "args": [
                "selvage"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "selvage": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "selvage"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add selvage uvx selvage
```
uvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>

## When to use it
- review staged and unstaged Git changes
- compare the current branch with another branch
- spot bugs in changed code
- check modified code for security risks
- give an agent focused review context

## Example prompts
- Review the current changes with `selvage mcp` and list the bugs you find.
- Compare the current branch with `main` using `selvage mcp`.
- Review the staged changes with `selvage mcp` and flag security risks.

## Similar
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74559
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [Serena MCP: the IDE for your agent](https://affpapa.org/en/nevibecode/mcp/serena-mcp-the-ide-for-your-agent.md) — MCP server · ★ 30677
- [Repomix](https://affpapa.org/en/nevibecode/mcp/repomix.md) — MCP server · ★ 29027
- [Repowise](https://affpapa.org/en/nevibecode/mcp/repowise.md) — MCP server · ★ 7891
- [sem](https://affpapa.org/en/nevibecode/mcp/sem.md) — MCP server · ★ 3422

---
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
