
How to add Selvage to Claude Desktop
AI-powered code review automation: analyzes Git diffs to find bugs, security issues, and quality improvements. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 34โ ยท stdio ยท apikey
Claude Desktop config for Selvage
uv tool install selvage{
"mcpServers": {
"selvage": {
"command": "uvx",
"args": [
"selvage",
"mcp"
],
"env": {
"OPENROUTER_API_KEY": "your_openrouter_api_key_here"
}
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Selvage config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Selvage's tools appear under the ๐ tools menu.
Before you start
- uv (or pipx/pip) to install and run Selvage
- Git repository to review
- An LLM provider API key (OPENROUTER_API_KEY recommended, or OPENAI/ANTHROPIC/GEMINI keys) โ not required when using get_review_context / the Claude Code plugin
What Selvage can do in Claude Desktop
reviewRuns an AI code review of the current changes (staged, unstaged, or against a target branch/commit) using a selected model, returning quality improvements, bug findings, and security issues. Triggered via natural language such as 'Review current changes using selvage mcp'.
get_review_contextReturns structured review context (Git diff + AST-based Smart Context + system prompt) so the host agent (Claude Code, Cursor, Antigravity, etc.) can perform the code review with its own LLM โ no Selvage/external API key required.
Security
Selvage runs the code review itself using an LLM provider API key (OPENROUTER_API_KEY, or individual OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY). Keys are read from environment variables or the MCP `env` block โ keep them out of shared/committed config. Alternatively, use the `get_review_context` tool (or the Claude Code plugin) so the host agent reviews with its own LLM and no external API key is needed. Diffs of your code are sent to the chosen LLM provider for analysis.
Selvage + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Selvage config there under the "mcpServers" key and restart the client.
Is Selvage safe to use with Claude Desktop?
Selvage runs the code review itself using an LLM provider API key (OPENROUTER_API_KEY, or individual OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY). Keys are read from environment variables or the MCP `env` block โ keep them out of shared/committed config. Alternatively, use the `get_review_context` tool (or the Claude Code plugin) so the host agent reviews with its own LLM and no external API key is needed. Diffs of your code are sent to the chosen LLM provider for analysis.
Do I need an API key to use Selvage?
Not always. If you use the `get_review_context` tool (or the Claude Code plugin's /review skill), the host agent performs the review with its own LLM and no external API key is needed. For Selvage to run the review itself, set OPENROUTER_API_KEY (recommended) or an individual provider key.
How does it keep reviews cost-effective?
Selvage uses Tree-sitter based AST analysis (Smart Context) to send only the minimal function/class blocks containing changed lines plus their dependencies, instead of whole files. It also auto-switches to a multi-turn Large Context Mode once total tokens exceed ~200k.
Which AI models are supported?
OpenAI (e.g. gpt-5.2-codex), Anthropic (claude-opus-4.6, claude-sonnet-4.5), Google (gemini-3-pro/flash), and OpenRouter-provided models like minimax-m2.5, glm-5, qwen3-coder, kimi-k2.5, and DeepSeek โ all manageable with a single OpenRouter API key.