Sandbox
@pinoox/neuromesh

MCP context engine for Cursor, Claude, and Codex

NeuroMesh sits between your repo and your coding agent. It builds a code graph, routes a task to the right symbols, and folds the rest of the file bodies into short markers that can be expanded later.

85 stars8 forksRustUpdated 7d ago
Who it's for

Builders who use agentic editors and want their assistant to work from a smaller, more relevant slice of a large codebase.

What it delivers

You can give your agent the right context without dumping entire files into the prompt.

What it does

Graph-based context routing

Indexes files, symbols, imports, and call links so the agent can find the shortest path to the right code.

Folded evidence packets

Keeps needed functions open and collapses the rest into reversible one-line fold markers.

MCP server for coding assistants

Exposes tools like `get_context_packet`, `neuromesh_expand_fold`, `neuromesh_search_symbols`, and `neuromesh_trace` over stdio.

Feedback-aware retrieval

Lets you record which fix worked so similar tasks can route better next time.

CLI and monitor UI

Provides commands such as `neuromesh doctor`, `neuromesh connect`, `neuromesh index`, and `neuromesh monitor` for setup and inspection.

Multi-language code understanding

Uses tree-sitter and language overlays to work across Rust, TypeScript, Python, Go, Java, Kotlin, PHP, C#, Dart, Swift, Ruby, and more.

How to get it

  1. 1macOS / Linux
    curl -fsSL https://raw.githubusercontent.com/pinoox/neuromesh/main/install.sh | bash
  2. 2Windows (PowerShell)
    irm https://raw.githubusercontent.com/pinoox/neuromesh/main/install.ps1 | iex
  3. 3Then from your project root
    neuromesh doctor          # verify binary and workspace
    neuromesh connect         # write MCP configs (Cursor, VS Code, Claude, …)
    neuromesh index           # build the graph (<30s typical)

README

NeuroMesh

Ship less context. Ship the right code.

Local-first MCP context engine for Cursor, VS Code, Claude, Codex, and every MCP client. NeuroMesh indexes your repo into a graph, routes your prompt to the right symbols, and sends a folded evidence packet — not thousand-line file dumps.

Release Rust CI MCP License: MIT

Cursor · VS Code · Claude · Codex · OpenCode · MiMo CLI · Antigravity · Kilo · Trae · Windsurf · Zed

The pain · Fold · Galaxy · Measured · Install · Connect · Docs · Site


The pain

You ask a simple question in a large project. The editor copies two or three thousand-line files and ships them to the model.

What you pay for:

  1. Tokens you never needed — dollar cost on every turn
  2. Seconds of fake loading while the window fills with helpers you will not touch
  3. Lost in the middle — the model drowns in unrelated bodies and invents bugs

Today’s workarounds all leak in a different place:

ApproachWhat goes wrong
Vector RAGChunks smash functions. The shape of the code disappears.
“Just attach the files”The model sees everything and understands nothing.
A static code graphBetter map — then it still pastes full files into the prompt.

NeuroMesh is the missing step: route first, then fold. The graph is for finding the path. The packet is what the model actually reads.


Don’t delete. Fold.

Don’t delete the extra code. Fold it.

How does nature pack two metres of DNA into a nucleus without deleting a single letter?
Not by throwing genes away — by folding.

Nature does not delete DNA to fit a nucleus. It supercoils.

NeuroMesh treats the syntax tree like a genetic strand in RAM:

  • Functions you need stay expressed (exons) — real body, real lines
  • The rest collapse to a one-line reversible intron:
/* [neuromesh:fold:fold_unused_helper_1 | 12 lines folded | fn unused_helper()] */

The agent still sees the shape of the file — signatures, imports, neighbors — without paying for every private helper. When a folded body is required, neuromesh_expand_fold unsplices it from a registry in memory. Nothing was deleted. Nothing needs a second grep of the disk.

Structure stays. Tokens sleep. Wake a fold when you need it.


Why it feels different

What you getWhat it means for you
Smart foldingRelevant functions stay open; everything else collapses to one-line markers you can expand on demand.
Shortest path routingOnly the files your task needs — not the whole repo neighborhood.
Learns from your editsCall record_feedback after a good fix; similar tasks route faster next time.
Safety modesBalanced by default; auth and payment tasks automatically get more context.
Live code graphYour repo indexed in RAM — functions, imports, and calls, not shredded text chunks.

Curious about the biology metaphor? docs/nature.md


Install

Pre-built binary (no Rust required). v0.9.0 defaults to engine: fast — instant graph index, no ONNX warm at startup.

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/pinoox/neuromesh/main/install.sh | bash

Windows (PowerShell)

irm https://raw.githubusercontent.com/pinoox/neuromesh/main/install.ps1 | iex

Then from your project root:

neuromesh doctor          # verify binary and workspace
neuromesh connect         # write MCP configs (Cursor, VS Code, Claude, …)
neuromesh index           # build the graph (<30s typical)

Restart your IDE so MCP picks up the new server. Re-run the installer to update — then neuromesh -V should show v0.9.0.

PlatformBinary
macOS / Linux~/.local/bin/neuromesh
Windows%LOCALAPPDATA%\Programs\neuromesh\neuromesh.exe

Hybrid/deep embeddings (neuromesh install embed minilm), CBM proxy, monitor port: docs/configuration.md.


Connect

NeuroMesh speaks MCP over stdio — what your IDE launches in the background.

neuromesh connect --global --agent-rules   # recommended once per machine

That registers the server and copies the agent rule so the IDE actually calls NeuroMesh instead of raw Read / Grep.

Manual (when neuromesh is on PATH) — paste into ~/.cursor/mcp.json:

{
  "mcpServers": {
    "neuromesh": {
      "command": "neuromesh",
      "args": ["mcp"]
    }
  }
}

Per-client paths: docs/mcp.md.


Agent loop

Pass the user task as written — any language. Default engine: fast: graph + server-assisted concept expansion; no keyword tables.

get_context_packet(query / task_description / prompt / task)
  → check coverage.claim and retrieval.resolution_tier
  → neuromesh_search_symbols or neuromesh_expand_gap if seeds missed
  → neuromesh_expand_fold when a folded body is required
  → neuromesh_trace for callers and blast radius
  → neuromesh_record_feedback after a successful edit

Teach every IDE: docs/agent-guide.md · Cursor template: docs/agent-rule.mdc.


3D Neural Galaxy

neuromesh monitor is a live map of your project: packages at a glance, then the file graph, then symbols inside a module.

Macro constellation of project subsystems in the 3D Neural Galaxy

Constellation — packages and subsystems

3D Neural Galaxy file graph with Physarum slime tubes

3D galaxy — files and call/import links

Module zoom showing Core files and function symbols

Module zoom — files and symbols in one area of your codebase

Default URL: http://127.0.0.1:8765 · neuromesh monitor · port: neuromesh port


Tools (MCP)

ToolUse
get_context_packetMain entry — folded evidence packet
neuromesh_expand_foldRestore one folded body
neuromesh_search_symbolsRanked symbol search when seeds miss
neuromesh_traceCall / import chains
neuromesh_record_feedbackStrengthen paths you actually edited

Full reference: docs/mcp.md.


Everyday CLI

neuromesh index              # refresh graph after large changes
neuromesh status             # node / edge counts
neuromesh monitor            # 3D graph UI (see above)
neuromesh doctor --engine    # show retrieval preset
neuromesh config engine hybrid   # opt in to semantic search (needs embed install)

Command reference: docs/cli.md.


Languages

Rust, TypeScript, Python, Go, Java, Kotlin, PHP, C#, Dart, Swift, Ruby, and more via tree-sitter. Framework overlays for Laravel, Django, Next, Vue, Axum, Rails, Flutter, and others. Details: docs/architecture.md.


What we actually measured

Savings are per task, after folding — not a marketing average. Run neuromesh eval on your own repo to see your numbers.

Example from a 650k-token monorepo (release v0.9.0, default engine: fast):

Task (plain language)ModeFull repoBefore foldPacket sentSaved vs repoExtra grepsms
Fix the MCP tool handlerbalanced650,85972,42817,38997.3%022
Trace graph routing codebalanced650,85919,6254,08099.4%012

Index on that project: 340 files · 552 ms. Methodology and multilingual holdout: docs/quality.md.


Documentation

DocStart here when you want to…
Agent guideWire Cursor / VS Code / Claude to use NeuroMesh
MCP toolsSee what each tool returns
CLICommands for install, index, connect, monitor
ConfigurationSwitch engines, proxy, advanced tuning
Enginesfast vs hybrid vs deep in one page
Docs indexFull map
ChangelogWhat changed in v0.9.0

MIT · LICENSE

Files in the repo

Repository payload17 top-level entries
  • .cargo
  • .github
  • crates
  • docs
  • editors
  • scripts
  • tests
  • .gitignore
  • Cargo.lock
  • Cargo.toml
  • install.ps1
  • install.sh
  • LICENSE
  • nm.config.example.json
  • nm.config.json
  • README.md
  • rust-toolchain.toml

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k