Lybrary

io.github.vibhu-dixit由 GitHub 帳號 vibhu-dixit 發布v0.3.2更新於 Oct 24, 2026

Local codebase memory and repository code search for Codex, Claude Code, and MCP coding agents.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Lybrary 是本地程式碼庫記憶伺服器,為儲存庫建立索引,讓程式設計助理在讀取整份檔案前先搜尋其中的函式、類別與檔案。

可以做什麼
依精確符號或 SQLite 全文索引搜尋已索引的儲存庫,語意嵌入搜尋作為備援,回傳排序後的路径、符號、行範圍與編號摘錄,可選擇回傳完整片段內容。查看目前生效的儲存庫根目錄與索引健康狀態。觸發增量、全量或依路徑範圍的重新索引。索引支援 Python、JavaScript、TypeScript、TSX、Go、Rust、Java、C 與 C++,背景檔案監看器會更新變更的檔案。
適用情境
適合程式設計助理跨工作階段在同一儲存庫中工作、需要定位某項功能或追蹤呼叫路徑,而不想反覆進行大範圍搜尋與讀取大檔案的情況。最適合使用支援語言、且你願意在本機建立索引的儲存庫。
執行需求
需要本機 Python 環境並從 PyPI 安裝 lybrary 套件,並在每個要索引的儲存庫中執行 lybrary start 以建立索引並啟動檔案監看常駐程式。MCP 伺服器以帶 mcp 參數的 stdio 指令註冊。首次索引可能下載本機嵌入模型;不需要 API 金鑰或託管資料庫。
安裝前請注意
背景常駐程式在終端機關閉後仍會執行,直到被停止;它會監看並索引儲存庫檔案,因此應在忽略檔案中排除敏感路徑。助理可透過 memory_update 觸發重新索引,變更設定後需要全量重建。索引保留在本機,但助理可以讀取索引中的原始碼摘錄。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lybrary,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Lybrary — local codebase memory for coding agents

Lybrary indexes a repository by code structure and gives Codex, Claude Code, and other MCP clients a searchable map of its functions, classes, and files. It runs locally, watches for changes, and lets an agent find relevant source lines before opening whole files.

PyPI · Documentation · Agent setup guide · Source · Issues

If you want a coding agent to set this up, ask it to find and install a local MCP code search tool for the repository and point it to the agent setup guide. The guide identifies the PyPI package, source repository, install command, and checks that confirm the agent is using this repo's index.

Start in any repository

Install once, then run lybrary start in each folder you want indexed:

bash
pip install lybrarycd /path/to/your/repolybrary startlybrary status

start creates .lybrary/ if needed, builds the index, and runs a file-watching daemon in the background. It keeps running after the terminal closes. Run lybrary stop in that repository to stop it. The first indexing run may download the local embedding model; later runs use the cache.

Each repository has its own index and .lybrary/config.toml. The index stays on your machine; no API key or hosted database is required.

Connect an agent

Register the MCP server once on your machine. Start your agent in an indexed repository, then ask it to call memory_status to confirm the root and chunk count.

Codex

Codex users can install Lybrary's setup skill from the repository's plugin marketplace:

bash
codex plugin marketplace add vibhu-dixit/lybrarycodex plugin add lybrary@lybrary

The plugin helps with setup; register the local MCP server separately:

bash
codex mcp add lybrary -- lybrary mcpcodex mcp list

Add this to that repository's AGENTS.md if you want Codex to use the memory consistently:

markdown
When .lybrary/index.db exists, use Lybrary memory_query before broad code searches or reading multiple files. Inspect the returned source paths and lines before editing. If the index is absent or the tool fails, use normal search.

Claude Code

Claude Code users can install the repository's plugin, which registers the MCP server and includes a setup skill:

bash
claude plugin marketplace add vibhu-dixit/lybraryclaude plugin install lybrary@lybrary

The Python package must also be installed with pip install lybrary. Or register the MCP server directly without the plugin:

bash
claude mcp add --scope user --transport stdio lybrary -- lybrary mcpclaude mcp list

In Claude Code, /mcp shows connection status. Put the same instruction in the repository's CLAUDE.md. Registration makes the tool available; the instruction helps the agent choose it when useful.

For another stdio MCP client, configure command lybrary with argument mcp. See the setup guides.

What the agent gets

memory_query checks exact symbols and an SQLite FTS5 index first. Strong lexical matches avoid loading the embedding model; semantic search remains a fallback when wording does not match the code. Its default response gives ranked paths, symbols, line ranges, and compact numbered excerpts. If a trace crosses a named call missing from the first result, query that symbol once. Set include_content=true when a full chunk is needed.

memory_status reports the active repository and index health. memory_update triggers incremental, full, or path-scoped re-indexing.

This can avoid repeated broad searches and large file reads, especially when the agent needs to locate a feature across sessions. Actual token use depends on the task, the agent's tool choices, and how much source it still needs to inspect. The benchmark guide explains how to compare complete runs rather than infer savings from the size of one response.

Make it fit your repo

Edit .lybrary/config.toml to choose the embedding model and device, chunk sizes, indexed languages, excluded paths, and file-watcher debounce. Add Git-style ignore patterns to .lybrary/ignore. Re-run lybrary index --full after changing settings that affect stored chunks or embeddings.

Supported parsers: Python, JavaScript, TypeScript, TSX, Go, Rust, Java, C, and C++. The indexer uses tree-sitter boundaries and refreshes changed files while the daemon is running.

CLI

CommandPurpose
lybrary startInitialize, index, and watch the current repository
lybrary stopStop its background daemon
lybrary statusShow daemon and index status
lybrary query "authentication flow"Search from the terminal
lybrary index --fullRebuild the index
lybrary logsShow daemon logs
lybrary mcpRun the stdio MCP server

If an agent starts above the indexed repository, pass that repository's absolute path as repo_root to the MCP tool, or start the agent inside it.

Measure the effect

From a source checkout, compare the same read-only question with and without Lybrary:

bash
python benchmark.py /path/to/indexed/repo "Trace how interview invitations are sent"

The script records both answers, tool calls, and total, cached, and uncached input tokens under .lybrary/benchmarks/. Check answer correctness first; one question does not establish typical savings.

Contribute

Issues and pull requests are welcome. For a local checkout:

bash
pip install -e ".[dev]"pytest

Lybrary is MIT licensed. See the changelog for releases.

來源:README.md,提交 7a59db4

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.3.2最新Oct 13, 2026
  2. v0.3.0Oct 13, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。