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
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
Installation (NPX - Recommended)
No installation required! Run directly with npx:
npx -y @codepeelai/mcp-serverPrerequisites
- CodePeel API Token: Create at codepeel.com → Settings → API Tokens
- Token starts with
cpk_and does not expire until revoked
- Token starts with
- 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 issuessecurity-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 fixesexplain-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 madeManual 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 buildDevelopment Commands
# Build TypeScript
npm run build
# Run the server in dev mode
npm run devEnvironment 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_hereTroubleshooting
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_TOKENenvironment 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":
- Upgrade your plan at codepeel.com/#pricing or wait for credits to reset.
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
commandis"npx"andargsare["-y", "@codepeelai/mcp-server"].
Debug Mode
Enable debug logging:
DEBUG=* npx -y @codepeelai/mcp-serverIntegration 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
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the build:
npm run build - Submit a pull request
License
MIT
Support
- Issues: GitHub Issues
- Documentation: codepeel.com/docs/mcp