MCP Directory

How to add Selvage to Cursor

AI-powered code review automation: analyzes Git diffs to find bugs, security issues, and quality improvements. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 34 · stdio · apikey

Cursor 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

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the Selvage config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of Selvage's tools to confirm it's connected.

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 Cursor

review

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

Returns 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 + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Selvage config there under the "mcpServers" key and restart the client.

Is Selvage safe to use with Cursor?

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.

View repo Full Selvage page