marcusjellinghaus_mcp_server_code_checker_python

marcusjellinghaus_mcp_server_code_checker_python

by MarcusJellinghaus
An MCP server that performs code quality checks (pylint and pytest) and generates LLM-friendly prompts for AI assistants like Claude.

Code Quality Checker for AI Assistants

Overview

The Code Quality Checker for AI Assistants is a Model Context Protocol (MCP) server designed to perform code quality checks using tools like pylint and pytest. This server enables AI assistants, such as Claude, to analyze your code and suggest improvements by generating smart prompts for large language models (LLMs). The server operates within a specified project directory, ensuring secure and controlled code analysis.

Features

  • Run Pylint Check: Executes pylint on the project code and generates LLM-friendly prompts to identify code quality issues.
  • Run Pytest Check: Runs pytest on the project code and provides detailed information about test failures.
  • Run All Checks: Combines pylint and pytest checks for a comprehensive code quality analysis.

Installation

# Clone the repository
git clone https://github.com/MarcusJellinghaus/mcp-code-checker.git
cd mcp-code-checker

# Create and activate a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -e .

Running the Server

python -m src.main --project-dir /path/to/project

The server uses FastMCP for operation. The --project-dir parameter is required to restrict code checking operations to the specified directory.

Using with Claude Desktop App

To integrate the Code Quality Checker with Claude Desktop:

  1. Modify the Claude configuration file:
  2. Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  4. Add the MCP server configuration:

{
    "mcpServers": {
        "code_checker": {
            "command": "C:\\path\\to\\mcp_code_checker\\.venv\\Scripts\\python.exe",
            "args": [
                "C:\\path\\to\\mcp_code_checker\\src\\main.py",
                "--project-dir",
                "C:\\path\\to\\your\\project"
            ],
            "env": {
                "PYTHONPATH": "C:\\path\\to\\mcp_code_checker\\"
            }
        }
    }
}
  1. Replace all C:\\path\\to\\ instances with your actual paths.
  2. Restart the Claude desktop app.

Using MCP Inspector

MCP Inspector allows you to debug and test the MCP server:

  1. Start MCP Inspector:
npx @modelcontextprotocol/inspector \
  uv \
  --directory C:\path\to\mcp_code_checker \
  run \
  src\main.py
  1. Configure the MCP Inspector web UI with the appropriate Python interpreter, arguments, and environment variables.

Security Features

  • All checks are performed within the specified project directory.
  • Code execution is limited to the Python test files within the project.
  • Results are formatted for easy interpretation by both humans and LLMs.

Development

Setting Up the Development Environment on Windows

REM Clone the repository
git clone https://github.com/MarcusJellinghaus/mcp-code-checker.git
cd mcp-code-checker

REM Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\activate

REM Install dependencies
pip install -e .

REM Install development dependencies
pip install -e ".[dev]"

Running with MCP Dev Tools

# Set the PYTHONPATH and run the server module using mcp dev
set PYTHONPATH=. && mcp dev src/server.py

License

This project is licensed under the MIT License. See the LICENSE file for details.

Links

Features & Capabilities

Categories
mcp_server model_context_protocol python claude pylint pytest code_quality api_integration

Implementation Details

Stats

0 Views
2 GitHub Stars

Repository Info

MarcusJellinghaus Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300