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

> Source: <https://dev.to/codepeel_ai_f72084daf2b2b/running-automated-code-reviews-inside-claude-code-and-cursor-via-stdio-mcp-27ff>
> Published: 2026-11-25 15:59:55+00:00

**Key takeaway:** Adding CodePeel's stdio MCP server via `claude mcp add codepeel --env CODEPEEL_TOKEN=... -- npx -y @codepeelai/codepeel` gives coding agents review_code, fix_code, ask_codepeel and check_credits tools that run locally without opening network ports.

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](https://www.codepeel.com) directly into Claude Code, Cursor, Cline, or Roo using its local [Model Context Protocol](https://modelcontextprotocol.io) 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.

You need Node.js 18+ and a `cpk_` API token from your [CodePeel MCP settings](https://www.codepeel.com/app/settings?tab=api-tokens) (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
```

On Windows PowerShell:

```
claude mcp add codepeel --env CODEPEEL_TOKEN=cpk_your_token_here "--" npx -y @codepeelai/codepeel
```

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"
      }
    }
  }
}
```

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

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:

`S256` challenge.`127.0.0.1:<PORT>` and opens your browser.
Binding to `127.0.0.1` avoids opening external firewall ports or setting up reverse proxies.

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`.

The MCP server source is open at [codepeel/mcp-server](https://github.com/codepeel/mcp-server). You can read the full setup guide on the [CodePeel blog](https://www.codepeel.com/blog/mcp-server-claude-code) or test it on private repos with 30 free reviews/month at [codepeel.com](https://www.codepeel.com).
