Code Agent
БесплатноНе проверенAn AI-powered code review agent that leverages Model Context Protocol (MCP) and Claude to provide intelligent, context-aware code reviews.
Описание
An AI-powered code review agent that leverages Model Context Protocol (MCP) and Claude to provide intelligent, context-aware code reviews.
README
An AI-powered code review agent that leverages Model Context Protocol (MCP) and Claude to provide intelligent, context-aware code reviews.
✨ Features
- 🤖 AI-Powered Reviews: Uses Claude to provide intelligent code analysis
- 🔧 MCP Integration: Built on Model Context Protocol for tool-augmented LLM reasoning
- 📊 Code Metrics: Cyclomatic complexity, line counts, maintainability index
- 🎨 Style Checking: Detects common anti-patterns and style issues
- 📝 Git Integration: Review diffs, check history, understand context
- ⚡ Streaming Output: Real-time feedback as the AI analyzes your code
🚀 Quick Start
Installation
# Clone the repository
git clone https://github.com/geethikakoya/mcp-code-agent.git
cd mcp-code-agent
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e .
Set up API Key
# Get your API key from https://console.anthropic.com/
export ANTHROPIC_API_KEY=your_api_key_here
Usage
# Review a file
mcp-review review src/main.py
# Review with streaming output
mcp-review review --stream src/main.py
# Review git changes
mcp-review diff
# Explain what a file does
mcp-review explain src/utils.py
# Quick analysis (no AI, just metrics)
mcp-review analyze src/main.py
📖 Architecture
┌─────────────────────────────────────────────────────────────┐
│ Code Review Agent │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ CLI │─────▶│ Agent │─────▶│ Claude API │ │
│ │ (typer) │◀─────│ (reviewer) │◀─────│ (LLM) │ │
│ └──────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ MCP Tools │ │
│ └──────────────┘ │
│ │ │
│ ┌────────────┼────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ File │ │ Git │ │ Code │ │
│ │ Tools │ │ Tools │ │ Analysis│ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
🔧 MCP Tools
File Operations
| Tool | Description |
|---|---|
read_file |
Read file contents with optional line range |
list_directory |
List files and directories |
search_code |
Regex search across codebase |
Git Integration
| Tool | Description |
|---|---|
git_diff |
Get diff of changes |
git_log |
Get commit history |
get_changed_files |
List modified files |
Code Analysis
| Tool | Description |
|---|---|
calculate_complexity |
Cyclomatic complexity (Python) |
count_lines |
LOC, comments, blanks |
check_code_style |
Style issues and anti-patterns |
📝 Example Output
🔍 Reviewing: src/api/handler.py
📊 Metrics Summary
• Lines of Code: 142
• Cyclomatic Complexity: 8 (Moderate)
• Maintainability Index: 65.2
🔴 Critical Issues
1. Line 45: SQL injection vulnerability - use parameterized queries
⚠️ Warnings
1. Line 23: Function too long (>50 lines) - consider splitting
2. Line 67: Magic number - extract to constant
💡 Suggestions
1. Add type hints to function parameters
2. Consider using dataclass for UserData
✅ What's Good
• Good error handling in API endpoints
• Consistent naming conventions
🏗️ Project Structure
mcp-code-agent/
├── src/
│ ├── mcp_server/ # MCP Server (exposes tools)
│ │ ├── server.py # Main MCP server
│ │ └── tools/
│ │ ├── file_tools.py
│ │ ├── git_tools.py
│ │ └── analysis_tools.py
│ │
│ ├── agent/ # AI Agent
│ │ ├── reviewer.py # Code review logic
│ │ └── prompts.py # System prompts
│ │
│ └── cli/ # CLI interface
│ └── main.py
│
├── tests/
├── pyproject.toml
├── requirements.txt
└── README.md
🔌 Using as MCP Server
You can use this as a standalone MCP server with any MCP-compatible client:
# Run the MCP server
mcp-review server
Configure in your MCP client (e.g., Claude Desktop):
{
"mcpServers": {
"code-review": {
"command": "python",
"args": ["-m", "src.mcp_server.server"],
"cwd": "/path/to/mcp-code-agent"
}
}
}
🧪 Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/
📄 License
MIT License - see LICENSE for details.
👤 Author
Geethika Koya
- GitHub: @geethikakoya
- LinkedIn: geethika-koya
Built with ❤️ using Model Context Protocol and Claude
Установить Code Agent в Claude Desktop, Claude Code, Cursor
unyly install mcp-code-agentСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add mcp-code-agent -- uvx --from git+https://github.com/geethikakoya/mcp-code-agent mcp-code-agentFAQ
Code Agent MCP бесплатный?
Да, Code Agent MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Code Agent?
Нет, Code Agent работает без API-ключей и переменных окружения.
Code Agent — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Code Agent в Claude Desktop, Claude Code или Cursor?
Открой Code Agent на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Code Agent with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
