Complexipy MCP Server

Complexipy MCP Server

Analyzes cognitive complexity of Python code by scanning files and directories to identify functions exceeding complexity thresholds using the complexipy library.

Category
Visit Server

README

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.

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

Qdrant Server

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

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured