Selvage logo

Selvage

by selvage-lab

Reviews Git changes with AST-based context extraction and configurable AI models through MCP or the command line.

Install Selvage

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "selvage-lab-selvage": {
      "command": "uvx",
      "args": [
        "selvage"
      ],
      "env": {
        "OPENROUTER_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx selvage

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The selvage-lab/selvage MCP server reviews Git changes and supplies focused code context for AI analysis. It examines staged, unstaged, commit, and branch differences, using Tree-sitter AST analysis to include relevant code blocks and dependencies. MCP clients can request reviews through natural language, while the `get_review_context` tool lets host agents perform reviews with their own models without an OpenRouter key. Reach for it when you need automated checks for bugs, security issues, or code quality before merging or deploying.

Use cases

  • Review staged changes before creating a pull request
  • Compare a current branch with main for regressions
  • Check a commit for bugs and security vulnerabilities
  • Generate review context for a coding agent
  • Run automated checks in CI or before deployment

Key features

  • AST-based smart context extraction
  • Git diff, commit, and branch review
  • OpenRouter model support
  • Automatic multi-turn processing
  • Agent-delegated review context
  • MCP and CLI modes

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/26 checks healthy over the last 112d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · selvage (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars36Stargazers on the source repository.
Last commit4mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Selvage works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Selvage

selvage-lab/selvage is an MCP server that connects Git changes to AI code review workflows. Its main tools review staged, unstaged, commit, and branch differences, or return structured diff and AST-based context through `get_review_context` for a host agent to analyze.

Install it with `uv tool install selvage`, `pipx install selvage`, or `pip install selvage`. Register it in an MCP client with `uvx selvage mcp`. The project recommends uv or pipx on macOS and Linux when standard pip installation has environment restrictions.

Only direct model-backed reviews require an OpenRouter API key. Set `OPENROUTER_API_KEY` for those reviews; agent-delegated reviews using `get_review_context` can use the host agent’s own language model without a Selvage API key.

Yes, Cursor is a documented integration. Add an MCP entry that runs `uvx selvage mcp`, optionally passing `OPENROUTER_API_KEY` in the configuration, then request reviews through the coding assistant.

Yes, it supports staged changes, unstaged changes, specific commits, and comparisons between branches. Requests can specify a target such as the current branch versus `main` or ask for a review of staged work.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSelvage AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/selvage-lab-selvage?style=directory)](https://allmcps.com/mcp/selvage-lab-selvage)
HTML Embed
<a href="https://allmcps.com/mcp/selvage-lab-selvage"><img src="https://allmcps.com/api/badge/selvage-lab-selvage?style=directory" alt="Selvage on AllMCPs" /></a>