MCP Code Review Server
mcp-name: io.github.GoodJobwilliam/aicraft-code-review
中文文档:README.zh.md
Listed on: Smithery · mcpservers.org · cursor.directory
Code review as an MCP server. Connect it to Claude Code, Cursor, or any MCP-compatible AI assistant.
Features
review_code— Review any source code snippet for bugs, security, performance, and stylereview_diff— Review a git diff for potential issues before mergingreview_file— Review a local file by path
Powered by the same methodology as our Code Review Agent: OWASP Top 10 scanning, N+1 query detection, race condition analysis, and structured output with severity ratings.
Quick Start
Via uvx (no install)
# Add to your Claude Code MCP config:
claude mcp add code-review -- uvx --with "mcp<2" aicraft-code-review
Or add to your ~/.cursor/mcp.json or claude_desktop_config.json:
{
"mcpServers": {
"code-review": {
"command": "uvx",
"args": ["--with", "mcp<2", "aicraft-code-review"]
}
}
}
Via pip
pip install "aicraft-code-review" "mcp<2"
python -m mcp_code_review
⚠️ PyPI 0.1.0 does not cap
mcp, and mcp 2.0.0 removesServer.list_tools, which crashes the CLI on fresh installs. Install 0.1.1+ (which pinsmcp<2automatically) or pinmcp<2yourself.
CLI mode (no MCP client needed)
# Review a local file (discovers .mcp-code-review.yaml from the file's directory)
mcp-code-review review-file path/to/file.py
# Review a git diff
git diff | mcp-code-review review-diff
mcp-code-review review-diff --git
# Review a snippet
mcp-code-review review-code "import os; os.system('ls')"
Exit codes are CI-friendly: 0 clean, 1 high/medium issues, 2 critical issues.
Usage Examples
Once connected, ask your AI assistant:
"Review this Python code for security issues: [paste code]" "Review this diff before I commit: [paste diff]" "Review this file: /path/to/file.py"
The AI will call the MCP server and return structured results.
Sample Output
## Review Results
### 🔴 Critical (1)
| Line | Issue | Category | Fix |
|------|-------|----------|-----|
| 42 | SQL injection via f-string | Security | Use parameterized queries |
### 🟠 High (2)
| Line | Issue | Category | Fix |
|------|-------|----------|-----|
| 15 | Unvalidated user input | Security | Add input validation |
| 78 | N+1 query in loop | Performance | Add select_related |
### Summary
- **Critical**: 1 — must fix
- **High**: 2 — should fix
- **Medium**: 0
- **Info**: 0
Custom Rules & Team Profiles
Ship your team's code standards as a config file — no code changes needed.
.mcp-code-review.yaml/.yml/.json— auto-discovered from the reviewed file's directory upward; for snippets and diffs it is looked up from the server's working directoryMCP_CODE_REVIEW_CONFIGenv var — point every teammate at a shared config committed to your repo (team-shared rule profiles)- Custom regex rules with severity, message, and suggested fix
disabled_checks— silence noisy checksseverity_overrides— bump or lower any check (e.g. make hardcoded secrets blocking)min_severity— only report findings at or above a threshold (per-repo noise control)
Example .mcp-code-review.yaml
disabled_checks:
- todo_comment
severity_overrides:
hardcoded_secret: critical
min_severity: medium
custom_rules:
- name: no-console-log
pattern: 'console\.log\('
severity: high
category: quality
issue: Console logging left in production code
fix: Use a structured logger instead
Team setup
Commit the file to a shared repo, then wire every teammate's MCP client to it:
{
"mcpServers": {
"code-review": {
"command": "uvx",
"args": ["--with", "mcp<2", "aicraft-code-review"],
"env": {
"MCP_CODE_REVIEW_CONFIG": "/path/to/team-repo/.mcp-code-review.yaml"
}
}
}
}
Available check ids: dynamic_exec, sql_injection, deserialization, command_injection, input_py2, xss_innerhtml, hardcoded_secret, nplus1, unbounded_list, bare_except, empty_except, todo_comment, missing_return_type, long_lines, snake_case, pascal_case.
YAML configs need pip install "aicraft-code-review[yaml]"; JSON configs work with no extra dependencies.
Development
git clone https://github.com/GoodJobwilliam/aicraft
cd aicraft
pip install -e ".[dev]"
python -m mcp_code_review # Start server
Requirements
- Python 3.11+
- An MCP-compatible client (Claude Code, Cursor, etc.)
License
MIT
Metadata
Release files for aicraft-code-review 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aicraft_code_review-0.1.2.tar.gz | 14.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aicraft_code_review-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.9 kB
Release files / aicraft_code_review-0.1.2.tar.gz
| Download URL | aicraft_code_review-0.1.2.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
246d7375dc1cdb8039c7b05db46ce405af6b7ccfb62caea6bebd3e006fe2bfc9
|
|
BLAKE2b-256 checksum How to use checksums |
1079313b5e09d003c2493aaa1723713dedae83ad64c6303dc595d1d0c049fc82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / aicraft_code_review-0.1.2-py3-none-any.whl
| Download URL | aicraft_code_review-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab7396f5364c551381d9c9fee0e684ed70268cefde38e3063e24c3e0a11a646f
|
|
BLAKE2b-256 checksum How to use checksums |
875abe5a1460e58a917e8a5f6103d50594ddef2a90b1cf6cc9ddd110c15a8042
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for aicraft-code-review 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.