mcp-server-analyzer

mcp-server-analyzer

An MCP server that performs comprehensive Python code analysis using Ruff, ty, and Vulture for linting, type checking, and dead code detection.

Category
Visit Server

README

MCP Server Analyzer for Python ๐Ÿ๐Ÿ”

SafeSkill 92/100

CI/CD Pipeline PyPI version Python 3.13+ Docker License: MIT Code Coverage AgentSeal MCP Docs

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...

Install with UV in VS Code Install with UV in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

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 mcp key is needed when using the mcp.json file.

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
  • ๐Ÿง  ty Type Checking: Fast Python type analysis with rule-based diagnostics
  • ๐Ÿงน 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
ty-check Type-check Python code with ty Type safety, incorrect return values
vulture-scan Dead code detection Unused imports, functions, variables
analyze-code 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

  • Python 3.10+
  • uv (recommended) or pip
  • Docker (optional)

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 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

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using Conventional Commits
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments


Made with โค๏ธ for better Python code quality

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured