Skip to main content

Complexipy MCP Server

A Model Context Protocol (MCP) server that wraps complexipy to provide cognitive complexity analysis for Python codebases. This server uses the complexipy Python API for accurate and robust analysis.

Features

  • Directory Scanning: Recursively analyze all .py files in a directory and filter by complexity threshold.
  • File Scanning: Analyze a single Python file.
  • Data Processing: Uses pandas for efficient data filtering and sorting.
  • Clean Output: Returns JSON formatted results (list of objects).
  • No Emojis: Pure data output suitable for machine consumption.
  • Stdio Transport: Uses standard input/output for communication, making it compatible with most MCP clients.

Installation & Usage

Quick Start

You can run the server directly using uvx (no installation required):

uvx complexipy-mcp

Configuration for Claude Desktop

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "complexipy": {
      "command": "uvx",
      "args": [
        "complexipy-mcp"
      ]
    }
  }
}

Local Development

  1. Clone the repository.
  2. Install dependencies:
    uv sync
    
  3. Run the server locally:
    uv run complexipy-mcp
    

Local Configuration for Claude Desktop

If you are developing locally, point the configuration to your local setup:

{
  "mcpServers": {
    "complexipy": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/complexipy-mcp",
        "run",
        "complexipy-mcp"
      ]
    }
  }
}

Tools

scan_directory

Scans a directory for files exceeding a cognitive complexity threshold.

  • Arguments:
    • directory_path (string): Absolute path to the directory to scan.
    • threshold (integer): Complexity limit (default: 15).
  • Returns: JSON string containing a list of files that exceed the threshold.
    [
      {
        "file_path": "/abs/path/to/file.py",
        "complexity": 25,
        "functions": [
          {
            "name": "function_name",
            "complexity": 10,
            "line_start": 5,
            "line_end": 15
          }
        ],
        "status": "exceeds_threshold"
      }
    ]
    

scan_file

Scans a single file for cognitive complexity.

  • Arguments:
    • file_path (string): Absolute path to the file.
    • threshold (integer): Complexity limit (default: 15).
  • Returns: JSON string containing the result if it exceeds the threshold.

Metadata

Release files for complexipy-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for complexipy-mcp 0.1.1
File Size Uploaded Provenance
complexipy_mcp-0.1.1.tar.gz 96.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for complexipy-mcp 0.1.1
File Interpreter ABI Platform
complexipy_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 101.6 kB

Release files / complexipy_mcp-0.1.1.tar.gz

Download URL complexipy_mcp-0.1.1.tar.gz
Size 96.9 kB
Tags Source
SHA-256 checksum
How to use checksums
726ea49fb6126d07fdf81f12cd211a87aa88c0d585056dc00e3a3084a84e6dc1
BLAKE2b-256 checksum
How to use checksums
d5a3a3d0619947bc9b3f65284dc5033cd18a0455f1ae5755cc3be61aa5da6a5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release files / complexipy_mcp-0.1.1-py3-none-any.whl

Download URL complexipy_mcp-0.1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0561b12e43aa03d1153b30bbda0ab2ace76ad6874d4303742a750a832b49bbe
BLAKE2b-256 checksum
How to use checksums
a45c5fc0fa8d4b64851644d5033a0caee7fcf6749d3ba570ae69146c9ae8165e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Security for complexipy-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page