mcp-server-analyzer
This MCP server provides comprehensive code analysis for Python and JavaScript/TypeScript projects through the following capabilities:
ruff-check— Lint Python code using Ruff to identify style violations and potential errors, with line/column info, rule codes, severity, and auto-fixable flags.ruff-format— Format Python code using Ruff's fast formatter, returning the formatted code and whether changes were made.ruff-check-ci— Run Ruff linting with CI/CD-optimized output formats (JSON, GitHub Actions, GitLab CI, SARIF) for automated pipelines.ty-check— Type-check Python code usingty, returning diagnostics with line/column info, rule identifiers, severity, and error/warning counts.vulture-scan— Detect dead/unused code (imports, functions, variables, classes) using Vulture, with configurable confidence thresholds.analyze-code— Run a combined analysis (Ruff + ty + Vulture) in a single call, returning all individual results plus a unified summary with a code quality score (0–100).biome-check/biome-format— Lint and format JavaScript/TypeScript code using Biome.
Key characteristics: All tools are read-only and idempotent, processing code in-memory with no network calls or telemetry. Supports optional configuration paths for tailored analysis. Integrates with VS Code, Claude Desktop, Zed, and Claude Code via MCP protocol.
Provides comprehensive Python linting with auto-fixes using Ruff.
Click on "Deploy 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-server-analyzer analyze code quality of my Python script"
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 Server Analyzer for Python 🐍🔍
A powerful Model Context Protocol (MCP) server that provides comprehensive Python code analysis using Ruff for linting, ty for type checking, 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-analyzerRelated MCP server: codetest-mcp
📋 Features
🔍 RUFF Analysis: Comprehensive Python linting with auto-fixes
🧠 ty Type Checking: Fast Python type analysis with rule-based diagnostics
🧹 Dead Code Detection: Find unused imports, functions, and variables with VULTURE
⚡ Biome JS/TS Analysis: Fast linting and formatting for JavaScript and TypeScript
📊 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 |
| Lint Python code with RUFF | Style violations, potential errors |
| Format Python code with RUFF | Code formatting and consistency |
| CI/CD optimized RUFF output | GitHub Actions, GitLab CI |
| Type-check Python code with ty | Type safety, incorrect return values |
| Dead code detection | Unused imports, functions, variables |
| Lint JS/TS code with Biome | Style violations, potential errors |
| Format JS/TS code with Biome | Code formatting and consistency |
| Combined Ruff + ty + 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"]
}
}Claude Code (project-level)
Place .mcp.json at your project root:
{
"mcpServers": {
"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 Python dependencies
uv sync --dev
# Install Biome (JS/TS analyzer)
npm ci
# Run tests
uv run pytest
# Run type checks
uv run ty check src tests
# 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::TestAnalyzers::test_ruff_with_sample_code📊 Quality Metrics
The server provides quality scoring based on:
Ruff Issues: Style violations, potential bugs, complexity metrics
ty Diagnostics: Static typing errors and warnings
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
Security Policy: See SECURITY.md for vulnerability reporting
🔍 Data Handling & Transparency
In-memory only: Code passed to tools is written to a temporary file, analyzed, and the file is deleted immediately — nothing is persisted between calls.
No network calls: The server makes no outbound network connections during analysis.
No telemetry: No usage data, analytics, or crash reports are collected.
Subprocess isolation: ruff, ty, and vulture are invoked with fixed argument lists — no shell expansion or arbitrary command execution.
📚 Documentation
Full Documentation - GitHub Pages docs
Tools Reference - Detailed tool parameters and return types
MCP Specification - Learn about Model Context Protocol
FastMCP Framework - High-performance MCP implementation
Ruff Documentation - Python linter and formatter
ty Documentation - Python type checker and language server
Vulture Documentation - Dead code finder
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes using Conventional Commits
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
FastMCP framework
Made with ❤️ for better Python code quality
Available Tools
8 toolsanalyze-codeARead-onlyIdempotent
Comprehensive analysis combining Ruff linting, ty type checking, and Vulture dead code detection.
Inputs: code (required), project_path, min_confidence, ruff_config_path. Returns: Combined analysis result from the available analyzers.
biome-checkARead-onlyIdempotent
Lint JavaScript/TypeScript code using Biome.
Inputs: code (required), filename. Returns: Result of a biome check operation.
biome-formatARead-onlyIdempotent
Format JavaScript/TypeScript code using Biome.
Inputs: code (required), filename. Returns: Result of a biome format operation.
ruff-checkARead-onlyIdempotent
Lint Python code using RUFF to identify style violations and potential errors.
Inputs: code (required), config_path. Returns: Result of RUFF check operation.
ruff-check-ciARead-onlyIdempotent
Run RUFF linter with CI/CD-specific output formats.
Inputs: code (required), config_path, output_format. Returns: Result of a RUFF CI/CD check operation.
ruff-formatBRead-onlyIdempotent
Format Python code using RUFF's fast formatter.
Inputs: code (required), config_path. Returns: Result of RUFF format operation.
ty-checkBRead-onlyIdempotent
Type-check Python code using ty.
Inputs: code (required), project_path. Returns: Result of a ty type-check operation.
vulture-scanCRead-onlyIdempotent
Detect dead/unused code using VULTURE.
Inputs: code (required), min_confidence. Returns: Result of VULTURE scan operation.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools are clearly distinct by language and action (format, lint, type-check, dead-code scan). The only real ambiguity is ruff-check vs. ruff-check-ci, which differ only in CI-specific output formatting.
Names generally follow a consistent 'tool-action' hyphenated pattern (ruff-format, biome-check, vulture-scan). analyze-code breaks the pattern slightly by leading with the action rather than the tool.
Eight tools is a reasonable size for a code-analysis server. The count is slightly padded by ruff-check-ci and the combined analyze-code, which overlap with existing tools, but the overall scope remains manageable.
Python coverage is strong: format, lint, type-check, dead-code, and a combined analysis. JavaScript/TypeScript support is thinner, with only formatting and linting and no type-checking or dead-code detection, leaving a notable gap for a general analyzer.
Maintenance
Related MCP Connectors
Official Duck Framework MCP server for AI-assisted development and project scaffolding.
Audit your MCP servers for poisoned tools and leaked secrets, and check AI-generated code for flaws.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that integrates Ruff linting, formatting, and code analysis tools with advanced logging and configuration options for AI coding assistants.41MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for static code analysis using AST parsing and linters, providing tools to detect syntax errors, type issues, typos, and incorrect variable usage across multiple languages. It supports headless linting with tools like ast_check, lint_check, and health.-
- AlicenseAqualityDmaintenanceThis MCP server provides direct access to ruff linting, formatting checks, and ty type-checking for Python projects, with token-efficient, structured output.9MIT
- AlicenseBqualityCmaintenanceAn MCP server that runs Python project checks through pytest, Ruff, and basedpyright, with configurable settings and stdio/HTTP transport.3MIT