Supports environment configuration through .env files, enabling customization of knowledge graph settings and Ollama configuration parameters.
Provides integration with Ollama for AI-powered code reviews using local models, allowing the MCP server to utilize Ollama's capabilities to generate expert code reviews based on different programming principles.
MCP Code Expert System
A Python-based code review system using the Model Context Protocol (MCP). It provides code review capabilities through simulated expert personas like Martin Fowler and Robert C. Martin (Uncle Bob).
Features
- Code review based on Martin Fowler's refactoring principles 
- Code review based on Robert C. Martin's Clean Code principles 
- Knowledge graph storage of code, reviews, and relationships 
- Integration with Ollama for AI-powered reviews 
- Server-side Event (SSE) support for web integration 
Prerequisites
Python 3.10+
This project requires Python 3.10 or higher.
Ollama
Ollama is required for AI-powered code reviews.
- Install Ollama for your platform: - macOS: Download from ollama.com 
- Linux: - curl -fsSL https://ollama.com/install.sh | sh
- Windows: Windows WSL2 support via Linux instructions 
 
- Pull a recommended model: ollama pull llama3:8b
- Start the Ollama server: ollama serve
Installation
Run the setup script to install dependencies and create the virtual environment:
Configuration
Edit the .env file to configure (create from .env.example if needed):
Usage
Running the Server
Standard Mode (for Cursor Integration)
HTTP/SSE Mode (for Web Integration)
This will start the server at http://localhost:8000/sse for SSE transport.
For custom port:
Installing in Cursor
To install in Cursor IDE:
Available Tools
The server exposes these tools:
- ask_martin: Ask Martin Fowler to review code and suggest refactorings
- ask_bob: Ask Robert C. Martin (Uncle Bob) to review code based on Clean Code principles
- read_graph: Read the entire knowledge graph
- search_nodes: Search for nodes in the knowledge graph
- open_nodes: Open specific nodes by their names
Example Usage
To review a code snippet with Martin Fowler:
Project Structure
- server.py: Main server implementation with MCP integration
- experts/: Expert modules implementing the code review capabilities- __init__.py: Shared models and interfaces
- martin_fowler/: Martin Fowler expert implementation
- robert_c_martin/: Robert C. Martin expert implementation
 
- knowledge_graph.py: Knowledge graph for storing code and reviews
- ollama_service.py: Integration with Ollama for AI-powered reviews
- examples/: Example code for review in different languages
- requirements.txt: Python dependencies
- setup.sh: Setup script
Architecture
The system follows a modular architecture:
- Server Layer: Handles MCP protocol communication and routes requests 
- Expert Layer: Encapsulates code review logic for each expert 
- Service Layer: Provides AI integration and knowledge graph functionality 
Each expert implements a standard interface allowing for consistent handling and easy addition of new experts.
License
MIT
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Python-based system that provides AI-powered code reviews through simulated expert personas like Martin Fowler and Robert C. Martin, using the Model Context Protocol (MCP).
Related MCP Servers
- -security-license-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -5
- -security-license-qualityA server that implements the Model Context Protocol (MCP) for orchestrating code reviews using a multi-agent system with Melchior, Balthasar, and Casper agents.Last updated -2
- Asecurity-licenseAqualityAn MCP server that provides code review functionality using OpenAI, Google, and Anthropic models, serving as a "second opinion" tool that works with any MCP client.Last updated -11017MIT License
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server for advanced code analysis and editing with semantic search capabilities, enabling AI assistants to perform complex code operations through a standardized interface.Last updated -151