mcp-tools-py MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.8 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
基于MCP协议的代码质量检查工具,集成pylint和pytest功能,提供智能LLM友好的代码分析能力。适合需要自动化代码审查、集成开发环境的Python开发者和AI应用构建者使用。
mcp-tools-py MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于MCP协议的代码质量检查工具,集成pylint和pytest功能,提供智能LLM友好的代码分析能力。适合需要自动化代码审查、集成开发环境的Python开发者和AI应用构建者使用。
mcp-tools-py MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/MarcusJellinghaus/mcp-tools-py
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp-tools-py-mcp--": {
"command": "npx",
"args": ["-y", "mcp-tools-py"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 mcp-tools-py MCP工具 执行以下任务... Claude: [自动调用 mcp-tools-py MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp-tools-py_mcp__": {
"command": "npx",
"args": ["-y", "mcp-tools-py"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
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.
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:
project_dir.All tools are listed under Available Tools. The sections below document the parameters of the most-used ones.
| Parameter | Type | Description |
|---|---|---|
--project-dir | string | **Required**. Base directory for code checking operations |
Add this line to your requirements.txt:
mcp-tools-py @ git+https://github.com/MarcusJellinghaus/mcp-tools-py.git
[project.optional-dependencies] dev = [ "mcp-tools-py @ git+https://github.com/MarcusJellinghaus/mcp-tools-py.git", ] ```
pip install -r requirements.txt
pip install ".[dev]" ```
pip install -e .
pip install -e ".[dev]" ```
See INSTALL.md for detailed installation instructions.
Quick install:
```bash
pip install git+https://github.com/MarcusJellinghaus/mcp-tools-py.git
mcp-tools-py --help
**Development install:**
bash
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 --help ```
After adding to requirements.txt or pyproject.toml:
```bash
pip install .
1. First install the server:
pip install git+https://github.com/MarcusJellinghaus/mcp-tools-py.git
2. Configure with mcp-config (install it separately — it is not pulled in by this package):
mcp-config
Then 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.
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"
}
}
}
}
mcp-tools-py --project-dir /path/to/project [options]
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.
Mypy reads your project's pyproject.toml automatically, and [tool.mypy] is the single source of truth for the flag set — the tool adds only output-formatting flags, unless you pass follow_imports, cache_dir or disable_error_codes. A project with no [tool.mypy] section of its own has no floor: with no config in scope it runs at mypy's defaults and reports "passed" having checked very little; with a parent directory's config (mypy 1.15 and later) or a user-level ~/.config/mypy/config or ~/.mypy.ini in scope it runs at those settings and can report errors the project never asked for. See docs/pyproject-configuration.md for migration guidance and the effect on mypy's cache.
#### Python Configuration <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>--python-executable</td><td>string</td><td>sys.executable</td><td>Path to the Python interpreter of the project's environment. The checkers run in it and library/symbol lookups resolve against it, so it must be the environment holding the project's dependencies and the checker tools. A bare name is looked up on PATH; a path that neither exists nor resolves fails at startup</td></tr><tr><td>--venv-path</td><td>string</td><td>None</td><td>Deprecated, hidden from --help. Still accepted, and still resolves the interpreter (taking precedence over --python-executable), but no longer used to locate tools. Use --python-executable instead</td></tr></tbody></table></div>
#### Test Configuration <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>--test-folder</td><td>string</td><td>"tests"</td><td>Path to the test folder (relative to project-dir)</td></tr><tr><td>--keep-temp-files</td><td>flag</td><td>False</td><td>Keep temporary files after test execution. Useful for debugging when tests fail</td></tr></tbody></table></div>
#### Logging Configuration <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>--log-level</td><td>string</td><td>"INFO"</td><td>Set logging level. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL</td></tr><tr><td>--log-file</td><td>string</td><td>None</td><td>Path for structured JSON logs. If not specified, logs go to project_dir/logs/mcp_tools_py_{timestamp}.log</td></tr><tr><td>--console-only</td><td>flag</td><td>False</td><td>Log only to console: no default log file, and --log-file is ignored</td></tr></tbody></table></div>
#### Tool Configuration <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>--check-timeout</td><td>integer</td><td>None (120; pytest 300)</td><td>Timeout in seconds for every checker and formatter subprocess. Overridden per tool by [tool.mcp-tools-py] in the project's pyproject.toml — see Project configuration</td></tr><tr><td>--refactoring-timeout</td><td>integer</td><td>120</td><td>Timeout in seconds for rope refactoring operations</td></tr><tr><td>--vulture-whitelist</td><td>string</td><td>"vulture_whitelist.py"</td><td>Path to the vulture whitelist file, relative to project-dir. Auto-included by run_vulture_check when the file exists</td></tr></tbody></table></div>
There is one configurable environment: the project env, the virtual environment holding your project's dependencies and the checker tools. --python-executable names its interpreter. The two cannot be separated — pytest, pylint and mypy all import the project's dependencies to do their work — so the tools have to be installed alongside them. 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.
The tool env, where mcp_tools_py itself is installed, is a different environment and is not configured through this flag.
Library and symbol resolution (get_library_source, list_symbols, find_references) follows the same interpreter, so pointing the flag at the wrong venv makes those tools resolve against the wrong packages.
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.
Point to the project's venv, with the checker tools installed in it, 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"
Do not point to a venv without the checker tools installed:
{
"mcpServers": {
"mcp-tools-py": {
"command": "mcp-tools-py",
"args": [
"--project-dir", "/path/to/your/project",
"--python-executable", "/usr/bin/python3"
]
}
}
}
A system interpreter, or any venv that is not the project's, reports the tools as missing and resolves library and symbol lookups against the wrong packages. Your project's own .venv fails the same way if it doesn't have the required tools installed — install them there rather than pointing the flag elsewhere.
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:
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.
```bash
python -m venv .venv
After installation, you can run the server using the mcp-tools-py command:
mcp-tools-py --project-dir /path/to/project [options]
target_directories = ["mypackage", "tests"]
target_directories = ["module1", "module2", "shared", "tests"] ```
set PYTHONPATH=. && mcp dev src/server.py ```
You can also run the server as a Python module:
```bash python -m mcp_tools_py --project-dir /path/to/project [options]
--python-executable points 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.--python-executable points to an environment that doesn't have the required tools installed. Point it at the project's environment and install them there.--python-executable. The message names the directory searched; point --python-executable at the project's environment and install them there. A bare name such as python3 resolving to a system interpreter reports all five as unavailable, because they are not installed next to it.mcp-tools-py 是一个基于 Model Context Protocol (MCP) 标准构建的服务器,旨在为 AI 助手提供专业的 Python 代码质量检查能力。通过遵循 MCP 协议设计,该服务器可以为 Claude Desktop、VSCode (GitHub Copilot) 等兼容客户端提供 API 接口,使其能够直接在指定的 Python 项目目录中执行静态分析和测试任务,从而实现自动化的代码审查与纠错。
本项目集成了多种 Python 开发必���的质量检查工具,并针对 LLM(大语言模型)进行了优化。核心功能包括:使用 `run_pylint_check` 执行 pylint 检查并为 LLM 生成智能提示词;使用 `run_pytest_check` 运行 pytest 测试并生成易于理解的错误报告;以及使用 `run_mypy_check` 进行 mypy 类型检查。所有工具均旨在通过结构化的输出,帮助 AI 更精准地理解代码问题。
在使用本工具时,必须通过 `--project-dir` 参数指定需要进行代码检查的目标项目根目录。请注意,该参数是运行命令时必不可少的,用于确定检查操作的上下文范围。
您可以根据使用场景选择不同的安装方式。推荐使用 pip 直接从 GitHub 安装:`pip install git+https://github.com/MarcusJellinghaus/mcp-tools-py.git`。如果您希望将其作为项目依赖,请在 `requirements.txt` 中添加对应的 Git 链接。安装完成后,可以通过运行 `mcp-tools-py --help` 来验证安装是否成功。
在命令行中使用时,请通过 `mcp-tools-py --project-dir /path/to/project [options]` 的格式启动。请务必确保 `--project-dir` 指向正确的项目路径,并根据需要通过可选参数调整执行环境。
工具会自动读取项目中的 `pyproject.toml` 文件���配置 Pylint 的行为,您可以通过 `[tool.pylint.messages_control]` 节点自定义报告的错误类型。特别注意:`--python-executable` 参数应指向安装了 pytest、pylint 和 mypy 的 Python 解释器路径(通常是工具自身的虚拟环境),而非目标项目的运行环境,以确保检查工具能被正确调用。
本项目主要通过命令行界面 (CLI) 提供服务。安装完成后,开发者可以直接调用 `mcp-tools-py` 命令启动 MCP 服务器,通过标准的 MCP 协议与各类 AI 客户端进行交互,这是目前最推荐的使用方式。
对于不同结构的 Python 项目,您可以通过配置 `target_directories` 来指定检查范围(如 `["mypackage", "tests"]`)。对于复杂的多模块项目,请列出所有需要扫描的模块目录。在开发模式下,可以通过设置 `PYTHONPATH=.` 并使用 `mcp dev src/server.py` 命令来启动服务器模块进行调试。
针对常见问题:若遇到 "No module named pytest" 等模块缺失错误,通常是因为 `--python-executable` 或 `--venv-path` 指向的环境未安装相关工具。请检查配置并确保指向了包含这些工具的正确环境。在安装缺失工具后,请务必重启 MCP server 以使配置生效。
创意性强的MCP服务实现,结合代码质量检查和LLM交互,填补该领域空白。但项目还需更多社区验证和生态完善。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,mcp-tools-py MCP工具 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | mcp-tools-py |
| 原始描述 | 开源MCP工具:MCP server providing code quality checks (pylint and pytest) with smart LLM-frie。⭐16 · Python |
| Topics | 代码质量pylintpytestMCP服务器Python开发 |
| GitHub | https://github.com/MarcusJellinghaus/mcp-tools-py |
| License | MIT |
| 语言 | Python |
收录时间:2026-05-16 · 更新时间:2026-05-22 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端