selvage — Claude Code MCP server: what it does, how to install
selvage gives coding agents focused Git-change context for code review, bug detection, and security checks.
claude mcp add selvage -- uvx selvageWhat selvage 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.
What it helps with
- 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 for the agent
- Review the current changes with
selvage mcpand list the bugs you find. - Compare the current branch with
mainusingselvage mcp. - Review the staged changes with
selvage mcpand flag security risks.
How to install selvage
Platform CLI
claude mcp add selvage -- uvx selvageuvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>
Platform CLI
codex mcp add selvage -- uvx selvageuvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add selvage uvx selvageuvx runs the command named after the package; if the README names another one, use uvx --from selvage <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about selvage
How do I install selvage in Claude Code?
Run claude mcp add selvage -- uvx selvage.
What does selvage do?
It analyzes Git changes, extracts AST-based context around affected code, and gives that context to an agent for bug and security review.
Does selvage need an API key?
The OpenRouter route requires OPENROUTER_API_KEY. With get_review_context, the host agent can perform the review with its own LLM and no external API key.