
MCP Code Expert System
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).
README
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:
chmod +x setup.sh
./setup.sh
Configuration
Edit the .env
file to configure (create from .env.example
if needed):
# Knowledge Graph Settings
KNOWLEDGE_GRAPH_PATH=data/knowledge_graph.json
# Ollama Configuration (local AI models)
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3:8b
Usage
Running the Server
Standard Mode (for Cursor Integration)
source .venv/bin/activate
python server.py
HTTP/SSE Mode (for Web Integration)
source .venv/bin/activate
python server.py --transport sse
This will start the server at http://localhost:8000/sse
for SSE transport.
For custom port:
python server.py --transport sse --port 9000
Installing in Cursor
To install in Cursor IDE:
source .venv/bin/activate
mcp install server.py --name "Code Expert System"
Available Tools
The server exposes these tools:
ask_martin
: Ask Martin Fowler to review code and suggest refactoringsask_bob
: Ask Robert C. Martin (Uncle Bob) to review code based on Clean Code principlesread_graph
: Read the entire knowledge graphsearch_nodes
: Search for nodes in the knowledge graphopen_nodes
: Open specific nodes by their names
Example Usage
To review a code snippet with Martin Fowler:
{
"code": "function calculateTotal(items) {\n var total = 0;\n for (var i = 0; i < items.length; i++) {\n total += items[i].price;\n }\n return total;\n}",
"language": "javascript",
"description": "Calculate the total price of items"
}
Project Structure
server.py
: Main server implementation with MCP integrationexperts/
: Expert modules implementing the code review capabilities__init__.py
: Shared models and interfacesmartin_fowler/
: Martin Fowler expert implementationrobert_c_martin/
: Robert C. Martin expert implementation
knowledge_graph.py
: Knowledge graph for storing code and reviewsollama_service.py
: Integration with Ollama for AI-powered reviewsexamples/
: Example code for review in different languagesrequirements.txt
: Python dependenciessetup.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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.