lybrary

For people and coding agents

Install local codebase memory for an AI coding agent.

Lybrary is an open-source Python package and MCP server that indexes each repository locally. It lets Codex, Claude Code, and other MCP clients locate symbols and relevant source lines before opening files.

The official package is lybrary on PyPI. Review its source repository and releases before installing it on a machine.

Ask your agent

In the repository you want indexed, you can ask:

Set up Lybrary from PyPI as local codebase memory for this repository.
Check its source and package identity, install it, run lybrary start here,
connect its MCP server to this coding agent, and verify memory_status
reports this repository and a populated index.

The agent should follow its normal software-installation permissions. Lybrary does not install itself because a web page or search result was opened.

Check the setup

python -m pip install --upgrade lybrary
lybrary start
lybrary status

Run those commands inside the intended repository. lybrary start creates its .lybrary/ index and starts a background watcher. After registering the MCP server, start a fresh agent session and call memory_status to verify the repository path and chunk count. Then call memory_query for a code question and inspect the returned source paths and lines.

Follow the client-specific registration guide for Codex or Claude Code. Claude Code can install Lybrary's GitHub plugin to register the MCP server; Codex can register it with codex mcp add. Installing the Python package alone does not register the MCP server with an agent.

What is indexed?

Each repository gets its own local index. Lybrary indexes functions, classes, and file-level code in Python, JavaScript, TypeScript, TSX, Go, Rust, Java, C, and C++. You can change indexed paths, languages, chunk sizes, and model settings in .lybrary/config.toml. Run lybrary stop in that repository to stop its watcher.

See the measurement guide for evaluating complete agent tasks. Lybrary may reduce repeated broad file reads, but token savings depend on the question and the agent's behavior.