crux
Provides a local-first code indexing and search engine for coding agents via MCP, enabling precise codebase queries, symbol lookup, and freshness-aware retrieval.
README
crux
A local-first context engine for coding agents.
crux watches folders, keeps a live index of your code (plus docs, tickets, and web pages),
and serves it over MCP so any agent — loop, Claude Code, Cursor, Windsurf, Zed — can
ask precise questions about your codebase instead of grepping blindly.
Status: Phase 1. The live index works end-to-end and serves MCP.
Install
curl -fsSL https://raw.githubusercontent.com/notshekhar/crux/main/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/notshekhar/crux/main/install.ps1 | iex
No runtime needed — it's a single static binary. Language grammars are fetched on
first crux init rather than bundled, so the download stays small.
crux init . # index a repo, print agent config
crux search "retry webhooks"
crux symbol RetryPolicy
crux status # what's indexed, how fresh
crux list # every workspace you've indexed
crux serve . # browse the index in a browser
crux mcp . # what your agent runs
crux upgrade # update in place
Inspecting the index
crux serve opens a local inspector — loopback only, since the index holds
your source:
- Graph — the import graph, as modules or individual files, force-directed. Hubs are highlighted; isolated files are counted rather than drawn.
- Search — the same three-arm search the agent gets, showing which arms matched.
- Files — per file: every symbol, and the chunk boundaries search actually uses.
- Symbols — definitions, callers, callees. Labelled heuristic until SCIP lands.
- Inspect — what is in the index, per-tier coverage, and storage by table.
Uninstall with CRUX_UNINSTALL=1 bash install.sh.
Where it keeps things
Everything lives under ~/.crux — nothing is written into the repos you index:
~/.crux/
├── config.json settings
├── grammars/ tree-sitter parsers, fetched on first init
└── index/
├── registry.json
└── <project>-<hash>.db
crux list shows every index and its size; crux forget <path> deletes one.
Indexing many repos at once
Point it at a folder of projects and it indexes all of them into one searchable
index, applying each repo's own .gitignore:
crux init ~/code # 20 repos, 21,415 files, 106s, 588 MB
crux search "leader election heartbeat" ~/code
Measured on the loop repo (469 files, 3.9 MB of TypeScript): cold index 3.4 s at
138 files/s, 13,455 symbols, query p50 2.1 ms / p95 3.2 ms.
Built: the durable queue, leader election, tree-sitter extraction for
TS/TSX/JS/Python/Go/Rust, content-addressed storage, FTS5 + trigram, three-arm
fused search, the filesystem watcher, five MCP tools, and the CLI.
Not yet: the code graph (refs, pack), embeddings, and connectors.
Why
Every "context for AI" tool today does the same thing: chunk the repo, embed it, run cosine similarity, dump twenty chunks into the prompt. That approach cannot answer the questions agents actually ask — "who calls this?", "what breaks if I change this signature?" — because those are graph queries with no similarity signal at all.
crux runs five retrievers (BM25, trigram, vector, symbol table, path fuzzy), fuses them,
and then expands along the code graph. Embeddings are roughly 20% of the answer quality.
The graph is the moat.
The second half of the thesis is freshness. A stale index is worse than no index,
because the agent can't tell the difference. crux watches the filesystem, queues work
durably in SQLite, and verifies every returned span against the file on disk before
handing it to an agent.
Read the plan
| Doc | What's in it |
|---|---|
| 00-overview | Thesis, goals, non-goals, decisions already made |
| 01-architecture | Process model, leader election, why no daemon |
| 02-queue | The durable job queue — schema, claiming, the hash skip rule |
| 03-watcher | Filesystem watching, event storms, git-aware shortcuts |
| 04-storage | Content-addressed schema, why branch switches are free |
| 05-index-tiers | Lexical → tree-sitter → SCIP → vectors → git |
| 06-retrieval | Query pipeline, fusion, graph expansion, context packing |
| 07-mcp | The eight tools and why the cap matters |
| 08-sources | Connectors for docs, tickets, web |
| 09-operations | Resource discipline, privacy, prompt-injection safety |
| 10-roadmap | Phases, evaluation, risk register |
Shape of it
Claude Code Cursor loop ← MCP hosts (stdio)
└──────────────┼─────────────┘
crux mcp × N ← thin readers
│
.crux/index.db ← SQLite (WAL) + durable job queue
│
one elected leader ← watcher + parse worker + embed worker
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。