lancet
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Lancet
Find, read, and change code and documents — on one coordinate system, at index speed.
Website & live demo · Docs · 한국어 · Benchmarks · How it works · Why one tool
Lancet is one Rust binary for AI coding agents and the people working beside them. It replaces the rg + fd + ast-grep + cat + sed + patch chain, and every step shares one index and one set of line numbers: find files, search text and syntax, read exact ranges and symbols, and edit — in source code, PDFs, spreadsheets, Korean HWP documents and archives alike.
Install
curl -fsSL https://raw.githubusercontent.com/CREE1116/lancet/main/install.sh | sh # macOS / Linux
irm https://raw.githubusercontent.com/CREE1116/lancet/main/install.ps1 | iex # Windows
brew tap CREE1116/lancet https://github.com/CREE1116/lancet && brew install lancet # HomebrewThe full binary is ~40 MB (every grammar and document adapter); more options, including cargo and a 4 MB text-only build, are in the installation guide.
Related MCP server: LiuHe
A minute with lancet
lancet index . # optional: build the index once; it keeps itself fresh
lancet fd -e rs # fd's flags and output
lancet rg -w retries src # ripgrep's flags and output, from the index
lancet read src/net.rs --symbol retry_limit # one function, with its rev
lancet refs retry_limit src # definition and every use
lancet ast '$X.unwrap()' src --lang rs --rewrite '$X?' # structural rewrite, dry run
lancet edit src/net.rs --old-string 'retries = 3' --new-string 'retries = 5' --rev <REV> --apply
git diff | lancet patch --apply # all files or noneEvery write is a diff until --apply (-q for just the summary and new rev). Try these in the browser on a small project — the outputs there are recorded from the real binary.
Why lancet
Agents chain tools, and the failures happen between them. Each number below is reproduced by a script in this repository (bench/failure_modes.py, bench/suite.py, CI parity jobs), and each says what it compares. They were measured on one Apple Silicon Mac; reproductions on Linux x86_64 are welcome as an issue.
What was compared | |
0 / 800 updates lost | Four agents doing read → change → write back on the same files. With no lock or version check, 600 of 800 updates were lost. The same workflow with lancet's |
300 / 300 parity cases |
|
9–10× faster than ripgrep | Rare-literal searches on Linux and LLVM in the default auto mode (9.7× and 8.9×), which still re-reads every file changed since indexing, so results equal a full scan. The same search with |
40 / 40 reads on the right line | Searching a |
The full case, with the multi-agent protocol, file identity and the critiques we took seriously: docs/why-one-tool.md.
How it works, in three lines
The index only decides which files not to open. Every candidate is checked by the same code a full scan uses, so results are identical to a scan. Files edited since indexing are found by
(mtime, size, ctime, inode)and re-read — no watcher daemon. (What that check can miss.)One coordinate system. A hit on line 42 is line 42 in
readandedit, even inside a PDF, spreadsheet orarchive.zip!entry.read --symbol,outline,refsandastshare the same Tree-sitter spans.Every write is a compare-and-swap.
readreports arev(a hash of the bytes);edit,ast --applyandpatchwrite only if the file still has it, under a file lock, and refuse edits that add syntax errors.
Index format, compaction, AST prefiltering and the full benchmark tables: docs/how-it-works.md and docs/benchmarks.md.
Commands
Command | What it does |
| ripgrep's flags and output on lancet's index and document extractors (parity) |
| fd's flags, output and exit codes, plus |
| Tree-sitter search and |
| Line ranges, |
| Change lines, a symbol, exact text or many hunks at once; guarded by |
| Apply |
| Definitions and uses (comments and strings skipped; lexical, so same-named symbols in other scopes are listed too); declaration skeletons, fitted to a token budget with |
| Rename a local variable with scope resolution (17 languages: Rust, Python, JS/TS, Go, C/C++, Java, C#, Kotlin, Swift, Ruby, PHP and more) |
| Build or update the index |
| MCP server for clients without a shell |
| Shell completions (the installers set them up) |
Documents and archives: PDF, DOCX, PPTX, ODT, HWP, HWPX, EPUB, XLSX/XLS/ODS, ZIP, TAR, GZ — extracted in-process with size caps.
Using lancet with agents
MCP:
claude mcp add --transport stdio lancet -- lancet mcp --root .(other clients)Skill: copy
skills/lancet/to~/.claude/skills/,~/.codex/skills/or.agents/skills/AGENTS.md / CLAUDE.md: paste docs/agent-instructions.md
License
Dual-licensed under either of Apache License 2.0 or MIT, at your option.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Your personal library, readable by AI agents: durable snapshots, hybrid search, 46 MCP tools.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Related MCP Servers
- AlicenseAqualityBmaintenanceThe open retrieval layer for AI agents. Index your entire project — code, docs, legal, research, data — and serve surgical context via MCP. FTS5 full-text search, optional semantic search (FastEmbed/ONNX), 10 built-in parsers, incremental auto-sync.8284 PyPI27MIT
- AlicenseAqualityBmaintenanceLLM-native code tools: 44 MCP tools for AI agents to read, understand and modify code. Rust tree-sitter parse daemon (crash-isolated), SQLite symbol index (repo map 98ms), transactional journal-backed writes, deterministic quality gates (zero LLM calls). 512MB cgroup: 128 concurrent, zero OOM. MIT.131MIT
- AlicenseAqualityBmaintenanceThe IDE for agents — read by symbol, edit against a revision, validate with your own build, revert. It is a local stdio MCP server for coding agents. It reads code by symbol with tree-sitter and real language servers (Go, Java, Scala, TypeScript, Python, Rust, Ruby), edits against a known revision and returns compiler diagnostics with each edit, runs the repository's own build, test etc.121Apache 2.0
- AlicenseCqualityAmaintenanceLocal search over your code and documents for AI agents. Hybrid search and a code graph over your code and documents (PDF, Word, PowerPoint, Excel, EPUB), served over MCP with file and line spans, from one Rust binary on your machine.813Apache 2.0