Skip to main content

repo-index-mcp

Local codebase retrieval tool for coding agents. It indexes committed code from local git repos into a local SQLite database, then exposes ranked snippets through a CLI and MCP stdio server.

Install

From GitHub with pipx:

pipx install git+https://github.com/Zhachory1/repo-index-mcp.git@v0.2.3

With npm/npx, after installing uv:

npx repo-index-mcp doctor

The npm package is a thin wrapper around the Python package. It does not bundle local SQLite index data.

For development:

python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

Check local readiness:

repo-index doctor

First success path

For a deterministic five-minute smoke test, see docs/getting-started.md.

Index this repo or another local git repo:

repo-index index /path/to/git/repo

Query it:

repo-index query "where is request retry handled" -k 5

Lookup a symbol:

repo-index get-symbol RepoIndex --repo /path/to/git/repo

Discover and index every git repo under a root:

repo-index index-root ~/code

Show indexed repos and freshness:

repo-index status

MCP setup

Run the MCP server over stdio:

repo-index serve

Agent config example:

{
  "mcpServers": {
    "repo-index": {
      "type": "stdio",
      "command": "/Users/YOU/.local/bin/repo-index",
      "args": ["--db", "/Users/YOU/.repo-index-mcp/index.sqlite", "serve"],
      "env": {}
    }
  }
}

npm/npx config example:

{
  "mcpServers": {
    "repo-index": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "repo-index-mcp", "--db", "/Users/YOU/.repo-index-mcp/index.sqlite", "serve"],
      "env": {}
    }
  }
}

Use which repo-index to find the absolute command path for your machine when using direct CLI installs.

Freshness hooks

Install hooks for one repo or a repo root:

repo-index install-hooks /path/to/git/repo
repo-index install-hooks ~/code --recursive

Hooks run best-effort after commit/merge:

repo-index --db <db> reindex "$PWD"

They preserve the selected DB path and must not fail git commands.

Docs

  • docs/getting-started.md — install to first useful query.
  • docs/mcp-clients.md — MCP config examples.
  • docs/troubleshooting.md — common setup/query/freshness issues.
  • docs/cli-reference.md — command reference.
  • docs/output-schema.md — JSON fields.
  • docs/evals.md — eval authoring and gate.
  • docs/pilot.md — 5-engineer pilot measurement plan and local reporting commands.
  • docs/language-support.md — parser/regex/window support matrix.
  • docs/recipes.md — common operations.
  • docs/upgrade-uninstall.md — lifecycle commands.
  • docs/release.md — PyPI-first and npm-wrapper release flow.

Evals

Phase 0 eval docs live in docs/phase-0-baseline.md. The seed golden set lives in evals/golden.repo-index-mcp.jsonl.

Run the eval gate:

repo-index eval evals/golden.repo-index-mcp.jsonl . -k 10 --fail-under 0.85

Pilot proof

Pilot task/activation/miss events are recorded in ~/.repo-index-mcp/usage.jsonl without snippets. Passive query logging is opt-in with REPO_INDEX_ENABLE_USAGE_LOG=1. Use:

repo-index pilot report

See docs/pilot.md for activation, timing, miss capture, and decision gates.

Retrieval behavior

  • Python functions/classes/methods get parser-backed symbol metadata.
  • TS/JS/Go/Java/Rust/C/C++/SQL get Tree-sitter parser-backed symbol metadata.
  • Other common declaration patterns get regex-backed symbol metadata.
  • get_symbol uses stored symbol metadata before search fallback.
  • Search blends vector, lexical, symbol, and path scores.
  • Results include stale/dirty flags.

Data boundary and safety

  • Default embeddings are local deterministic hash vectors.
  • Default configuration does not send source code to external APIs.
  • Index data is local SQLite derived data and can be deleted/rebuilt.
  • Files matching high-confidence secret patterns are skipped and prior chunks for those paths are removed.
  • Secret skipping is a best-effort local guardrail, not a guarantee. See SECURITY.md.

Current limits

  • Python uses stdlib AST parser chunks; TS/JS/Go/Java/Rust/C/C++/SQL use Tree-sitter parser chunks; other languages use regex-backed symbol hints plus line windows.
  • Local deterministic hash embeddings, not quality-tuned semantic embeddings.
  • SQLite storage scans/scoring in Python, no ANN/vector extension yet.
  • Freshness is committed-code freshness; dirty working-tree edits are reported but not indexed.

Metadata

Release files for repo-index-mcp 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repo-index-mcp 0.2.3
File Size Uploaded Provenance
repo_index_mcp-0.2.3.tar.gz 80.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for repo-index-mcp 0.2.3
File Interpreter ABI Platform
repo_index_mcp-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 120.2 kB

Release files / repo_index_mcp-0.2.3.tar.gz

Download URL repo_index_mcp-0.2.3.tar.gz
Size 80.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d8e1d2fdec6cfbb6a370f454cab4005755899a43bfddd6531d69b0a2b608982b
BLAKE2b-256 checksum
How to use checksums
217c2804a1869570bab6a66a819fd8ebdd927057333ce611d76434fb7c7f8a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / repo_index_mcp-0.2.3-py3-none-any.whl

Download URL repo_index_mcp-0.2.3-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
730c2c3a5593f9a6f16b77a12336aa72cdc30a64d24b9c77c299c04848a6249a
BLAKE2b-256 checksum
How to use checksums
48164f699add0af10f740d1694711c9b02cc382b4c7765a7535c022a0b905c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for repo-index-mcp 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page