DEV Community

Codepeel AI
Codepeel AI

Posted on

Running Automated Code Reviews Inside Claude Code and Cursor via Stdio MCP

Waiting for a GitHub Actions runner or PR webhook after you push slows down your feedback loop. When you work alone, catching a security bug or regression before git commit saves you a round-trip.

You can wire CodePeel directly into Claude Code, Cursor, Cline, or Roo using its local Model Context Protocol server (@codepeelai/codepeel). The server runs over standard I/O (stdio) as a child process via npx, so it opens zero network ports on your machine.

Registering the Server in One Command

You need Node.js 18+ and a cpk_ API token from your CodePeel MCP settings (or you can use browser PKCE OAuth, covered below).

On macOS or Linux:

claude mcp add codepeel --env CODEPEEL_TOKEN=cpk_your_token_here -- npx -y @codepeelai/codepeel
Enter fullscreen mode Exit fullscreen mode

On Windows PowerShell:

claude mcp add codepeel --env CODEPEEL_TOKEN=cpk_your_token_here "--" npx -y @codepeelai/codepeel
Enter fullscreen mode Exit fullscreen mode

That writes a standard mcpServers block you can also drop into Cursor or Cline:

{
  "mcpServers": {
    "codepeel": {
      "command": "npx",
      "args": ["-y", "@codepeelai/codepeel"],
      "env": {
        "CODEPEEL_TOKEN": "cpk_your_token_here"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Code and run /mcp to verify the connection.

Two Auth Paths: Static Tokens vs. Loopback PKCE

If you run automated scripts or CI checks, pass CODEPEEL_TOKEN in the env block. Invalid or expired tokens fail fast with an explicit error message.

If you omit CODEPEEL_TOKEN, the server runs an interactive OAuth 2.0 PKCE flow on the first tool call:

  1. It generates a PKCE verifier and S256 challenge.
  2. It binds an ephemeral HTTP listener to 127.0.0.1:<PORT> and opens your browser.
  3. After GitHub approval, the callback exchanges the authorization code and caches the token locally.

Binding to 127.0.0.1 avoids opening external firewall ports or setting up reverse proxies.

What Tools Your Agent Gets

Once connected, the agent gets four live review tools:

Tool Required Input What It Does
review_code diff Scans a unified diff for bugs, OWASP flaws, and regressions
fix_code file, issue Generates a concrete patch for a flagged issue
ask_codepeel question Answers architecture questions using diff context
check_credits (none) Checks remaining monthly allowance without spending credits

In practice, your agent stages a change, runs git diff --cached, sends the diff to review_code, and reads the structured findings. You can also query past PR reviews across repos without spending credits using search_reviews, get_review, search_findings, and get_review_analytics.

Source and Docs

The MCP server source is open at codepeel/mcp-server. You can read the full setup guide on the CodePeel blog or test it on private repos with 30 free reviews/month at codepeel.com.

Top comments (0)