Complexipy MCP Server
Provides cognitive complexity analysis for Python codebases, enabling scanning of individual files or entire directories to identify functions and files that exceed specified complexity thresholds.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Complexipy MCP Serverscan my project directory for functions with complexity over 20"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
.pyfiles in a directory and filter by complexity threshold.File Scanning: Analyze a single Python file.
Data Processing: Uses
pandasfor 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.
Related MCP server: codescan-mcp
Installation & Usage
Quick Start
You can run the server directly using uvx (no installation required):
uvx complexipy-mcpConfiguration 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
Clone the repository.
Install dependencies:
uv syncRun 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.
This server cannot be deployed
Maintenance
Related MCP Connectors
Security + bug + perf + refactor audit for Python. Returns 0-10 score + MD report.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Scan code for quantum-vulnerable cryptography and get NIST post-quantum migration guidance.
Evidence-backed architecture-quality analysis for Python agent applications.
Related MCP Servers
- FlicenseBqualityCmaintenanceEnables comprehensive security vulnerability scanning and code quality analysis for Python applications. Provides detailed reports with scoring, actionable suggestions, and comparison tracking specifically designed for backend developers working with frameworks like Django, Flask, and FastAPI.51-
- AlicenseNot gradedqualityDmaintenanceScans codebases for TODOs, FIXMEs, code complexity, file stats, and dependencies, generating a health report with a letter grade. Zero configuration required.8 npmMIT
- AlicenseAqualityDmaintenanceProvides comprehensive code quality analysis with quantitative metrics, historical trends, and refactoring risk prediction for C#, Python, and TypeScript codebases.55 npmMIT
- AlicenseAqualityBmaintenanceProvides deep structural analysis of Python source code via AST, including function signatures, call graphs, cyclomatic complexity, code smells, dead code detection, and protocol conformance.20MIT