mcp-server-analyzer


Namemcp-server-analyzer JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryMCP server for Python code analysis with RUFF linting and VULTURE dead code detection
upload_time2025-07-30 05:09:45
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords code-analysis linting mcp python ruff static-analysis vulture
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MCP Server Analyzer for Python ๐Ÿ๐Ÿ”

[![CI/CD Pipeline](https://github.com/anselmoo/mcp-server-analyzer/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/anselmoo/mcp-server-analyzer/actions/workflows/ci-cd.yml)
[![PyPI version](https://badge.fury.io/py/mcp-server-analyzer.svg)](https://badge.fury.io/py/mcp-server-analyzer)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Docker](https://img.shields.io/badge/docker-available-blue.svg)](https://github.com/anselmoo/mcp-server-analyzer/pkgs/container/mcp-server-analyzer)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code Coverage](https://codecov.io/gh/anselmoo/mcp-server-analyzer/branch/main/graph/badge.svg)](https://codecov.io/gh/anselmoo/mcp-server-analyzer)

A powerful [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides comprehensive Python code analysis using [**RUFF**](https://docs.astral.sh/ruff/) for linting and [**VULTURE**](https://github.com/jendrikseipp/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](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-analyzer%22%5D%7D) [![Install with UV in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-analyzer%22%5D%7D&quality=insiders)

[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Docker-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-server-analyzer%22%5D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Docker-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-server-analyzer%22%5D%7D&quality=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):**

```json
{
  "mcp": {
    "servers": {
      "analyzer": {
        "command": "uvx",
        "args": ["mcp-server-analyzer"]
      }
    }
  }
}
```

**Using Docker:**

```json
{
  "mcp": {
    "servers": {
      "analyzer": {
        "command": "docker",
        "args": ["run", "-i", "--rm", "ghcr.io/anselmoo/mcp-server-analyzer"]
      }
    }
  }
}
```

### Universal Installation

```bash
# 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](examples/preview-ruff.md)**

### VULTURE Dead Code Detection Preview

Explore dead code detection capabilities: **[๐Ÿงน VULTURE Analysis Preview](examples/preview-vulture.md)**

## ๐Ÿ› ๏ธ 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`:

```json
{
  "mcpServers": {
    "analyzer": {
      "command": "uvx",
      "args": ["mcp-server-analyzer"]
    }
  }
}
```

### Zed

Add to your Zed settings.json:

```json
"context_servers": {
  "analyzer": {
    "command": "uvx",
    "args": ["mcp-server-analyzer"]
  }
}
```

## ๐Ÿงช Development

### Prerequisites

- Python 3.10+
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
- [Docker](https://docker.com) (optional)

### Setup

```bash
# 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

```bash
# 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](https://sigstore.dev/)
- **Container Signing**: Docker images signed with [Cosign](https://docs.sigstore.dev/cosign/overview/)
- **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](https://modelcontextprotocol.io/)** - Learn about Model Context Protocol
- **[FastMCP Framework](https://gofastmcp.com/)** - High-performance MCP implementation
- **[RUFF Documentation](https://docs.astral.sh/ruff/)** - Python linter and formatter
- **[VULTURE Documentation](https://github.com/jendrikseipp/vulture)** - Dead code finder

## ๐Ÿค Contributing

Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) 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 [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- [Astral](https://astral.sh/) for RUFF and uv
- [Jendrik Seipp](https://github.com/jendrikseipp) for VULTURE
- [Model Context Protocol](https://modelcontextprotocol.io/) team
- [FastMCP](https://gofastmcp.com/) framework

---

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-server-analyzer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Anselm Hahn <anselm.hahn@gmail.com>",
    "keywords": "code-analysis, linting, mcp, python, ruff, static-analysis, vulture",
    "author": null,
    "author_email": "Anselm Hahn <anselm.hahn@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e5/2f/9fa668cf95503d323c0c27870e36e36bc0eeabbcf8dc1f3be63589e6e67e/mcp_server_analyzer-0.1.1.tar.gz",
    "platform": null,
    "description": "# MCP Server Analyzer for Python \ud83d\udc0d\ud83d\udd0d\n\n[![CI/CD Pipeline](https://github.com/anselmoo/mcp-server-analyzer/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/anselmoo/mcp-server-analyzer/actions/workflows/ci-cd.yml)\n[![PyPI version](https://badge.fury.io/py/mcp-server-analyzer.svg)](https://badge.fury.io/py/mcp-server-analyzer)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![Docker](https://img.shields.io/badge/docker-available-blue.svg)](https://github.com/anselmoo/mcp-server-analyzer/pkgs/container/mcp-server-analyzer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code Coverage](https://codecov.io/gh/anselmoo/mcp-server-analyzer/branch/main/graph/badge.svg)](https://codecov.io/gh/anselmoo/mcp-server-analyzer)\n\nA powerful [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides comprehensive Python code analysis using [**RUFF**](https://docs.astral.sh/ruff/) for linting and [**VULTURE**](https://github.com/jendrikseipp/vulture) for dead code detection. Perfect for AI assistants, IDEs, and automated code review workflows.\n\n## \ud83d\ude80 Quick Start\n\n### VS Code Integration (One-Click Install)\n\nFor quick installation, use one of the one-click install buttons below...\n\n[![Install with UV in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-analyzer%22%5D%7D) [![Install with UV in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-analyzer%22%5D%7D&quality=insiders)\n\n[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Docker-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-server-analyzer%22%5D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Docker-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=analyzer&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22ghcr.io%2Fanselmoo%2Fmcp-server-analyzer%22%5D%7D&quality=insiders)\n\nFor 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)`.\n\nOptionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.\n\n> Note that the `mcp` key is needed when using the `mcp.json` file.\n\n**Using uvx (recommended):**\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"analyzer\": {\n        \"command\": \"uvx\",\n        \"args\": [\"mcp-server-analyzer\"]\n      }\n    }\n  }\n}\n```\n\n**Using Docker:**\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"analyzer\": {\n        \"command\": \"docker\",\n        \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/anselmoo/mcp-server-analyzer\"]\n      }\n    }\n  }\n}\n```\n\n### Universal Installation\n\n```bash\n# Install with uvx (recommended)\nuvx install mcp-server-analyzer\n\n# Install with pip\npip install mcp-server-analyzer\n\n# Run with Docker\ndocker run ghcr.io/anselmoo/mcp-server-analyzer:latest\n\n# Install from source\ngit clone https://github.com/anselmoo/mcp-server-analyzer.git\ncd mcp-server-analyzer\nuv sync --dev\nuv run mcp-server-analyzer\n```\n\n## \ud83d\udccb Features\n\n- **\ud83d\udd0d RUFF Analysis**: Comprehensive Python linting with auto-fixes\n- **\ud83e\uddf9 Dead Code Detection**: Find unused imports, functions, and variables with VULTURE\n- **\ud83d\udcca Quality Scoring**: Combined analysis with quality metrics\n- **\ud83d\ude80 FastMCP Framework**: High-performance MCP server implementation\n- **\ud83d\udc33 Docker Ready**: Multi-architecture containers with security signing\n- **\ud83d\udd12 Secure**: All releases signed with Sigstore for supply chain security\n\n## \ud83d\udcc8 Analysis Examples\n\n### RUFF Linting Preview\n\nSee comprehensive linting analysis examples: **[\ud83d\udccb RUFF Analysis Preview](examples/preview-ruff.md)**\n\n### VULTURE Dead Code Detection Preview\n\nExplore dead code detection capabilities: **[\ud83e\uddf9 VULTURE Analysis Preview](examples/preview-vulture.md)**\n\n## \ud83d\udee0\ufe0f Available Tools\n\n| Tool            | Description                      | Use Case                             |\n| --------------- | -------------------------------- | ------------------------------------ |\n| `ruff-check`    | Lint Python code with RUFF       | Style violations, potential errors   |\n| `ruff-format`   | Format Python code with RUFF     | Code formatting and consistency      |\n| `ruff-check-ci` | CI/CD optimized RUFF output      | GitHub Actions, GitLab CI            |\n| `vulture-scan`  | Dead code detection              | Unused imports, functions, variables |\n| `analyze-code`  | Combined RUFF + VULTURE analysis | Complete code quality assessment     |\n\n## \ud83d\udd27 Configuration\n\n### Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"analyzer\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-analyzer\"]\n    }\n  }\n}\n```\n\n### Zed\n\nAdd to your Zed settings.json:\n\n```json\n\"context_servers\": {\n  \"analyzer\": {\n    \"command\": \"uvx\",\n    \"args\": [\"mcp-server-analyzer\"]\n  }\n}\n```\n\n## \ud83e\uddea Development\n\n### Prerequisites\n\n- Python 3.10+\n- [uv](https://docs.astral.sh/uv/) (recommended) or pip\n- [Docker](https://docker.com) (optional)\n\n### Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/anselmoo/mcp-server-analyzer.git\ncd mcp-server-analyzer\n\n# Install dependencies\nuv sync --dev\n\n# Run tests\nuv run pytest\n\n# Run pre-commit hooks\nuv tool run pre-commit run --all-files\n\n# Build Docker image\ndocker build -t mcp-server-analyzer .\n```\n\n### Testing\n\n```bash\n# Run all tests\nuv run pytest tests/ -v\n\n# Run with coverage\nuv run pytest --cov=src/mcp_server_analyzer --cov-report=html\n\n# Test specific functionality\nuv run pytest tests/test_server.py::TestAnalyzer::test_ruff_analysis\n```\n\n## \ud83d\udcca Quality Metrics\n\nThe server provides quality scoring based on:\n\n- **RUFF Issues**: Style violations, potential bugs, complexity metrics\n- **Dead Code Detection**: Unused imports, functions, variables\n- **Combined Score**: Weighted quality assessment (0-100)\n\n## \ud83d\udd12 Security\n\n- **Signed Releases**: All releases signed with [Sigstore](https://sigstore.dev/)\n- **Container Signing**: Docker images signed with [Cosign](https://docs.sigstore.dev/cosign/overview/)\n- **Trusted Publishing**: PyPI releases use GitHub OIDC trusted publishing\n- **Vulnerability Scanning**: Automated security scanning in CI/CD\n- **Supply Chain Security**: SLSA Build Level 3 compliance\n\n## \ud83d\udcda Documentation\n\n- **[MCP Specification](https://modelcontextprotocol.io/)** - Learn about Model Context Protocol\n- **[FastMCP Framework](https://gofastmcp.com/)** - High-performance MCP implementation\n- **[RUFF Documentation](https://docs.astral.sh/ruff/)** - Python linter and formatter\n- **[VULTURE Documentation](https://github.com/jendrikseipp/vulture)** - Dead code finder\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [Astral](https://astral.sh/) for RUFF and uv\n- [Jendrik Seipp](https://github.com/jendrikseipp) for VULTURE\n- [Model Context Protocol](https://modelcontextprotocol.io/) team\n- [FastMCP](https://gofastmcp.com/) framework\n\n---\n\n**Made with \u2764\ufe0f for better Python code quality**\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MCP server for Python code analysis with RUFF linting and VULTURE dead code detection",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://github.com/anselmoo/mcp-server-analyzer",
        "Homepage": "https://github.com/anselmoo/mcp-server-analyzer",
        "Issues": "https://github.com/anselmoo/mcp-server-analyzer/issues",
        "Repository": "https://github.com/anselmoo/mcp-server-analyzer"
    },
    "split_keywords": [
        "code-analysis",
        " linting",
        " mcp",
        " python",
        " ruff",
        " static-analysis",
        " vulture"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c889b77be43db27204c1517cc184740acc11a68d17d019a245e7aaa89f896cc3",
                "md5": "ceee4102a91c13132b79a59227cd4f18",
                "sha256": "a6ff0424975994f47ab61c6671bec5e7c8f93862b345a9611b56062bcd02c1b4"
            },
            "downloads": -1,
            "filename": "mcp_server_analyzer-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ceee4102a91c13132b79a59227cd4f18",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 13763,
            "upload_time": "2025-07-30T05:09:44",
            "upload_time_iso_8601": "2025-07-30T05:09:44.335866Z",
            "url": "https://files.pythonhosted.org/packages/c8/89/b77be43db27204c1517cc184740acc11a68d17d019a245e7aaa89f896cc3/mcp_server_analyzer-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e52f9fa668cf95503d323c0c27870e36e36bc0eeabbcf8dc1f3be63589e6e67e",
                "md5": "36d44d0a8840fad58f79f62d42bf1a8a",
                "sha256": "cf760a4905a1e8a6d60c17b7caa043b53126c037dd93b9f627b296af84b82a2b"
            },
            "downloads": -1,
            "filename": "mcp_server_analyzer-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "36d44d0a8840fad58f79f62d42bf1a8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 115153,
            "upload_time": "2025-07-30T05:09:45",
            "upload_time_iso_8601": "2025-07-30T05:09:45.398660Z",
            "url": "https://files.pythonhosted.org/packages/e5/2f/9fa668cf95503d323c0c27870e36e36bc0eeabbcf8dc1f3be63589e6e67e/mcp_server_analyzer-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 05:09:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "anselmoo",
    "github_project": "mcp-server-analyzer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mcp-server-analyzer"
}
        
Elapsed time: 0.56235s