MCP server providing code quality checks (pylint and pytest) with smart LLM-friendly prompts for analysis and fixes. Enables Claude and other AI assistants to analyze your code and suggest improvements.
What is MCP Code Checker
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 LLMsrun_pytest_check
: Run pytest on the project code and generate smart prompts for LLMsrun_all_checks
: Run all code checks (pylint and pytest) and generate combined results
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 directory parameter (--project-dir
) is required for security reasons. All code checking operations will be restricted to this directory.
Using with Claude Desktop App
To enable Claude to use this code checking server for analyzing files in your local environment:
-
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
- Location:
-
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"
],
"env": {
"PYTHONPATH": "C:\\path\\to\\mcp_code_checker\\"
}
}
}
}
-
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
-
Restart the Claude desktop app to apply changes
Claude will now be able to analyze code in your specified project directory.
- Log files location:
- Windows:
%APPDATA%\Claude\logs
- These logs can be helpful for troubleshooting issues with the MCP server connection
- Windows:
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:
- Start MCP Inspector by running:
npx @modelcontextprotocol/inspector \
uv \
--directory C:\path\to\mcp_code_checker \
run \
src\main.py
-
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\
- Name:
- Python interpreter:
-
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
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
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
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.
The MIT License is a permissive license that allows reuse with minimal restrictions. It permits use, copying, modification, and distribution with proper attribution.
Links
- MCP Python SDK
- MCP Filesystem Tools
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
zhixiaoqiang antd components mcp
An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询
Submit Your MCP Server
Share your MCP server with the community
Submit Now