AR

agentic-research/mache

Developer tools
46 stars 2 forks Quality 70 Trend 32Apache-2.0

IDE-style navigation for structured data — code, JSON, YAML. Jump to definitions, find callers, follow references. Available as an MCP server or a mounted folder.

Overview

Mache projects structured data into a navigable graph. Point a declarative schema at any structured source — JSON documents, SQLite databases, source code — and mache exposes the projection as MCP tools or a mounted filesystem, so an agent (or you) can explore the topology instead of grepping flat files. One engine, many projections. The schemas in examples/ project CVE feeds (NVD, KEV), Notion exports, Trivy scan results, Terraform, Markdown, LLM conversation logs, and audit trails with the same machinery that projects Go or Rust source. — the most-developed projection, where the graph gains functions, types, cross-references, call chains, structural smell rules, and optional LSP-grade enrichment. Mache (/mɑʃe/ mah-shay): from papier-mâché — raw material, crushed and remolded into shape. That's the 30-second path for the flagship application — code intelligence on a codebase.

README

Mache

Mache projects structured data into a navigable graph. Point a declarative schema at any structured source — JSON documents, SQLite databases, source code — and mache exposes the projection as MCP tools or a mounted filesystem, so an agent (or you) can explore the topology instead of grepping flat files.

One engine, many projections. The schemas in examples/ project CVE feeds (NVD, KEV), Notion exports, Trivy scan results, Terraform, Markdown, LLM conversation logs, and audit trails with the same machinery that projects Go or Rust source. Code intelligence is the flagship application of that engine — the most-developed projection, where the graph gains functions, types, cross-references, call chains, structural smell rules, and optional LSP-grade enrichment.

Mache (/mɑʃe/ mah-shay): from papier-mâché — raw material, crushed and remolded into shape.

Quick start

git clone https://github.com/agentic-research/mache.git
cd mache && task build && task install
mache init --global   # installs the keepalive HTTP daemon (:7532) + registers detected editors

That’s the 30-second path for the flagship application — code intelligence on a Go codebase. mache init --global installs a per-user supervisor (launchd on macOS, systemd --user on Linux) that keeps the shared mache HTTP daemon alive on localhost:7532 and registers it with Claude Code and any detected editors — no terminal to babysit. Then mache init (no flag) inside a project records what that project serves.

Two things new users hit:

  • HTTP is the canonical transport. One shared daemon serves every project, routing per session via the MCP roots protocol. --stdio exists only as an escape hatch for CI / sandboxes / headless agents and is never registered for editor use (see ADR-0022).
  • ley-line-open is a hard requirement, not an add-on. Since v0.18.0 mache has no in-process parser: leyline parse produces the _ast database that every source projection reads. task install provisions the pinned binary from a checkout; mache install does the same from a release asset or package-manager install, where there is no Taskfile. Point mache at a directory or a pre-built .db — both route through leyline; a pre-built .db just skips the parse step and can carry LSP/embedding enrichment.

To project non-code data instead, hand mache serve (or the root mount form, mache ) a schema with --schema and point it at your JSON or SQLite source — the example schemas cover NVD, KEV, Notion, Trivy, Terraform, and more.

For the full first-run flow — source choice (directory vs .db vs live hot-swap), the --stdio escape hatch, --scope, Claude Desktop, mount as filesystem, write-back, schema inference, troubleshooting — see GETTING-STARTED.md.

Code intelligence: what it gives an agent

The code projection is where the engine is deepest. 19 MCP tools wrap the projected graph — 18 read-surface plus write_file.

What you get Tools Tier Status
Parse source into a graph — required Stable — 27 of 28 languages (all but cue: no grammar)
Orient in an unfamiliar repo get_overview, get_architecture, get_diagram base Stable
Cluster related code get_communities base Beta — Louvain
Navigate by structure, not string match find_definition, list_directory, read_file, resolve_ref, search base Stable
Trace reference flow, both directions find_callers, find_callees, get_impact, get_dataflow base Stable — edges are explicitly node_ref evidence
Judge structural quality find_smells — 14 rules base¹ Stable — fan_out_skew is qualifier-aware
Edit without breaking the file write_file — validate → format → splice, draft mode on reject base Stable
Types + diagnostics from a real LSP get_type_info, get_diagnostics + LSP pass Stable, optional tier
Search by meaning, not tokens semantic_search + embeddings Stable, optional tier
Check enrichment freshness get_sheaf_status any² Stable
Serve across repos (--mount NAME=PATH) base Stable — find_callers federates; callees per-mount
Mount as a filesystem + write back (NFS) base Stable
Move a built graph between machines/CI (mache cache push/pull/verify) — Stable — content-addressed, local dir or OCI
Infer a schema from data (--infer) — Beta — FCA + greedy entropy

Tiers. There is no “works without ley-line-open” tier — leyline parse is the parser.

  • base — any source projection. leyline parse → _ast → pure-Go ASTWalker, from a directory or a pre-built .db.
  • + LSP pass — leyline’s LSP tier, auto-spawned on demand (pass a file=) or pre-baked into a .db. Drives the real language server (rust-analyzer, gopls, …); verified end-to-end on Rust and Go. Same primitive Serena is built on, but as an enrichment tier over the _ast base rather than the foundation.
  • + embeddings — a ley-line-open-built .db carrying embedding vectors.

¹ 5 of the 14 rules need an enriched .db.  ² Reports daemon cache state; returns {available: false} when unreachable, so it’s safe to call anywhere.

Internal machinery — canonical v_refs/v_defs views (ADR-0013), the capnp event-log readthrough, snapshot memoization, the e2e tool/flamegraph harness — lives in ARCHITECTURE.md and CHANGELOG.md.

For which tools read which tables, see ARCHITECTURE.md § MCP Server and § Interplay with ley-line-open.

How it works

Public Go API

Library callers can produce either a raw leyline database or a Mache schema-projected database without invoking the mache CLI:

import (
	"github.com/agentic-research/mache/build"
	"github.com/agentic-research/mache/schema"
)

// Resolve a bundled preset or a schema file relative to the project.
resolved, err := schema.Resolve("go", projectDir)
if err != nil {
	return err
}

// Use the resolved topology directly...
if err := build.ParseWithSchema(projectDir, outputDB, resolved.Topology); err != nil {
	return err
}

// ...or let build preserve preset metadata used by the grammar guard.
return build.ParseWithSchemaRef(projectDir, outputDB, "go", projectDir)

build.Parse writes leyline’s raw parse shape. ParseWithSchema and ParseWithSchemaRef additionally run Mache’s Engine + ASTWalker projection, including the registered env:, mod:, and gomod: reference extractors. All paths invoke the pinned leyline executable and keep Mache CGO-free. Address-reference extraction uses leyline’s root-relative source IDs, so files below the source root participate in the same graph as root files.

Running the pinned leyline (mache-19326d)

Portable cache (mache-aeb262)

Deployment modes

Docs

License

Apache 2.0

View the full README on GitHub

Install

docker run --rm -i mache:0.22.0 serve --stdio /path/to/source
New to MCP? Start with the mcpskill.org guide →