mcp-server-analyzer

Anselmoo/mcp-server-analyzer

3.3

If you are the rightful owner of mcp-server-analyzer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP Server Analyzer for Python is a robust tool designed to enhance Python code quality through comprehensive analysis using the Model Context Protocol (MCP).

Tools
5
Resources
0
Prompts
0

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

CI/CD Pipeline PyPI version Python 3.10+ Docker License: MIT Code Coverage

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

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
  • ๐Ÿงน 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:

VULTURE Dead Code Detection Preview

Explore dead code detection capabilities:

๐Ÿ› ๏ธ Available Tools

ToolDescriptionUse Case
ruff-checkLint Python code with RUFFStyle violations, potential errors
ruff-formatFormat Python code with RUFFCode formatting and consistency
ruff-check-ciCI/CD optimized RUFF outputGitHub Actions, GitLab CI
vulture-scanDead code detectionUnused imports, functions, variables
analyze-codeCombined RUFF + VULTURE analysisComplete 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

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

๐Ÿค Contributing

Contributions are welcome! Please see our for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  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 file for details.

๐Ÿ™ Acknowledgments


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