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.
CLI
Terminal-native agent. Three commands to install, one to launch.
Read · CLI ↗IDE
Browser workspace with file tree, structural search, and inline chat.
Read · IDE ↗MCP
Bring Mesh to Claude Desktop or Cursor through Model Context Protocol.
Read · MCP ↗Gateway API
Programmable HTTPS endpoint. Index, search, recover spans at scale.
Read · API ↗Install.
Mesh is shipped as a single npm binary. macOS, Linux, and WSL2 are first-class. Node 18+ required.
# 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.
$ 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?
- Scan — Mesh walks the working tree and skips
.gitignoreentries by default. - Compress — A capsule of structural symbols, signatures, and call edges is built (Tree-sitter under the hood).
- 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.
| Concept | What it is |
|---|---|
capsule | A compressed structural index of a workspace. ~600 tokens / 1k LOC. |
span | A byte-range in a real file. Returned verbatim — never paraphrased. |
recall | The percent of NIAH probes Mesh answers correctly. Standard track: 100%. |
provider | The LLM that does the reasoning. Mesh is provider-agnostic. |
session | An interactive mesh shell with full capsule + chat history. Resumable. |
workspace | Any 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
| Command | Purpose |
|---|---|
mesh | Open an interactive session in the current directory. |
mesh ask "<query>" | One-shot query without opening the shell. |
mesh index | Build (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 providers | List available providers and active key status. |
mesh doctor | Verify Node version, env, and provider routing. |
mesh bench | Run 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.
# 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
| Provider | MESH_PROVIDER | Notes |
|---|---|---|
| Anthropic | anthropic | Default. Recommended. |
| OpenAI | openai | GPT-5, GPT-5-mini. |
| OpenRouter | openrouter | Any model, any host. |
| Groq | groq | Fastest inference. Llama, Qwen. |
| DeepSeek | deepseek | v3, Coder v2. |
| Ollama | ollama | 100% local. No internet. |
Voice mode
Speak instead of type. Voice mode runs a local Whisper turbo model — nothing leaves your machine.
$ 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.
- Open ide.try-mesh.com and sign in with GitHub.
- Pick a repository (read-only or read-write).
- Press ⌘K →
Index workspace. - 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
| Action | Shortcut |
|---|---|
| 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.
$ 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:
{
"mcpServers": {
"mesh": {
"url": "http://localhost:7400",
"description": "Mesh code context"
}
}
}
Tool reference
| Tool | Args | Returns |
|---|---|---|
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.
$ 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.
$ 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" }
Search & recover
$ 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.
$ 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
| Code | Meaning | Action |
|---|---|---|
401 | Missing or invalid bearer token. | Check $MESH_KEY. |
404 | Capsule not found. | Re-index, capsules expire after 30 days. |
422 | Invalid query. | Inspect error.detail for field-level info. |
429 | Rate-limited. | Backoff. Read Retry-After header. |
503 | Indexing 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.
[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
| Symptom | Fix |
|---|---|
| "Provider not configured" | Run mesh providers and set the matching env var. |
| Stale answers after editing files | Run mesh index --force or set auto_index = true. |
| Slow first run | Capsule build is single-threaded. Pass --workers 4. |
| MCP client can't see Mesh | Confirm mesh mcp serve is running. Check the port matches the client config. |
| Voice mode silent | Re-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
- 0.9.0 — Multi-hop reasoning benchmark added.
mesh recovernow byte-exact across all providers. - 0.8.4 — MCP server ships standalone (
@edgarelmo/mesh-mcp).find_refstool added. - 0.8.0 — Browser IDE preview. Capsule sharing via
~/.mesh/. - 0.7.0 — Voice mode (Whisper turbo, local-only).
- 0.6.0 — Provider plugin system. Ollama support.
Stuck? Join the waitlist for direct support during private preview, or open an issue on GitHub.