Python Code Linter MCP Tool
CLI Tool Name: python_lint_checker
Static analysis for Python files. Detects syntax errors, unused imports, style violations, and complexity issues. Runs entirely on your machine — zero external dependencies, zero network calls.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file_path | string | yes | Absolute or relative path to the Python file to analyze. |
What it checks
Syntax errors
Invalid Python syntax that prevents execution.
Unused imports
Imported modules and symbols that are never used.
Undefined variables
References to names that are not defined in scope.
Line length
Lines exceeding PEP 8's 79-character limit.
Complexity
Functions and methods with high cyclomatic complexity.
Style violations
PEP 8 formatting issues — spacing, naming, indentation.
Severity levels
ERRORMust fix. These prevent correct execution or indicate definite bugs.
WARNINGShould fix. Code quality issues that may cause problems.
INFOOptional. Style suggestions that improve readability.
Example output
{
"file": "src/utils.py",
"findings": [
{
"line": 14,
"severity": "ERROR",
"code": "E0001",
"message": "SyntaxError: invalid syntax"
},
{
"line": 42,
"severity": "WARNING",
"code": "W0611",
"message": "Unused import: os"
},
{
"line": 67,
"severity": "WARNING",
"code": "C0301",
"message": "Line too long (92 > 79 characters)"
}
],
"summary": {
"errors": 1,
"warnings": 2,
"info": 0
}
}How to use it
Your AI client calls this tool automatically when configured. You can also prompt your assistant directly:
example prompt
Check src/main.py for any lint errors or code quality issues.
python_lint_checker to your Claude Code hooks to automatically lint every Python file you write or edit — no prompting required.