# Krusch Coding Harness

> Krusch Coding Harness is an open-source MCP server for developer tools. MCP server that stages code diffs, tests them in a sandbox, then applies them to disk. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted, Linux, macOS
- **Repository:** https://github.com/kruschdev/krusch-coding-harness
- **MCP Registry name:** dev.krusch/krusch-coding-harness
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-19

## About

The README describes a PostgreSQL-backed harness where a model's proposed file edits are first written to a staging table rather than the working tree. Tests run in an isolated Bubblewrap sandbox or a process-jail fallback, and only diffs that pass verification and receive approval are written to disk. The apply step is journaled so an interrupted multi-file write can be rolled back on restart.

The package is published on npm as krusch-coding-harness and runs as a stdio MCP server exposing seven krusch_* tools for run, status, explain, diff, reject, abort and apply. The README says it works with coding agents and IDEs such as Claude Code, Cursor and Windsurf. It also ships a CLI with commands for health checks, task inspection, lease management and golden trajectory evaluation.

It suits developers who want a guarded write path for AI-generated edits, especially for unattended or multi-worker setups where crash recovery and an audit trail matter. The README itself notes that a single interactive session may not need the PostgreSQL setup and points to a lighter SQLite-based alternative.

## Features

- **Staged diffs before disk writes:** Proposed file edits are stored in PostgreSQL with SHA-256 hashes and the working tree is left untouched until they are approved.
- **Sandboxed test verification:** Tests run in a Bubblewrap container with no network access, or in a process group that is killed on timeout.
- **Crash-recoverable apply journal:** Each file is written to a temporary sibling, fsynced and renamed, and an interrupted batch is restored on restart.
- **Command allowlist:** Verification commands are limited to recognised test runners, and destructive shell patterns are rejected.
- **Seven-tool MCP interface:** Exposes run, status, explain, diff, reject, abort and apply tools over stdio for MCP-compatible clients.

## Good for

- Gating AI-generated code edits behind sandboxed tests before they touch a repository
- Recovering cleanly from a process crash in the middle of applying multi-file changes
- Reviewing and exporting staged diffs as patch files before approval
- Running background coding agents with an audit trail of phases and verification runs

## Install

### Claude Code (Terminal)

```sh
claude mcp add krusch-coding-harness -- npx -y krusch-coding-harness
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "krusch-coding-harness": {
      "command": "npx",
      "args": [
        "-y",
        "krusch-coding-harness"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "krusch-coding-harness": {
      "command": "npx",
      "args": [
        "-y",
        "krusch-coding-harness"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "krusch-coding-harness": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "krusch-coding-harness"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "krusch-coding-harness": {
      "command": "npx",
      "args": [
        "-y",
        "krusch-coding-harness"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "krusch-coding-harness": {
      "command": "npx",
      "args": [
        "-y",
        "krusch-coding-harness"
      ]
    }
  }
}
```

## Tools

- `krusch_run`: Asynchronously initialize and run a task in PostgreSQL.
- `krusch_task_status`: Poll task phase, verification runs, active diffs, and blockers.
- `krusch_explain`: Explain next transition feasibility with SQL invariant tags.
- `krusch_diff`: Retrieve unified diff of staged modifications.
- `krusch_reject`: Reject a staged diff before application.
- `krusch_abort`: Abort a task and record the operator reason in krusch_events.
- `krusch_apply_diff`: Commit verified staged diffs to disk via the 2PC journal.

## FAQ

### How do I install Krusch Coding Harness as an MCP server?

The registry entry lists the npm package krusch-coding-harness at version 0.2.1 with a stdio transport. The README gives the command ./bin/krusch-coding-harness.js mcp when run from a cloned repository.

### Does Krusch Coding Harness need PostgreSQL?

The README's full setup uses PostgreSQL 16 via docker compose. It also describes a Path A that runs in-process on built-in PGlite without Docker or API keys.

### Is multi-file apply atomic?

No. The README says each file replacement is atomic, but another process can see a partly applied batch until it completes or recovery rolls it back.

### Which languages does the AST indexer cover?

The README lists structural symbol indexing for JavaScript, TypeScript, Python, Go and Rust.

### Is Krusch Coding Harness free?

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

### How do I add Krusch Coding Harness to Claude Code?

Run this command in your terminal: claude mcp add krusch-coding-harness -- npx -y krusch-coding-harness

### What are the best alternatives to Krusch Coding Harness?

The closest alternatives to Krusch Coding Harness are KruschStack, Krusch Context MCP, Krusch Git MCP, NEPHIS MCP Server and Coding Tools MCP.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [KruschStack](https://ai-powered.com/mcp/kruschstack): KruschStack is an open-source MCP server for developer tools.
- [Krusch Context MCP](https://ai-powered.com/mcp/krusch-context-mcp): Krusch Context MCP is an open-source MCP server for developer tools.
- [Krusch Git MCP](https://ai-powered.com/mcp/krusch-git-mcp): Krusch Git MCP is an open-source MCP server for developer tools.
- [NEPHIS MCP Server](https://ai-powered.com/mcp/nephis-mcp-server): NEPHIS MCP Server is a freemium MCP server for developer tools.
- [Coding Tools MCP](https://ai-powered.com/mcp/coding-tools-mcp): Coding Tools MCP is an open-source MCP server for developer tools.
- [MCPProxy](https://ai-powered.com/mcp/mcpproxy): MCPProxy is an open-source MCP server for developer tools.
- [CHRONOS-AGENT](https://ai-powered.com/mcp/chronos-agent): CHRONOS-AGENT is an open-source MCP server for developer tools.
- [Bloch](https://ai-powered.com/mcp/bloch): Bloch is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/krusch-coding-harness
