# selvage-lab/selvage [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/selvage-lab/selvage  
**GitHub Stars:** 36  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/selvage-lab-selvage

## Description
LLM-based code review MCP server with AST-powered smart context extraction. Supports Claude, GPT, Gemini, and 20+ models via OpenRouter.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "selvage": {
    "command": "uvx",
    "args": ["selvage"],
    "env": {
      "OPENROUTER_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `OPENROUTER_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What selvage-lab/selvage MCP server does

The selvage-lab/selvage MCP server turns Git changes into review input for an AI coding workflow. It can inspect staged changes, unstaged work, a selected commit, or differences between branches. The resulting review is intended to surface code-quality problems, possible bugs, and security vulnerabilities.

The project supports two main operating patterns. In MCP mode, a compatible coding client can invoke reviews from a natural-language request. In agent-delegated mode, the `get_review_context` tool returns the diff, extracted code context, and a review system prompt so the host agent can complete the analysis with its own language model.

## How it works

For changed files, Selvage uses Tree-sitter-based AST analysis to identify the smallest relevant code blocks around changed lines. It also includes dependency statements needed to interpret those blocks. This produces a focused review context rather than sending an entire repository to the model.

Reviews can use OpenRouter-backed models, including model selections from OpenAI, Anthropic, and Google providers. When the accumulated request exceeds the supported context size, the application can split the review into multiple turns. Large-context processing automatically activates after total input exceeds 200,000 tokens.

The `get_review_context` path is different: it prepares structured material for the connected agent and does not require a Selvage API key. The host agent supplies the model used for the final review.

## Setup and configuration

Install the package with `uv tool install selvage`, `pipx install selvage`, or `pip install selvage`. The repository recommends `uv` or `pipx` on macOS and Linux when a regular pip installation encounters an externally managed environment.

For model-backed reviews, provide an OpenRouter credential through `OPENROUTER_API_KEY`. Register the MCP entry with a client using the command `uvx selvage mcp`; Cursor and Claude Code examples are provided in the project documentation. Claude Code can also install the project’s marketplace plugin, which adds a `/review` skill and a `selvage-reviewer` agent.

## Tools and capabilities

- Review unstaged, staged, commit-based, and branch-based changes.
- Extract AST-aware context and related dependency statements.
- Return structured review material through `get_review_context`.
- Use OpenRouter model selections for direct AI reviews.
- Split oversized reviews into multiple processing turns.
- Run directly from the terminal with commands such as `selvage review --model claude-sonnet-4-thinking`.

## Limitations and notes

Direct model-backed reviews require an OpenRouter API key and depend on the selected provider and model. Agent-delegated reviews avoid that external key, but the host client must provide the language model that evaluates the returned context. The documented integration examples cover Cursor and Claude Code; other clients need an MCP-compatible stdio registration method.

The selvage-lab/selvage MCP server analyzes Git differences rather than acting as a general repository management interface. Its context extraction is designed around changed code and the surrounding syntax or dependencies, so it is most applicable to review workflows tied to Git changes.

_Full upstream README: https://allmcps.com/mcp/selvage-lab-selvage/readme_

