MCP server for Python code analysis with RUFF linting and VULTURE dead code detection
Project description
MCP Server Analyzer for Python 🐍🔍
A powerful Model Context Protocol (MCP) server that provides comprehensive Python code analysis using RUFF for linting and VULTURE for dead code detection. Perfect for AI assistants, IDEs, and automated code review workflows.
🚀 Quick Start
VS Code Integration (One-Click Install)
For quick installation, use one of the one-click install buttons below...
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).
Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
Note that the
mcpkey is needed when using themcp.jsonfile.
Using uvx (recommended):
{
"mcp": {
"servers": {
"analyzer": {
"command": "uvx",
"args": ["mcp-server-analyzer"]
}
}
}
}
Using Docker:
{
"mcp": {
"servers": {
"analyzer": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/anselmoo/mcp-server-analyzer"]
}
}
}
}
Universal Installation
# Install with uvx (recommended)
uvx install mcp-server-analyzer
# Install with pip
pip install mcp-server-analyzer
# Run with Docker
docker run ghcr.io/anselmoo/mcp-server-analyzer:latest
# Install from source
git clone https://github.com/anselmoo/mcp-server-analyzer.git
cd mcp-server-analyzer
uv sync --dev
uv run mcp-server-analyzer
📋 Features
- 🔍 RUFF Analysis: Comprehensive Python linting with auto-fixes
- 🧹 Dead Code Detection: Find unused imports, functions, and variables with VULTURE
- 📊 Quality Scoring: Combined analysis with quality metrics
- 🚀 FastMCP Framework: High-performance MCP server implementation
- 🐳 Docker Ready: Multi-architecture containers with security signing
- 🔒 Secure: All releases signed with Sigstore for supply chain security
📈 Analysis Examples
RUFF Linting Preview
See comprehensive linting analysis examples: 📋 RUFF Analysis Preview
VULTURE Dead Code Detection Preview
Explore dead code detection capabilities: 🧹 VULTURE Analysis Preview
🛠️ Available Tools
| Tool | Description | Use Case |
|---|---|---|
ruff-check |
Lint Python code with RUFF | Style violations, potential errors |
ruff-format |
Format Python code with RUFF | Code formatting and consistency |
ruff-check-ci |
CI/CD optimized RUFF output | GitHub Actions, GitLab CI |
vulture-scan |
Dead code detection | Unused imports, functions, variables |
analyze-code |
Combined RUFF + VULTURE analysis | Complete code quality assessment |
🔧 Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"analyzer": {
"command": "uvx",
"args": ["mcp-server-analyzer"]
}
}
}
Zed
Add to your Zed settings.json:
"context_servers": {
"analyzer": {
"command": "uvx",
"args": ["mcp-server-analyzer"]
}
}
🧪 Development
Prerequisites
Setup
# Clone repository
git clone https://github.com/anselmoo/mcp-server-analyzer.git
cd mcp-server-analyzer
# Install dependencies
uv sync --dev
# Run tests
uv run pytest
# Run pre-commit hooks
uv tool run pre-commit run --all-files
# Build Docker image
docker build -t mcp-server-analyzer .
Testing
# Run all tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest --cov=src/mcp_server_analyzer --cov-report=html
# Test specific functionality
uv run pytest tests/test_server.py::TestAnalyzer::test_ruff_analysis
📊 Quality Metrics
The server provides quality scoring based on:
- RUFF Issues: Style violations, potential bugs, complexity metrics
- Dead Code Detection: Unused imports, functions, variables
- Combined Score: Weighted quality assessment (0-100)
🔒 Security
- Signed Releases: All releases signed with Sigstore
- Container Signing: Docker images signed with Cosign
- Trusted Publishing: PyPI releases use GitHub OIDC trusted publishing
- Vulnerability Scanning: Automated security scanning in CI/CD
- Supply Chain Security: SLSA Build Level 3 compliance
📚 Documentation
- MCP Specification - Learn about Model Context Protocol
- FastMCP Framework - High-performance MCP implementation
- RUFF Documentation - Python linter and formatter
- VULTURE Documentation - Dead code finder
🤝 Contributing
Contributions are welcome! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Astral for RUFF and uv
- Jendrik Seipp for VULTURE
- Model Context Protocol team
- FastMCP framework
Made with ❤️ for better Python code quality
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_analyzer-0.1.2.tar.gz.
File metadata
- Download URL: mcp_server_analyzer-0.1.2.tar.gz
- Upload date:
- Size: 115.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c660003a0fe00f4cc9fdb6ec6c109076bed42ece9e0a8c1f880025ffde22fe54
|
|
| MD5 |
145850c5c7cb83556829326d5de5f124
|
|
| BLAKE2b-256 |
e877ee42669ae1db4655d348f41804545373810ed4e6af5937bf6608d19ab3e8
|
Provenance
The following attestation bundles were made for mcp_server_analyzer-0.1.2.tar.gz:
Publisher:
ci-cd.yml on Anselmoo/mcp-server-analyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_analyzer-0.1.2.tar.gz -
Subject digest:
c660003a0fe00f4cc9fdb6ec6c109076bed42ece9e0a8c1f880025ffde22fe54 - Sigstore transparency entry: 1383913119
- Sigstore integration time:
-
Permalink:
Anselmoo/mcp-server-analyzer@941c5cb7c047afef76ccc4f9a0af3be9416a980f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Anselmoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@941c5cb7c047afef76ccc4f9a0af3be9416a980f -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_server_analyzer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mcp_server_analyzer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e14a49d777e27517ff561a78836f1fd4b13fc4cf46c6425529361c5e341e1ae
|
|
| MD5 |
18aae73158d65dad107885979f70a18b
|
|
| BLAKE2b-256 |
3b7e459d6e0702b1d0ce9efee990a85c5ad490ffeffce1361753b244d4e43221
|
Provenance
The following attestation bundles were made for mcp_server_analyzer-0.1.2-py3-none-any.whl:
Publisher:
ci-cd.yml on Anselmoo/mcp-server-analyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_analyzer-0.1.2-py3-none-any.whl -
Subject digest:
7e14a49d777e27517ff561a78836f1fd4b13fc4cf46c6425529361c5e341e1ae - Sigstore transparency entry: 1383913163
- Sigstore integration time:
-
Permalink:
Anselmoo/mcp-server-analyzer@941c5cb7c047afef76ccc4f9a0af3be9416a980f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Anselmoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@941c5cb7c047afef76ccc4f9a0af3be9416a980f -
Trigger Event:
push
-
Statement type: