Documentation · v0.9 (preview)

Mesh in five minutes.

Mesh is a deterministic code-context engine that compresses your workspace 3.9× while keeping 100% recall. Same engine, four surfaces — terminal CLI, browser IDE, MCP server, and the raw Gateway API. This is everything you need to ship.

Pick a surface.

Install.

Mesh is shipped as a single npm binary. macOS, Linux, and WSL2 are first-class. Node 18+ required.

bashinstall · 1 line
# global install (recommended)
$ npm i -g @edgarelmo/mesh-agent-cli

# or with pnpm / yarn
$ pnpm add -g @edgarelmo/mesh-agent-cli
$ yarn global add @edgarelmo/mesh-agent-cli

# verify
$ mesh --version
mesh 0.9.0

Homebrew is coming. A formal Homebrew tap (brew install mesh) is in private beta. Join the waitlist to get early access.

First run.

Mesh always opens against your current working directory. Drop into any repo and launch — it'll index the workspace before the agent says a word.

bashsession
$ cd my-project
$ mesh

▸ scanning workspace…
✓ 247 files · 12 languages indexed in 1.4s
▸ building capsule (3.9× compression)…
✓ capsule cap_8kX9z2a ready

mesh › why are voided invoices being charged?
▸ pulled: invoices.ts:14, webhooks.ts:88, billing.spec.ts:42
✓ proposed patch · src/billing/invoices.ts
  press ↵ to apply, e to edit, q to skip

What just happened?

  1. Scan — Mesh walks the working tree and skips .gitignore entries by default.
  2. Compress — A capsule of structural symbols, signatures, and call edges is built (Tree-sitter under the hood).
  3. Recover — When the agent needs full context, Mesh pulls the exact byte-range from disk — never from a hallucination.

Concepts.

Six things to understand before you go deep.

ConceptWhat it is
capsuleA compressed structural index of a workspace. ~600 tokens / 1k LOC.
spanA byte-range in a real file. Returned verbatim — never paraphrased.
recallThe percent of NIAH probes Mesh answers correctly. Standard track: 100%.
providerThe LLM that does the reasoning. Mesh is provider-agnostic.
sessionAn interactive mesh shell with full capsule + chat history. Resumable.
workspaceAny directory Mesh has built a capsule for. Stored in ~/.mesh/.

CLI · overview.

The terminal CLI is the canonical Mesh experience. Everything else (IDE, MCP, API) wraps the same engine.

Commands

CommandPurpose
meshOpen an interactive session in the current directory.
mesh ask "<query>"One-shot query without opening the shell.
mesh indexBuild (or rebuild) the capsule for the current workspace.
mesh resume <id>Continue any previous session by id.
mesh recover <path:line>Pull the exact span Mesh returned to the model.
mesh providersList available providers and active key status.
mesh doctorVerify Node version, env, and provider routing.
mesh benchRun the benchmark suite locally.

Providers & keys

Mesh supports six providers out of the box. Set the env var, point MESH_PROVIDER at it, and go.

bash~/.zshrc · provider env
# Anthropic (default)
export ANTHROPIC_API_KEY=sk-ant-...

# OpenAI
export OPENAI_API_KEY=sk-...

# OpenRouter (any model)
export OPENROUTER_API_KEY=sk-or-...

# Local: Ollama
export MESH_PROVIDER=ollama
export MESH_MODEL=llama3.3:70b

# Switch active provider
export MESH_PROVIDER=anthropic
export MESH_MODEL=claude-sonnet-4.6
ProviderMESH_PROVIDERNotes
AnthropicanthropicDefault. Recommended.
OpenAIopenaiGPT-5, GPT-5-mini.
OpenRouteropenrouterAny model, any host.
GroqgroqFastest inference. Llama, Qwen.
DeepSeekdeepseekv3, Coder v2.
Ollamaollama100% local. No internet.

Voice mode

Speak instead of type. Voice mode runs a local Whisper turbo model — nothing leaves your machine.

bashvoice
$ mesh voice install     # one-time, ~120MB model
$ mesh --voice            # launch in voice mode

✓ whisper-turbo loaded
🎙  press [space] to talk · [esc] to cancel

IDE · launch.

The Mesh IDE is a browser workspace at ide.try-mesh.com. VS Code-style file tree, structural search, and inline chat — all powered by the same capsule engine.

  1. Open ide.try-mesh.com and sign in with GitHub.
  2. Pick a repository (read-only or read-write).
  3. Press ⌘KIndex workspace.
  4. Open the chat panel (⌘L) and start asking.

Capsules are reused. If you ran mesh index in your CLI, the IDE will pick up the same capsule via ~/.mesh/. Index once, query everywhere.

Shortcuts

ActionShortcut
Open command palette⌘K / Ctrl K
Toggle Mesh chat panel⌘L / Ctrl L
Index / re-index workspace⌘⇧I
Quick file open⌘P
Structural search⌘⇧F
Apply suggested patch⌘↵

MCP · install & run.

The Mesh MCP server exposes capsule operations as Model Context Protocol tools. Any MCP-compatible client (Claude Desktop, Cursor, Zed) can use Mesh as a code-context backend.

bashmcp · install & serve
$ npm i -g @edgarelmo/mesh-mcp
$ mesh mcp serve --port 7400

▸ binding 127.0.0.1:7400
✓ MCP server ready · 4 tools registered
  • mesh.search_code
  • mesh.read_span
  • mesh.find_refs
  • mesh.recover

Add to Claude Desktop / Cursor

Drop this snippet into your client's MCP config:

json~/Library/Application Support/Claude/mcp.json
{
  "mcpServers": {
    "mesh": {
      "url": "http://localhost:7400",
      "description": "Mesh code context"
    }
  }
}

Tool reference

ToolArgsReturns
mesh.search_code{ query, limit }Top-N symbol matches w/ file paths.
mesh.read_span{ path, line }Exact byte-range from the file.
mesh.find_refs{ symbol }Every reference site across the workspace.
mesh.recover{ capsule_id }Full source for any capsule reference.

Gateway API · auth.

The Gateway API is a thin HTTPS layer around the same engine. Bearer-token auth. Rate-limited per key.

bashauth header
$ curl https://api.mesh.dev/v1/me \
    -H "Authorization: Bearer $MESH_KEY"

{ "id": "usr_8kX9", "plan": "preview", "rate_limit": 60 }

Capsules

Index a repo. Returns a capsule_id you can query against.

bashPOST /v1/capsules
$ curl -X POST https://api.mesh.dev/v1/capsules \
    -H "Authorization: Bearer $MESH_KEY" \
    -d '{"repo":"github.com/acme/payments","branch":"main"}'

{
  "capsule_id": "cap_8kX9z2a",
  "files": 3174,
  "tokens_in": 2400000,
  "tokens_out": 612000,
  "ratio": 3.92,
  "recall": 1.00,
  "status": "ready"
}
bashGET /v1/search
$ curl "https://api.mesh.dev/v1/search?q=stripe.charge&capsule=cap_8kX9z2a" \
    -H "Authorization: Bearer $MESH_KEY"

{
  "matches": [
    { "path": "src/billing/invoices.ts", "line": 18, "score": 0.94 },
    { "path": "src/webhooks.ts",         "line": 88, "score": 0.81 }
  ]
}

Then recover the exact span — verbatim, byte-for-byte.

bashGET /v1/recover
$ curl "https://api.mesh.dev/v1/recover?capsule=cap_8kX9z2a\
&path=src/billing/invoices.ts&line=18&context=10" \
    -H "Authorization: Bearer $MESH_KEY"

{
  "path": "src/billing/invoices.ts",
  "start_line": 8, "end_line": 28,
  "sha": "a3f8b9...",
  "source": "export async function finalizeInvoice(id) { ... }"
}

Errors

CodeMeaningAction
401Missing or invalid bearer token.Check $MESH_KEY.
404Capsule not found.Re-index, capsules expire after 30 days.
422Invalid query.Inspect error.detail for field-level info.
429Rate-limited.Backoff. Read Retry-After header.
503Indexing in progress.Poll GET /v1/capsules/:id until ready.

Configuration.

Mesh reads from three places, in order: CLI flags → env vars → ~/.mesh/config.toml. Later wins.

toml~/.mesh/config.toml
[provider]
default = "anthropic"
model = "claude-sonnet-4.6"
temperature = 0.2

[capsule]
max_tokens = 6000
compression = "high"     # "low" | "balanced" | "high"
exclude = ["node_modules", "dist", ".next"]

[ide]
auto_index = true

[telemetry]
enabled = false          # opt-in, off by default

Telemetry

Mesh ships with telemetry off. If you opt in (telemetry.enabled = true), we collect: command invocations, error types, and capsule sizes. Never source code, never queries. Disable any time.

Troubleshooting

SymptomFix
"Provider not configured"Run mesh providers and set the matching env var.
Stale answers after editing filesRun mesh index --force or set auto_index = true.
Slow first runCapsule build is single-threaded. Pass --workers 4.
MCP client can't see MeshConfirm mesh mcp serve is running. Check the port matches the client config.
Voice mode silentRe-run mesh voice install. Check microphone permissions.

Preview release. Mesh is in private preview (v0.9). The API surface and config schema may change before 1.0. Pin @edgarelmo/mesh-agent-cli@0.9.x in CI.

Changelog


Stuck? Join the waitlist for direct support during private preview, or open an issue on GitHub.