MCP Code Checker
Runs pytest tests on project code, identifies failing tests, and generates smart prompts for LLMs to explain issues and suggest fixes
Performs comprehensive code quality checks including pylint analysis, mypy type checking, and pytest execution on Python projects with configurable parameters for each tool
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Code Checkerrun all checks on the src directory and explain any issues found"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Tools Py
A Model Context Protocol (MCP) server providing code quality checking operations with easy client configuration. This server offers an 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), VSCode with GitHub Copilot, or other MCP-compatible clients to run code quality checks, formatting and refactoring on Python projects. See Available Tools for the full list.
Scope: This server covers Python projects only. Support for other languages can be provided through separate, dedicated MCP servers with similar functionality.
Why a dedicated MCP server instead of bash access?
A general-purpose bash MCP tool allows more flexibility, but at the expense of less control. This server takes a more focused approach:
Security: Only a defined set of tools can be executed — see Available Tools. All operations are scoped to the specified
project_dir.Context management: Results are formatted and size-limited to reduce context load on the AI assistant. Output is structured as actionable prompts rather than raw tool output.
Transparency: The server is open source, and detailed structured logging records every tool call with parameters, timing, and results.
Related MCP server: code-quality-mcp
Features
All tools are listed under Available Tools. The sections below document the parameters of the most-used ones.
Pylint Parameters
The pylint tools expose the following parameters for customization:
Parameter | Type | Default | Description |
| list | None | Optional list of additional pylint CLI arguments (e.g. |
| list | None (auto-detected) | Directories to analyze relative to project_dir. Auto-detected from |
| integer | 1 | Number of issue types shown in detail; the rest are summarised as counts |
Pylint Configuration
Pylint reads your project's pyproject.toml automatically. Control which issues
are reported by configuring [tool.pylint.messages_control] in your pyproject.toml.
See docs/pyproject-configuration.md for examples
and migration guidance.
Target Directory Auto-Detection
When target_directories is not specified, the tools that accept it (pylint, mypy, ruff
check, ruff fix, bandit, vulture, and run_format_code) auto-detect directories from
pyproject.toml:
Source dirs from
[tool.setuptools.packages.find] where(fallback:["src"])Test dirs from
[tool.pytest.ini_options] testpaths(fallback:["tests"])
Only directories that exist on disk are included. You can override auto-detection by passing an explicit list:
["src"]- Analyze only source code directory["src", "tests"]- Analyze both source and test directories["mypackage", "tests"]- For projects with different package structures["."]- Analyze entire project directory (may be slow for large projects)
Pytest Parameters
run_pytest_check exposes the following parameters for customization:
Parameter | Type | Default | Description |
| list | None | Optional list of pytest markers to filter tests |
| list | None | Optional list of additional pytest arguments; use |
| dictionary | None | Optional environment variables for the subprocess |
| integer | None (resolved from config, else 300) | Maximum seconds to wait for the test run. Positive integers only |
Note: Parallel test execution is enabled by default using pytest-xdist (-n auto).
Mypy Parameters
The mypy tools expose the following parameters for customization:
Parameter | Type | Default | Description |
| boolean | True | Use strict mode settings |
| list | None | List of mypy error codes to ignore |
| list | None (auto-detected) | Directories to check relative to project_dir. Auto-detected from |
| string | 'normal' | How to handle imports during type checking |
| string | None ( | Custom cache directory for incremental checking |
| integer | None (resolved from config, else 120) | Maximum seconds to wait for mypy. Positive integers only |
Command Line Interface (CLI)
Basic Usage
mcp-tools-py --project-dir /path/to/project [options]Required Parameters
Parameter | Type | Description |
| string | Required. Base directory for code checking operations |
Optional Parameters
Python Configuration
Parameter | Type | Default | Description |
| string | sys.executable | Path to the Python interpreter that runs the checker tools. Should point to the environment where they are installed (the tool's own venv), not the project's runtime venv. A bare name is looked up on PATH; a path that neither exists nor resolves fails at startup |
| string | None | Deprecated, hidden from |
Test Configuration
Parameter | Type | Default | Description |
| string | "tests" | Path to the test folder (relative to project-dir) |
| flag | False | Keep temporary files after test execution. Useful for debugging when tests fail |
Logging Configuration
Parameter | Type | Default | Description |
| string | "INFO" | Set logging level. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL |
| string | None | Path for structured JSON logs. If not specified, logs go to |
| flag | False | Log only to console: no default log file, and |
Tool Configuration
Parameter | Type | Default | Description |
| integer | None (120; pytest 300) | Timeout in seconds for every checker and formatter subprocess. Overridden per tool by |
| integer | 120 | Timeout in seconds for rope refactoring operations |
| string | "vulture_whitelist.py" | Path to the vulture whitelist file, relative to project-dir. Auto-included by |
Notes
When the deprecated
--venv-pathis specified, it takes precedence over--python-executable. Resolving the interpreter is now its only effectThe
--console-onlyflag is useful during development to avoid creating log filesLog files are created in JSON format for structured analysis
Temporary files are automatically cleaned up unless
--keep-temp-filesis specified
Environment Configuration
--python-executable must point to the environment where the checker tools are installed — pytest, pylint, mypy, black and isort are run through that interpreter, while ruff, bandit, vulture, tach and lint-imports are console scripts located next to it. This is typically the tool's own virtual environment, not your project's runtime venv.
The first example below builds that path by interpolating an environment variable, so an unset or stale variable leaves --python-executable pointing nowhere. The server then fails at startup with a FileNotFoundError naming the flag, rather than starting up and reporting every tool as missing. A bare interpreter name such as python3 is looked up on PATH instead.
Correct Configuration
Point to the venv where mcp-tools-py and its tools are installed, here on Windows:
{
"mcpServers": {
"mcp-tools-py": {
"command": "mcp-tools-py",
"args": [
"--project-dir", "/path/to/your/project",
"--python-executable", "${VIRTUAL_ENV}\\Scripts\\python.exe"
]
}
}
}On macOS and Linux the interpreter sits in bin instead:
"--python-executable", "${VIRTUAL_ENV}/bin/python"Incorrect Configuration
Do not point to your project's runtime venv if it doesn't have the checker tools installed:
{
"mcpServers": {
"mcp-tools-py": {
"command": "mcp-tools-py",
"args": [
"--project-dir", "/path/to/your/project",
"--python-executable", "/path/to/your/project/.venv/bin/python"
]
}
}
}This will fail if your project's .venv doesn't have the required tools installed.
Troubleshooting
"Python interpreter not found" at startup:
--python-executablepoints at a path that doesn't exist — usually because the environment variable it interpolates is unset. The message names the flag that supplied the path."No module named pytest" (or pylint/mypy/black/isort): Your
--python-executablepoints to an environment that doesn't have the required tools installed. Update the configuration to point to the correct environment."ruff is not available" (or bandit/vulture/tach/lint-imports): these tools are console scripts, looked for next to
--python-executable. The message names the directory searched; point--python-executableat an environment where they are installed. A bare name such aspython3resolving to a system interpreter reports all five as unavailable, because they are not installed next to it.After installing missing tools, restart the MCP server for changes to take effect. The console-script tools are located at startup; pytest, pylint, mypy, black and isort are checked on first use. Both results are cached for the session.
Installation
See INSTALL.md for detailed installation instructions.
Quick install:
# Install from GitHub (recommended)
pip install git+https://github.com/MarcusJellinghaus/mcp-tools-py.git
# Verify installation
mcp-tools-py --helpDevelopment install:
# Clone and install for development
git clone https://github.com/MarcusJellinghaus/mcp-tools-py.git
cd mcp-tools-py
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"
mcp-tools-py --helpMCP Client Configuration
This server can be configured with mcp-config, a separate Python tool you install yourself — it is not a dependency of this package. It provides:
Interactive setup: Works with Claude Desktop and VSCode
Configuration management: Add, remove, and view server configurations
Server repository: Access to curated MCP server collection
Prerequisites: Install Python, then install mcp-config separately.
Note: While other MCP clients like Windsurf and Cursor support MCP servers, they may require manual configuration.
Using as a Dependency
In requirements.txt
Add this line to your requirements.txt:
mcp-tools-py @ git+https://github.com/MarcusJellinghaus/mcp-tools-py.gitIn pyproject.toml
Add to your project dependencies:
[project]
dependencies = [
"mcp-tools-py @ git+https://github.com/MarcusJellinghaus/mcp-tools-py.git",
# ... other dependencies
]
# Or as an optional dependency
[project.optional-dependencies]
dev = [
"mcp-tools-py @ git+https://github.com/MarcusJellinghaus/mcp-tools-py.git",
]Installation Commands
After adding to requirements.txt or pyproject.toml:
# Install from requirements.txt
pip install -r requirements.txt
# Install from pyproject.toml
pip install .
# Or with optional dependencies
pip install ".[dev]"Running the Server
Using the CLI Command (Recommended)
After installation, you can run the server using the mcp-tools-py command:
mcp-tools-py --project-dir /path/to/project [options]Using Python Module (Alternative)
You can also run the server as a Python module:
python -m mcp_tools_py --project-dir /path/to/project [options]
# Or for development (from source directory)
python -m src.main --project-dir /path/to/project [options]For detailed information about all available command-line options, see the CLI section.
Project Structure Support
The server automatically detects and analyzes Python code in standard project structures:
Default Analysis:
src/directory (if present) - Main source codetests/directory (if present) - Test files
Custom Project Structures:
Use the target_directories parameter to specify different directories:
# For a package-based structure
target_directories = ["mypackage", "tests"]
# For a simple project with code in root
target_directories = ["."]
# For complex multi-module projects
target_directories = ["module1", "module2", "shared", "tests"]Structured Logging
The server provides comprehensive logging capabilities:
Standard human-readable logs to console for development/debugging
Structured JSON logs to file for analysis and monitoring
Function call tracking with parameters, timing, and results
Automatic error context capture with full stack traces
Configurable log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL)
Default timestamped log files in
project_dir/logs/mcp_tools_py_{timestamp}.log
Example structured log entries:
{
"timestamp": "2025-08-05 14:30:15",
"level": "info",
"event": "Starting pylint check",
"project_dir": "/path/to/project",
"target_directories": ["src", "tests"],
"max_issues": 1
}Use --console-only to disable file logging for simple development scenarios.
Quick MCP Client Setup
Automated Setup (Recommended)
First install the server:
pip install git+https://github.com/MarcusJellinghaus/mcp-tools-py.gitConfigure with mcp-config (install it separately — it is not pulled in by this package):
mcp-configThen select "Add New" and search for this server.
This will prompt you for your project directory and automatically configure your MCP client.
Note: mcp-config's server registry does not yet carry an entry for mcp-tools-py, so use the Manual Setup below if it cannot find this server.
Manual Setup
If you prefer manual configuration, edit your MCP configuration file:
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"mcp-tools-py": {
"command": "mcp-tools-py",
"args": ["--project-dir", "/path/to/your/project"]
}
}
}For development mode:
{
"mcpServers": {
"mcp-tools-py": {
"command": "python",
"args": [
"-m",
"src.main",
"--project-dir",
"/path/to/your/project"
],
"env": {
"PYTHONPATH": "/path/to/mcp-tools-py"
}
}
}
}VSCode (.vscode/mcp.json):
{
"servers": {
"mcp-tools-py": {
"command": "mcp-tools-py",
"args": ["--project-dir", "."]
}
}
}VSCode development mode:
{
"servers": {
"mcp-tools-py": {
"command": "python",
"args": ["-m", "src.main", "--project-dir", "."],
"env": {
"PYTHONPATH": "/path/to/mcp-tools-py"
}
}
}
}Testing with MCP Inspector
npx @modelcontextprotocol/inspector mcp-tools-py --project-dir /path/to/projectAvailable Tools
The server exposes 17 MCP tools.
Tool | What it does |
| Static analysis; findings returned as an LLM-actionable prompt |
| Runs the test suite, parses the JSON report, summarises failures |
| Strict-mode type checking with configurable error codes |
| Ruff lint analysis, read-only |
| Applies ruff's safe fixes in place; unsafe fixes are opt-in |
| Security lint |
| Dead-code detection against |
| Architectural boundary validation from |
| Import-contract validation from |
| Runs isort then black; |
| Top-level functions, classes and variables in a file |
| All references to a symbol across the project |
| Moves top-level symbols to another module, updating imports |
| Renames a module-level symbol project-wide |
| Moves a module into another package, updating references |
| Resolves a dotted import path and returns its source |
| Pauses execution for a given number of seconds |
Parameters for pylint, pytest and mypy are documented under Features.
Development
Setting up the development environment
# Clone the repository
git clone https://github.com/MarcusJellinghaus/mcp-tools-py.git
cd mcp-tools-py
# Create and activate a virtual environment
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix/MacOS:
source .venv/bin/activate
# Install dependencies
pip install -e .
# 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.pyLicense
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
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Proves AI-generated Python does what you asked: lint, types, security, sandbox run, exact fixes.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn intelligent continuous integration server that provides automated Python code analysis, linting, and static type checking through the Model Context Protocol. It enables AI assistants to perform quality assessments and run tests using tools like pylint, mypy, and pytest.MIT
- FlicenseNot gradedqualityDmaintenanceProvides deterministic Python code quality analysis using flake8, mypy, McCabe, and vulture, enabling LLMs to access real linting and type checking results.1-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage project analysis, code metrics, documentation, Git operations, code quality, and file organization through natural language commands.102MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered code review and improvement, including analysis, refactoring suggestions, and automatic test generation, with an optional agentic loop for iterative refinement.MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcusJellinghaus/mcp-tools-py'
If you have feedback or need assistance with the MCP directory API, please join our Discord server