# crapkit

> crapkit is an open-source MCP server for developer tools. Score functions by complexity and coverage risk, and gate commits that add more. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://www.jfgagne.com/crapkit/
- **Repository:** https://github.com/jeanfrancoisgagne/crapkit
- **MCP Registry name:** io.github.JeanFrancoisGagne/crapkit
- **Categories:** developer tools
- **Listing updated:** 2026-11-16

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add crapkit -- uvx crapkit
```

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "crapkit": {
      "command": "uvx",
      "args": [
        "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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/crapkit
