Skip to content

Setup with agent

Better Code Review Graph — Agent Setup Guide

Section titled “Better Code Review Graph — Agent Setup Guide”

Give this file to your AI agent to automatically set up better-code-review-graph.

2026-05-02 Update (v+): Plugin install (Option 1) now uses pure stdio mode. API keys are optional env vars. The previous “Zero-Config Relay” auto-spawn pattern has been removed. If you relied on the relay form to enter API keys, please:

  1. Set the env var directly in plugin config (Option 1), OR
  2. Use HTTP self-host mode (advanced; out of scope of this guide).

This plugin supports 1 install method only: stdio via plugin install (uvx/npx). Reason: the plugin needs direct host access to your project files (Godot project / repo path) and doesn’t ship Docker or HTTP variants.

For comparison, the other 6 plugins in this stack (better-notion-mcp, better-email-mcp, better-telegram-mcp, wet-mcp, mnemo-mcp, imagine-mcp) support 3 methods:

  1. Default — Plugin install (uvx/npx) stdio
  2. Fallback — Docker stdio (Windows/macOS PATH issues)
  3. Recommended — Docker HTTP (multi-device, OAuth/relay form, claude.ai web)

⚠️ Mutually exclusive — pick ONE per plugin (applies to those 6 plugins, not crg): For the 6 plugins above that offer Method 2 (Docker stdio) or Method 3 (HTTP), do NOT stack /plugin install AND a user mcpServers override — both would load simultaneously and create duplicate entries (plugin’s npx/uvx stdio + your override). Plugin matching is by endpoint (URL or command string) per CC docs, not by name — and npx/uvxdocker ≠ HTTP URL, so all three are distinct endpoints. Choosing Method 2 or Method 3 means losing the plugin’s skills/agents/hooks/commands. better-code-review-graph only offers Method 1, so this note is informational only — there is no Docker stdio or HTTP variant to conflict with the plugin install here.

Section titled “Option 1: Claude Code Plugin (Recommended)”

Plugin marketplace install runs the server in pure stdio mode with optional API key env vars. No daemon-bridge, no auto-spawn, no relay form. Graph storage is local SQLite — no external graph database required.

When you run /plugin install, Claude Code prompts you for the following credentials (declared in userConfig per CC docs). Sensitive values are stored in your system keychain and persist across /plugin update:

FieldRequiredWhere to obtain
JINA_AI_API_KEYOptionalhttps://jina.ai/api-key
GEMINI_API_KEYOptionalhttps://aistudio.google.com/apikey
OPENAI_API_KEYOptionalhttps://platform.openai.com/api-keys
COHERE_API_KEYOptionalhttps://dashboard.cohere.com/api-keys
Terminal window
# Install from marketplace (includes skills: /refactor-check, /review-delta, /review-pr + hooks)
/plugin marketplace add n24q02m/claude-plugins
/plugin install better-code-review-graph@n24q02m-plugins

The plugin includes SessionStart and PostToolUse hooks that auto-build and auto-update the code graph.

Other optional env vars (GEMINI_API_KEY, OPENAI_API_KEY, COHERE_API_KEY, EMBEDDING_BACKEND, etc.) are not part of the userConfig prompt; add them manually to mcpServers.better-code-review-graph.env in your settings if needed.

All environment variables are optional. The server works with local ONNX embeddings with zero configuration.

VariableRequiredDefaultDescription
JINA_AI_API_KEYNoJina AI key: embedding + reranking (highest priority)
GEMINI_API_KEYNoGoogle Gemini key: embedding (free tier available). Also accepts GOOGLE_API_KEY
OPENAI_API_KEYNoOpenAI key: embedding
COHERE_API_KEYNoCohere key: embedding + reranking. Also accepts CO_API_KEY
VariableRequiredDefaultDescription
EMBEDDING_BACKENDNoauto-detectcloud or local. Auto: API keys present -> cloud, else local
EMBEDDING_MODELNoauto-detectCloud embedding model name. Provider auto-detected from model prefix
VariableRequiredDefaultDescription
TRANSPORT_MODENostdioSet to http to enable HTTP transport (multi-user).
PUBLIC_URLYes (http)Server’s public URL for relay form.
DCR_SERVER_SECRETYes (http)HMAC secret for stateless Dynamic Client Registration.
PORTNo8080Server port (http mode only).
VariableRequiredDefaultDescription
LOG_LEVELNoINFOLogging level

Set API keys directly via env vars (or leave unset for local ONNX). No relay form, no browser flow.

After setup, verify the server is working by building the graph:

graph(action="build", repo_path="/path/to/your/repo")

Expected: returns a JSON summary with node counts, edge counts, and supported languages found.

Then try a search:

query(action="search", query="main function", repo_path="/path/to/your/repo")