JSPM

@codepeelai/mcp-server

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 72
  • Score
    100M100P100Q79576F
  • License MIT

CodePeel MCP Server — AI code review tools for Claude Code, Kiro, Cline, Roo, and other MCP-compatible agents

Package Exports

  • @codepeelai/mcp-server
  • @codepeelai/mcp-server/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@codepeelai/mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CodePeel MCP Server

npm version License: MIT MCP Compatible

A Model Context Protocol (MCP) server for AI-powered code review. Enables LLMs to review code diffs, generate fixes, and ask code questions — using the same engine that runs on 527+ GitHub PRs.

Features

  • Code Review: Review diffs for bugs, security issues, and best practice violations
  • Auto-Fix: Generate fixes for specific issues with code snippets and explanations
  • Ask CodePeel: Query code patterns, architecture decisions, and improvement suggestions
  • Check Credits: Monitor your review quota and usage (free — does not consume a review)
  • Reusable Prompts: Pre-built workflows for pre-commit review, security audit, and explain-and-fix

Quick Start

No installation required! Run directly with npx:

npx -y @codepeelai/mcp-server

Prerequisites

  1. CodePeel API Token: Create at codepeel.com → Settings → API Tokens
    • Token starts with cpk_ and does not expire until revoked
  2. Node.js 18+: Required for running the server

Configuration

Claude Desktop Configuration

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add the CodePeel MCP server:

{
  "mcpServers": {
    "codepeel": {
      "command": "npx",
      "args": ["-y", "@codepeelai/mcp-server"],
      "env": {
        "CODEPEEL_TOKEN": "cpk_your_token_here"
      }
    }
  }
}

Restart Claude Desktop after saving.

Claude Code Configuration

Create or edit .claude/settings.json in your project:

{
  "mcpServers": {
    "codepeel": {
      "command": "npx",
      "args": ["-y", "@codepeelai/mcp-server"],
      "env": {
        "CODEPEEL_TOKEN": "cpk_your_token_here"
      }
    }
  }
}

Pro tip: Use environment variables instead of hardcoding the token:

{
  "mcpServers": {
    "codepeel": {
      "command": "npx",
      "args": ["-y", "@codepeelai/mcp-server"],
      "env": {
        "CODEPEEL_TOKEN": "${CODEPEEL_TOKEN}"
      }
    }
  }
}

Then set the CODEPEEL_TOKEN environment variable in your shell before starting Claude Code.

VS Code / Cursor / Cline / Roo

Add an MCP server with:

  • Command: npx
  • Args: -y @codepeelai/mcp-server
  • Env: CODEPEEL_TOKEN=cpk_your_token_here

Usage

Automated Workflow Prompts

Use built-in MCP prompts for complete review workflows:

review-staged-changes — Pre-commit review

Review my staged changes before I commit them.
1. Run `git diff --cached` to get the staged diff
2. Pass the diff to the `review_code` tool
3. Report all findings and suggest fixes for any issues

security-audit — Security-focused review

Perform a security-focused code review.
1. Get the current diff with `git diff`
2. Pass it to the `review_code` tool
3. Prioritize: injection vulnerabilities, hardcoded secrets, auth flaws, insecure data handling
4. For critical/high findings, use `fix_code` to generate concrete fixes

explain-and-fix — Full review cycle

Review code, explain each finding in detail, and generate fixes for all issues found.
1. Run `git diff` to get changes
2. Pass to `review_code`
3. For each finding: explain the issue, describe impact, use `fix_code`, apply the fix
4. Summarize all changes made

Manual Tool Usage

Available Tools

1. review_code

Review a diff for bugs, security issues, and best practice violations.

{
  "diff": "--- a/src/auth.ts\n+++ b/src/auth.ts\n@@ -10,7 +10,7 @@\n-  const token = req.headers.authorization;\n+  const token = req.headers.authorization?.split(' ')[1];",
  "repo": "my-app"
}

2. fix_code

Generate a fix for a specific code issue.

{
  "file": "src/auth.ts",
  "issue": "Token extraction from Authorization header is unsafe — crashes if header is missing",
  "problemCode": "const token = req.headers.authorization;",
  "line": 12,
  "severity": "high"
}

3. ask_codepeel

Ask a question about code patterns, architecture, or improvements.

{
  "question": "Is this JWT validation approach secure enough for production?",
  "diff": "--- a/src/middleware.ts\n+++ b/src/middleware.ts\n..."
}

4. check_credits

Check your account balance, plan tier, and usage.

{}

Development Installation

For development or local customization:

git clone https://github.com/hexivine/codepeel.git
cd codepeel/codepeel-mcp
npm install
npm run build

Development Commands

# Build TypeScript
npm run build

# Run the server in dev mode
npm run dev

Environment Variables

Variable Required Description
CODEPEEL_TOKEN Yes Your API token from Settings (starts with cpk_)

Create a .env file (optional, loaded automatically):

CODEPEEL_TOKEN=cpk_your_token_here

Troubleshooting

Common Issues

Server not loading (NPX):

  • Verify Node.js 18+ is installed: node --version
  • Test npx execution manually: npx -y @codepeelai/mcp-server
  • Check your internet connection (npx downloads the latest version)

"CODEPEEL_TOKEN not set":

  • Set the CODEPEEL_TOKEN environment variable in your MCP config (see Configuration above)

"Token expired" / "Invalid token":

  • You're using a Firebase ID token instead of an API token. Create a cpk_ token in Settings → API Tokens.

"No credits remaining":

Rate limit exceeded:

  • Wait the indicated time and retry. Free: 3/hour, Pro: 6/hour, Max: 12/hour.

Server starts but tools don't appear:

  • Restart your AI editor after adding the MCP config.
  • Verify the command is "npx" and args are ["-y", "@codepeelai/mcp-server"].

Debug Mode

Enable debug logging:

DEBUG=* npx -y @codepeelai/mcp-server

Integration Requirements

Supported AI Clients

  • Claude Desktop: Full support with configuration
  • Claude Code: Project-level MCP integration with built-in prompts
  • VS Code / Cursor / Cline / Roo: Any MCP-compatible editor

Authentication

API tokens are created at codepeel.com → Settings → API Tokens. Tokens start with cpk_ and do not expire until revoked.

Architecture

  • TypeScript: Fully typed implementation with Zod validation
  • MCP SDK: Built on the official Model Context Protocol SDK
  • Modular Design: Each tool is implemented in its own module
  • MCP Prompts: Automated workflows available as slash commands

API Rate Limits

The server respects CodePeel's API rate limits:

  • Free: 3 reviews/hour
  • Pro: 6 reviews/hour
  • Max: 12 reviews/hour

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the build: npm run build
  5. Submit a pull request

License

MIT

Support