Skip to content
Conduit

mcp server

haskell-rules-and-mcp

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 21, 2026

haskell-flows-mcp

An MCP server for property-first Haskell development. It gives your agent 12 tools over one embedded ghcide session: scaffold a project, author whole modules, compile-check, evaluate expressions, propose and run QuickCheck laws, and gate before push — every write verifies-or-rolls-back.

Status: v1.0.0 — stable. Maintenance only: bugfixes and GHC compatibility; no feature roadmap.

CI Release License: BSD-3-Clause

The 12 tools

ToolWhat it does
ghc_projectcreate / switch / list / validate / bootstrap — project scaffolding (test-suite ships QuickCheck)
ghc_moduleadd / remove, scratchpad verbs, and write_module — whole-module authorship with compile-verify + rollback
ghc_editrefactor verbs (snapshot + verify + rollback), import, exports, fix_warning, format
ghc_checkload / module / project / lint — compile and typecheck gates
ghc_evalevaluate an expression in the loaded module's context
ghc_inspecttype / hole / info / browse / complete / goto / doc
ghc_depsadd / remove / list / explain — dependency surgery on the .cabal
ghc_suggestlaw candidates for the current module (8 engines, confidence-rated)
ghc_propertyQuickCheck run + persist, run replay, export to test/Spec.hs, arbitrary derivation
ghc_gatepre-push gate: build + tests + lint + property replay, one call
ghc_batchrun a prepared chain of calls in one round-trip
ghc_sessionstatus / help / toolchain / warmup / imports + workflow verbs

Retired names map to successors in docs/TOOL_TAXONOMY.md.

Quickstart

  1. Prerequisites — GHC 9.12.x + cabal via ghcup (see docs/requirements.md for the full table).

  2. Get the binary (darwin-arm64 / linux-x64), or build from source:

    curl -L "https://github.com/damian-rafael-lattenero/haskell-rules-and-mcp/releases/download/v1.0.0/haskell-flows-mcp-darwin-arm64.tar.gz" \
      | tar -xz -C "$HOME/.local/bin/"
    # verify: sha256 with the matching .sha256 asset, then:
    haskell-flows-mcp --version && haskell-flows-mcp --doctor
    
    # or from source:
    git clone https://github.com/damian-rafael-lattenero/haskell-rules-and-mcp
    cd haskell-rules-and-mcp/mcp-server-haskell
    cabal install exe:haskell-flows-mcp --installdir="$HOME/.local/bin"
    
  3. Wire your MCP host (stdio):

    { "mcpServers": { "haskell-flows": {
        "command": "/absolute/path/to/haskell-flows-mcp" } } }
    
  4. In-session: the initialize handshake ships a situation→tool table derived from the live registry — no rules file needed.

The property-first loop

  1. ghc_module(add) + write_module — author a module.
  2. ghc_suggest — proposed laws with confidence and rationale.
  3. ghc_property(check) — run a law; passing properties persist to the project store automatically.
  4. ghc_gate — one call: build + cabal test (replays the whole persisted set) + lint.

Verification

Every push: scripts/gate.sh tiers — t0 build, t1 unit (775 tests)

  • deadlock canary, t2 full e2e (424 checks across ~70 scenarios), all under a hang-watchdog. Dogfood evidence for the 1.0.0 loop: docs/dogfood-2026-10-10.md (three MCP-only runs, mechanically scored).

Architecture

One binary, stdio JSON-RPC in/out. Mcp.Server dispatches the 12 tools behind a normative envelope (status / result / error / warnings / nextStep). All compile/type/eval work routes through one embedded ghcide IdeSession guarded by an MVar. Properties persist per-project under .haskell-flows/. External tools (cabal, hlint, formatters) spawn argv-form only — no shell interpolation, path traversal rejected by construction.

Platforms

darwin-arm64 (verified end-to-end) · linux-x64 (CI-built release binary) · Windows: not supported.

Documentation

Requirements & --doctorhard vs optional binaries, env knobs
Install guidedownload, checksums, cabal fallback
Tool taxonomythe 12 tools + retired-name successors
Flows · Testingend-to-end workflows, tiers
Dogfood evidencetriple run, E4 green
Changelog · Contributing · Security

BSD-3-Clause — Damián Rafael Lattenero, 2026.

↑↓ navigate openesc close