lattice-mcp
This MCP server supports the lattice-mcp/BowThruster whiteboard workflow: read docs, explore architecture, retrieve code slices, mutate/verify boards, and inspect logs.
Read README, full README, architecture guide, or unified
bowthrusterSKILL.md docs.Render Atlas topology or full human-readable specifications from a live board.
Retrieve component/symbol slices and inline exact
#Lstart-Lendsource code; optionally mark components STALE.Compile self-contained STALE WorkPackets with laws skeletons, Python AST skeletons, and baseline commit SHA.
Mutate boards by compiling canonical Markdown pipe tables for Charter, Component, Flow, Interface, Law, Schema, and Rule artifacts.
Run Git↔Whiteboard sync gates (
pre,post,baseline,drift) to verify STALE edits, AST signatures, laws, flows, imports, proofs, and symbols.Transition component lifecycle statuses such as READY, IN_PROGRESS, IN_QA, VERIFIED, FAILED, and STALE.
Query the append-only structured flight recorder logs to diagnose rejected turns or gate errors.
Supports architecture mapping, focused code slicing, and pre-commit verification for C/C++ codebases.
Integrates with Git history and commits for baseline stamping, pre-commit verification, post-commit SHA/line-anchor updates, and drift detection.
Supports architecture mapping, focused code slicing, and pre-commit verification for JavaScript codebases.
Supports architecture mapping, focused code slicing, and pre-commit verification for Kotlin codebases.
Compiles Markdown pipe tables into the architecture Whiteboard, allowing agents to mutate components, flows, interfaces, schemas, and rules.
Generates optional Mermaid topology graphs of components and health metrics via lattice_atlas.
Supports architecture mapping, focused code slicing, and pre-commit verification for Python codebases.
Supports architecture mapping, focused code slicing, and pre-commit verification for Ruby codebases.
Supports architecture mapping, focused code slicing, and pre-commit verification for Rust codebases.
Supports architecture mapping, focused code slicing, and pre-commit verification for Swift codebases.
Supports architecture mapping, focused code slicing, and pre-commit verification for TypeScript codebases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lattice-mcp slice the checkout flow with contracts and exact line ranges"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BowThruster
BowThruster keeps two small guarantees in an AI coding loop:
Human session memory survives compaction. A single
session.mdfile holds the active goal, working ideas, problems, agreed decisions, ruled-out decisions, and open questions. Runtime hooks re-inject that context and block subagent tasks that revive a ruled-out decision.Test impact gets surfaced and verified. A
tree-sitterindex finds the tests that import a production file you are about to edit, and a SHA-256 ledger blocks an agent from stopping before those tests have run against the current file contents.
BowThruster needs Python 3.11+ and installs tree-sitter-language-pack. The core CLI makes no model calls and needs no API keys.
Install
pip install -e .
bowthruster initRun bowthruster init from the repository root. It creates session.md and .mental_cache/, updates .gitignore, and installs the Claude Code and Git hooks.
Related MCP server: Hokmah MCP Server
CLI
All commands accept --project-root PATH and --json either before or after the subcommand.
bowthruster init [--agy] [--lead-id ID ...] [--no-hooks] [--json]
bowthruster status [--json] # alias: session
bowthruster impact <files...> [--limit N] [--max-hops H] [--json] # alias: tests
bowthruster plan-tests [files...] [--max-tests N] [--max-hops H] [--rank-jev] [--json]
bowthruster check [files...] [--json]
bowthruster hook <action> [--file F] [--session-id S] [--transcript T] [--agy] [--lead-id ID ...] [--json]initcreatessession.mdand.mental_cache/, then installs hooks unless--no-hooksis set. Use--agyto also install Antigravity hooks and--lead-idto mark Lead conversation IDs.statusreports session state, parsed bullets, syntax errors, and unverified test-impact changes.impactresolves each file and lists importing tests across multi-hop reverse imports (--max-hops, default6).plan-testscomputes a fail-closed test plan (widen_full_suite,tests,reasons,frontend_changed) from git dirty/deleted files or explicit file arguments,.bowthruster_fixtures.jsonglob rules, and optional--rank-jevfail-fast ordering.checkruns the syntax + Python LLM AST check and the unverified test-impact check; it exits1when syntax or AST gate errors exist.hookruns one runtime action:install,pre-prompt,pre-tool,post-tool,post-read,stop,distill-session,pre-commit, orpost-commit.
Optional Credentials
The core CLI and SHA-256 test-impact gate run offline with zero API keys. Optional model features read environment variables (or .env):
TYPESAFE_API_KEY— querieshttps://api.typesafe.ai/v1/systemone(jev-latest) for ruled-out dispatch checks,session.mdcuration, andplan-tests --rank-jevfail-fast ordering.DEEPSEEK_API_KEYorGEMINI_API_KEY— distills completed Lead turns intosession.md(deepseek-v4-proorgemini-2.5-flashwith full model output ceilings).
Feature 1: session.md memory and the ruled-out guard
session.md is a plain Markdown file the agent and the human can both read and edit:
# Active Session
## Goal
- (exploring)
## Working Ideas & Current Focus
- (none yet)
## Problems & Findings
- (none yet)
## Agreed Decisions
- (none yet)
## Ruled Out (and Why)
- Do not parse raw token claims in the gateway; route every check through auth.
## Open Questions
- (none yet)UserPromptSubmitre-injects the active Goal and settled sections across long sessions.On an idle Lead stop,
distill-sessionupdatessession.mdfrom the latest transcript.PreToolUsechecks subagent dispatch prompts against## Ruled Out (and Why). When Jev credentials are configured, it blocks a task that would revive a ruled-out decision.Emptying
session.mdresets it to the Brainstorming template.
Feature 2: test-impact surfacing and the SHA-256 gate
For a production file, BowThruster parses repository imports with tree-sitter, finds test files that import it, and deduplicates the result per session:
bowthruster impact src/auth/token.py{
"files": ["src/auth/token.py"],
"importing_tests": ["tests/test_gateway.py"]
}Runtime hooks inject the same list on edit (pre-tool) and read (post-read) so the agent sees which tests to run before it stops.
The verification gate records SHA-256 hashes of production files when a test command succeeds:
.venv/bin/python -m pytest tests/test_gateway.pyLater, bowthruster check and the stop hook compare each dirty production file's current SHA-256 against the verified ledger. If the file changed after the last successful test run, the agent is blocked from stopping until it runs the importing tests again.
Fail-closed test planning (plan-tests), fixtures, and shadow recall
bowthruster plan-tests builds an inspectable CI/local test plan:
bowthruster plan-tests --rank-jev --jsonReason tags: each selected test records
"changed-test","direct-import:<src>","transitive-caller:<src>", or"declared-fixture:<pattern>".Fail-closed full-suite widen (
"tests": ["*"]): widens automatically on deleted/renamed Python modules ("deleted-module:<path>"), unmapped or global Python dependencies such asconftest.py/pyproject.toml("unmapped-dependency:<path>"), or candidate counts exceeding--max-tests("fanout-overflow").Non-import fixture rules (
.bowthruster_fixtures.json): map repo-relative globs to test files,["*"], or["FRONTEND_BUILD"](which sets"frontend_changed": truewithout adding a fake pytest target):
{
"fixtures/**/*.json": ["tests/test_loader.py"],
"migrations/*.sql": ["*"],
"web/**": ["FRONTEND_BUILD"]
}Opaque fail-fast Jev ranking (
--rank-jev): sends only opaqueq_0001..q_NNNNIDs and anonymized coupling counts tohttps://api.typesafe.ai/v1/systemone(jev-latest).UNKNOWN(None) probabilities run first, followed by descending failure probability; Jev never drops or skips a selected test.Shadow recall telemetry:
record_shadow_proposalappends pre-run proposals and actual failures to.mental_cache/shadow_proposals.jsonl, andshadow_recall_summaryreports total runs and false-negative misses.
.mental_cache/ layout
.mental_cache/ is git-ignored and lives next to session.md:
.mental_cache/
├── hook_config.json # Lead conversation IDs and install flags
├── pre_prompt_turns.json # per-conversation prompt-injection cadence
├── session_state.json # distillation state
├── session_parked.md # parked session items
├── test_callers.json # cached tree-sitter caller index
├── verified_tests.json # SHA-256 verification ledger and stop-block signatures
├── seen_impact.json # read/edit impact deduplication
├── shadow_proposals.jsonl # immutable pre-run shadow selector log
├── distill.log # detached distillation log
└── .gitignore # ignores everything in this directoryWalkthrough
# 1. Start a session.
cd your-repo
bowthruster init
# 2. Record a rule in session.md.
# Edit "## Ruled Out (and Why)" with a bullet such as:
# - Do not parse raw token claims in the gateway; route every check through auth.
# 3. Before editing a shared module, list the tests that import it.
bowthruster impact src/auth/token.py
# 4. Run those importing tests, then check the gate.
.venv/bin/python -m pytest tests/test_gateway.py
bowthruster check
# 5. Inspect the live session.
bowthruster statusWith hooks installed, the ruled-out guard and test-impact prompts run automatically during the agent's normal edit, read, subagent-spawn, and stop events.
License
Functional Source License, Version 1.1, with an Apache 2.0 future licence (FSL-1.1-Apache-2.0). See LICENSE.
Available Tools
8 toolsatlasA
Step 1 (Explore LOD_0 or Living Spec): Render the 1-line-per-component Atlas topology (with Charter, Role, Why/Rationale, verification statuses, > FLOW edges, health metrics, and optional Mermaid graph) or pass spec=true to compile the full human-readable Markdown specification from the live board.
Inputs: spec, board, boards, mermaid, +2 more.
git_syncA
Step 4 (Verify & Sync): Run Git <-> Whiteboard sync: mode='pre' (50ms pre-commit gate checking STALE edit guard, AST signatures, call-graph % LAW reachability, > FLOW schemas, dangling imports, Bend 2 proofs, and unregistered_public_symbols; pass mark_verified=true to auto-transition STALE components to VERIFIED when allowed=true), mode='post' (stamp commit_sha, heal git mv renames, refresh #Lstart-Lend AST anchors, cascade STALE), mode='baseline', or mode='drift'.
Inputs: mode, board, manifest, project_root, +1 more.
logsA
Query the append-only Structured Flight Recorder (.whiteboard/logs/lattice_events.jsonl) to diagnose rejected turns or gate errors.
Inputs: board, limit, status, project_root.
packetsC
Step 3 (Build STALE Packet): Compile self-contained WorkPackets with Bend 2 laws_skeleton, Python AST python_skeleton (with Spec docstrings & # MUST CALL anchors), and baseline_commit_sha.
Inputs: wave, board, force, status, +3 more.
readmeB
Read the BowThruster README, System Architecture Guide, or the unified 'bowthruster' SKILL.md template so you know how to format pipe tables and operate BowThruster.
Inputs: section.
sliceA
Step 1 (Slice + Code in One Shot): Retrieve a <2KB component/symbol slice AND exact #Lstart-Lend source code (set query='<function_or_helper>', include_code=true) BEFORE calling read_file or grep. Pass mark_stale=true when pulling code for an internal fix (no contract change) to mark the matched component STALE in one shot.
Inputs: kind, board, query, stage, +7 more.
statusB
Step 4 (Transition Status): Transition a component's build lifecycle status (e.g. new_status='VERIFIED' after pre-commit gate and delta/seam tests pass).
Inputs: component (required), new_status (required), board, reason, +3 more.
turnB
Step 2 (Mutate Board First -> STALE): Compile Markdown pipe tables into the Whiteboard in <50ms BEFORE editing any VERIFIED file when contracts/architecture change. Canonical table headers: | Charter | Summary | Principles |, | Component | Role | Why | Owner | Stage | Depends_On | Files | (Why column is optional), | Flow | Source | Target | Payload | Condition |, | Interface | Component | Inputs | Outputs | Owner | Stage | File | Spec |, | Law | Component | Owner | Stage | Bend_Dir | Args | LHS | RHS | Spec | (reserve % LAW for multi-variable k>=2 boolean rules using Bool.and/or/not; never invent 1-boolean x==x tautologies), | Schema | Component | Fields | Owner | Stage | File | Spec |, | Rule | Component | Type | Property | Op | Value | Condition |.
Inputs: board (required), message (required), profile, speaker, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The tools map onto a clear staged workflow (atlas/slice=Step 1, turn=Step 2, packets=Step 3, git_sync/status=Step 4) which aids selection, and logs/readme are distinct. However, git_sync is heavily mode-overloaded (pre/post/baseline/drift), atlas supports two output modes, and status overlaps with git_sync's mark_verified STALE->VERIFIED transition, creating real boundary confusion.
All names are single lowercase words or a single snake_case compound (git_sync), so style is consistent. There is no verb_noun convention, so the name alone doesn't convey the action (e.g. 'turn' and 'packets' are opaque until you read the description), but internal consistency is high.
8 tools is well within a healthy range for a spec/workflow lifecycle server, and each participates in the pipeline rather than duplicating. The only concern is functional density (git_sync's four modes, atlas's two modes) rather than raw count.
The surface covers the core loop: explore (atlas), retrieve code (slice), mutate board (turn), compile packets, verify/sync (git_sync), transition (status), and diagnose failures (logs), plus format guidance (readme). Minor gaps exist: no explicit undo/rollback for a bad turn, and code editing itself is delegated to external read_file/grep and implied editors.
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceEnables AI agents to query architecture context, data contracts, and blast radius to prevent cross-repo architectural breakage before merging.22Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with persistent architectural memory of codebases, enabling impact analysis, test generation, and code generation with reduced token usage.MIT
- AlicenseNot gradedqualityCmaintenanceEnables agentic coding tools to maintain a living, in-repo model of intent, architecture, and code, with deterministic indexing, bidirectional linking, and continuous drift detection for task-scoped context and reconciliation.MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with an embedded knowledge graph and architecture governance tools, enabling blast radius analysis, compliance checks, and smart context extraction from codebases.Apache 2.0