# Heddle [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/davet47/heddle  
**GitHub Stars:** 3  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/heddle

## Description
Content-addressed contracts and a verification cache that cut agent context by skipping proven code.

## Tools
Capabilities this server exposes over MCP:

- **get_contract** — the ~300-token context packet: contract + hash + one-line dep signatures + caller list
- **put_contract** — validate, write `contracts/<name>.yaml`, return new hash, a semantic diff of what changed, and every invalidated dependent
- **get_dependents** — blast-radius query, direct or transitive, names + hashes; inferred (unreviewed) contracts flagged
- **verify** — per-unit `cached-pass` / `pass` / `fail` plus a top-level `ok` gate bit; `radius=true` widens each name to its full blast radius; runs tests only on cache misses; failures come back as a ≤40-token assertion summary, never a traceback; inferred contracts in the closure flagged (refused under strict…
- **status** — dirty contracts, stale verifications, cache hit-rate, resolved verify interpreter, cumulative token counters

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "heddle": {
    "command": "uvx",
    "args": ["hashloom","serve"]
  }
}
```

## Documentation

## What the Heddle MCP server does

The Heddle MCP server gives an agent a contract-centered view of a software project instead of requiring it to reread complete specification, source, and test files. Each unit is represented by a YAML contract in `contracts/`, with a signature, dependencies, invariants, examples, test node IDs, and an implementation reference.

Contracts are content-addressed. Their hashes let the system determine whether a unit or one of its dependencies has changed. Implementations are treated as replaceable code behind a more durable contract, which fits workflows where an agent regenerates code while preserving reviewed interfaces.

The Heddle MCP server also records whether contracts were inferred from existing code or reviewed. Inferred contracts are reported in dependency and verification results; strict provenance mode can make verification refuse units that rely on them.

## How it works

Run the server from a project containing `.hashloom/` and `contracts/`. The server finds the project by walking upward from its working directory until it reaches the nearest `.hashloom/` directory. It communicates through the stdio transport.

A contract hash is calculated from a canonical representation of contract content. Implementation hashes use a normalized abstract syntax tree, so formatting and comment-only edits do not invalidate verification. A verification cache key combines the contract, implementation, test-source, toolchain, and transitive dependency hashes. A cache miss runs the relevant tests; a matching key can return the previous result.

Dependency relationships also support direct or transitive blast-radius queries. When a contract changes, dependents can be identified by name and hash rather than inferred from file conventions. Context retrieval combines the target contract with dependency signatures and callers in a small packet.

## Setup and configuration

Install the package with `pip install hashloom`, or install it directly from the repository. In a project directory, run `hashloom init` to create `.hashloom/` and `contracts/`, then run `hashloom index` to build the store.

Claude Code can register the stdio server with `claude mcp add hashloom -- hashloom serve`. The repository also documents a getting-started workflow for building and reviewing contracts with an agent.

Strict provenance is enabled in `.hashloom/config.json` with `{"strict_provenance": true}`. Without that setting, inferred contracts are flagged but do not generally block reads, writes, or verification.

## Tools and capabilities

The Heddle MCP server exposes these MCP tools:

- `get_contract` returns a roughly 300-token packet containing a contract, its hash, one-line dependency signatures, and callers.
- `put_contract` validates and writes `contracts/<name>.yaml`, then reports the new hash, a semantic change summary, and invalidated dependents.
- `get_dependents` finds direct or transitive dependents and returns their names and hashes, marking inferred contracts.
- `verify` reports `cached-pass`, `pass`, or `fail` for each unit and an overall `ok` gate. With `radius=true`, it verifies each requested name's full blast radius. Failures are summarized in up to 40 tokens rather than returning a traceback.
- `status` reports dirty contracts, stale verification results, cache hit rate, the resolved verification interpreter, and cumulative token counters.

## Limitations and notes

Contracts are intended for stable seams that other units depend on, not every internal implementation detail. Invariants document intended behavior but are not themselves machine-enforced; tests provide the actual verification check. A wrong contract can therefore mislead later regeneration.

The documented benchmark measures token reduction on example projects, but results vary with dependency depth and project structure. The material does not establish support for arbitrary languages beyond the listed example projects in Python, Go, TypeScript, Java, and C#.

_Full upstream README: https://allmcps.com/mcp/heddle/readme_

