Skip to content
MCP server

crapkit

Score functions by complexity and coverage risk, and gate commits that add more

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI
Runs
Locally
Version
0.8.1
Listing updated
1 day ago

About crapkit

crapkit is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

The scoring idea comes from the C.R.A.P. (Change Risk Anti-Patterns) metric: cyclomatic complexity squared times uncovered share cubed, plus complexity. crapkit applies it to every function in a Git repository, ranks the worst by how often their file changes and blocks commits that add risk. It reads many languages through lizard, including Python, TypeScript, Go, Rust, Swift, Java, C and C++, and joins per-function branch coverage from the coverage report your own test command already writes.

Its default is a complexity ceiling of 6 rather than the classic score of 30, because above the ceiling coverage cannot rescue a function and the only fix is to split it. Teams with existing debt can seed a ratchet that records today's scores so the gate judges only functions a change touches, and marks may only fall. Only Git-tracked files are scored.

Twelve MCP tools let a coding agent inspect scores, find work and check edited functions against their ceiling. Install with pip or run via uvx, then use init, doctor, coverage, worklist and verify.

Install

Run in a terminal

claude mcp add crapkit -- uvx crapkit

Add to claude_desktop_config.json

{
  "mcpServers": {
    "crapkit": {
      "command": "uvx",
      "args": [
        "crapkit"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "crapkit": {
      "command": "uvx",
      "args": [
        "crapkit"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "crapkit": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "crapkit"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "crapkit": {
      "command": "uvx",
      "args": [
        "crapkit"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "crapkit": {
      "command": "uvx",
      "args": [
        "crapkit"
      ]
    }
  }
}

What it does

CRAP scoring
Scores each function on complexity times uncovered risk.
Ranked worklist
Ranks the riskiest functions by how often their file changes.
Commit gate
verify blocks changes that push functions over the ceiling.
Debt ratchet
Seeds today's scores so only touched functions are judged and marks can only fall.
Many languages
Reads Python, TypeScript, JavaScript, Go, Rust, Swift, Java, C and more.
Agent-friendly JSON
Sorted-key, versioned JSON output for scripts and coding agents.

Good for

  • Find the riskiest untested functions in a repository
  • Stop a commit from adding more complexity than the ceiling allows
  • Adopt a quality gate on a codebase that already has debt
  • Let a coding agent check its edited functions before finishing

Pricing

Open source

Free open source package

Prices change. Check jfgagne.com before you buy.

crapkit FAQ

What is the default ceiling?

A complexity ceiling of 6, which you can change in crapkit.toml, for example to 30 for the crap4j number.

Does it score untracked files?

No. Only git-tracked files are scored.

Where does coverage come from?

From the istanbul or coverage.py artifact your own test command writes.

How do I install it?

pip install crapkit, or run it with uvx.

Is crapkit free?

Yes. crapkit is open source, so you can use and self-host it for free.

How do I add crapkit to Claude Code?

Run this command in your terminal: claude mcp add crapkit -- uvx crapkit

What are the best alternatives to crapkit?

The closest alternatives to crapkit are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to crapkit

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools