Cover image
Try Now
2025-04-01

MCP Server que proporciona verificaciones de calidad de código (Pylint y Pytest) con indicaciones amigables con Smart LLM para análisis y correcciones. Permite que Claude y otros asistentes de IA analicen su código y sugieran mejoras.

3 years

Works with Finder

2

Github Watches

1

Github Forks

3

Github Stars

MCP Code Checker

A Model Context Protocol (MCP) server providing code quality checking operations. This server offers a API for performing code quality checks within a specified project directory, following the MCP protocol design.

Overview

This MCP server enables AI assistants like Claude (via Claude Desktop) or other MCP-compatible systems to perform quality checks on your code. With these capabilities, AI assistants can:

  • Run pylint checks to identify code quality issues
  • Execute pytest to identify failing tests
  • Generate smart prompts for LLMs to explain issues and suggest fixes
  • Combine multiple checks for comprehensive code quality analysis

All operations are securely contained within your specified project directory, giving you control while enabling powerful AI collaboration for code quality improvement.

By connecting your AI assistant to your code checking tools, you can transform your debugging workflow - describe what you need in natural language and let the AI identify and fix issues directly in your project files.

Features

  • run_pylint_check: Run pylint on the project code and generate smart prompts for LLMs
  • run_pytest_check: Run pytest on the project code and generate smart prompts for LLMs
  • run_all_checks: Run all code checks (pylint and pytest) and generate combined results

Pylint Parameters

The pylint tools expose the following parameters for customization:

Parameter Type Default Description
disable_codes list None List of pylint error codes to disable during analysis

Additionally, run_all_checks exposes:

Parameter Type Default Description
pylint_categories set ERROR, FATAL Set of pylint message categories to include (convention, refactor, warning, error, fatal)

Pytest Parameters

Both run_pytest_check and run_all_checks expose the following parameters for customization:

Parameter Type Default Description
test_folder string "tests" Path to the test folder relative to project directory
markers list None Optional list of pytest markers to filter tests
verbosity integer 2 Pytest verbosity level (0-3)
extra_args list None Optional list of additional pytest arguments
env_vars dictionary None Optional environment variables for the subprocess
keep_temp_files boolean False Whether to keep temporary files after execution
continue_on_collection_errors boolean True Whether to continue on collection errors
python_executable string None Path to Python interpreter to use for running tests
venv_path string None Path to virtual environment to activate for running tests

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 [--python-executable /path/to/python] [--venv-path /path/to/venv]

The server uses FastMCP for operation. The project directory parameter (--project-dir) is required for security reasons. All code checking operations will be restricted to this directory.

Additional parameters:

  • --python-executable: Optional path to Python interpreter to use for running tests
  • --venv-path: Optional path to virtual environment to activate for running tests

Using with Claude Desktop App

To enable Claude to use this code checking server for analyzing files in your local environment:

  1. Create or modify the Claude configuration file:

    • Location: %APPDATA%\Claude\claude_desktop_config.json (on Windows)
    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add the MCP server configuration to the file:

{
    "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",
            "--python-executable",
            "C:\\path\\to\\python.exe",
            "--venv-path",
            "C:\\path\\to\\venv"
            ],
            "env": {
                "PYTHONPATH": "C:\\path\\to\\mcp_code_checker\\"
            }
        }
    }
}
  1. Replace all C:\\path\\to\\ instances with your actual paths:

    • Point to your Python virtual environment
    • Set the project directory to the folder you want Claude to check
    • Make sure the PYTHONPATH points to the mcp_code_checker root folder
  2. Restart the Claude desktop app to apply changes

Claude will now be able to analyze code in your specified project directory.

  1. Log files location:
    • Windows: %APPDATA%\Claude\logs
    • These logs can be helpful for troubleshooting issues with the MCP server connection

For more information on logging and troubleshooting, see the MCP Documentation.

Using MCP Inspector

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

  1. Start MCP Inspector by running:
npx @modelcontextprotocol/inspector \
  uv \
  --directory C:\path\to\mcp_code_checker \
  run \
  src\main.py
  1. In the MCP Inspector web UI, configure with the following:

    • Python interpreter: C:\path\to\mcp_code_checker\.venv\Scripts\python.exe
    • Arguments: C:\path\to\mcp_code_checker\src\main.py --project-dir C:\path\to\your\project
    • Environment variables:
      • Name: PYTHONPATH
      • Value: C:\path\to\mcp_code_checker\
  2. This will launch the server and provide a debug interface for testing the available tools.

Available Tools

The server exposes the following MCP tools:

Run Pylint Check

  • Runs pylint on the project code and generates smart prompts for LLMs
  • Returns: A string containing either pylint results or a prompt for an LLM to interpret
  • Helps identify code quality issues, style problems, and potential bugs
  • Customizable with parameters for disabling specific pylint codes

Run Pytest Check

  • Runs pytest on the project code and generates smart prompts for LLMs
  • Returns: A string containing either pytest results or a prompt for an LLM to interpret
  • Identifies failing tests and provides detailed information about test failures
  • Customizable with parameters for test selection, environment, and verbosity

Run All Checks

  • Runs all code checks (pylint and pytest) and generates combined results
  • Returns: A string containing results from all checks and/or LLM prompts
  • Provides a comprehensive analysis of code quality in a single operation
  • Supports customization parameters for both pylint and pytest

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/yourusername/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.

The MIT License is a permissive license that allows reuse with minimal restrictions. It permits use, copying, modification, and distribution with proper attribution.

Links

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    5 (1)
    Avatar
    user_90mdGIy7
    2025-04-17

    As a dedicated user of the mcp-code-checker, I’ve found this tool invaluable for code validation and error detection. Created by MarcusJellinghaus, it seamlessly integrates into my workflow, saving me countless hours of debugging. Highly recommended for any developer looking to streamline their coding process! Check it out on GitHub: https://github.com/MarcusJellinghaus/mcp-code-checker.