Skip to main content

MCP servers for code review and automated fixing

Project description

btx_fix_mcp

CI CodeQL License: MIT Open in Codespaces PyPI PyPI - Downloads Code Style: Ruff codecov Maintainability Known Vulnerabilities security: bandit

Code review and automated fixing tools - available as CLI and MCP server.

What is btx_fix_mcp?

btx_fix_mcp provides comprehensive code analysis:

  • 18+ Quality Analyses: Complexity, maintainability, duplication, type coverage, dead code
  • Security Scanning: Bandit integration for vulnerability detection
  • Cache Optimization: Evidence-based @lru_cache recommendations
  • Documentation Coverage: Docstring completeness analysis

Two ways to use it:

Mode Best For
CLI Direct command-line usage, CI/CD pipelines, scripts
MCP Server Integration with Claude Desktop, AI-assisted workflows

Quick Start

Installation

# Recommended: uv
pip install uv
uv pip install btx_fix_mcp

# Alternative: pip
pip install btx_fix_mcp

# Development
git clone https://github.com/bitranox/btx_fix_mcp
cd btx_fix_mcp && make dev

CLI Usage (Simple)

# Review uncommitted git changes (default)
btx_fix_mcp review all

# Review all files
btx_fix_mcp review all --mode full

# Run specific analysis
btx_fix_mcp review quality
btx_fix_mcp review security

# Cache optimization with profiling (recommended)
btx_fix_mcp review profile -- python -m your_app    # Profile your app
btx_fix_mcp review profile -- pytest tests/         # Or profile tests
btx_fix_mcp review cache                            # Then analyze

# Clean up analysis data
btx_fix_mcp review clean                            # Delete all
btx_fix_mcp review clean -s profile                 # Delete profile only
btx_fix_mcp review clean --dry-run                  # Preview deletion

MCP Server Usage (Simple)

Add to Claude Desktop config (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "btx-review": {
      "command": "python",
      "args": ["-m", "btx_fix_mcp.servers.review"]
    }
  }
}

Then in Claude Desktop:

"Review the code quality of this project"


Documentation

Getting Started

Document Description
CLI Quickstart Start using CLI in 5 minutes
MCP Quickstart Set up MCP server for Claude Desktop
Installation Guide All installation methods

User Guides

Document Description
CLI Reference All CLI commands and options
MCP Tools Reference MCP tools and resources
Configuration All configuration options
Cache Profiling LRU cache optimization guide

Development

Document Description
Development Guide Setup, testing, make targets
Architecture System design overview
Contributing How to contribute

Features Overview

Analyses Available

Analysis Description CLI Command
Scope File discovery, git changes review scope
Quality Complexity, maintainability, duplication review quality
Security Vulnerability scanning (Bandit) review security
Dependencies Outdated packages, vulnerabilities review deps
Documentation Docstring coverage review docs
Performance Hotspot detection, profiling review perf
Cache LRU cache optimization review cache

Quality Metrics

Metric Tool Threshold
Cyclomatic Complexity radon ≤10
Function Length custom ≤50 lines
Nesting Depth custom ≤3 levels
Maintainability Index radon ≥20
Type Coverage mypy ≥80%
Docstring Coverage interrogate ≥80%

Requirements

  • Python 3.13+
  • Git (optional)

Git Integration

Git is optional but enables additional features:

Feature Without Git With Git
Scope Mode --mode full scans all files --mode git scans only uncommitted changes (default)
Code Churn Skipped Analyzes frequently modified files
Branch Info Shows "N/A" Displays current branch

When git is not available:

  • --mode git automatically falls back to --mode full with a warning
  • Code churn analysis is skipped silently
  • Cache analysis works without git (uses in-memory file backup)
  • All other analyses work normally

License

MIT License


Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

btx_fix_mcp-1.1.0.tar.gz (538.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

btx_fix_mcp-1.1.0-py3-none-any.whl (172.3 kB view details)

Uploaded Python 3

File details

Details for the file btx_fix_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: btx_fix_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 538.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for btx_fix_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 deba461d4a03bd55903d911154fea9894059c7fc3d29442808aa78496e737991
MD5 0e383d1c17faa6cdede02fa40bf79c3d
BLAKE2b-256 7d78aa9ac1d111f4479bc8dd0456f6c9dae9fc243cba57d109c6d0e1d3c0224f

See more details on using hashes here.

File details

Details for the file btx_fix_mcp-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: btx_fix_mcp-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 172.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for btx_fix_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b3802a14218772e59f9c0c17ed9887791b4c3a0c31457872472487198e58ead
MD5 996a4732325fa56eb32c1b021ef3325e
BLAKE2b-256 d29028eaa3b78a3ff15c28bddd4595008d8d6d6dac4d9563ba2f258ffa8b0b98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page