Labsco
MCP SERVER

Code Index MCP

by johnhuang316

Index a repository once, then find files and search code without walking the tree every time.

Code Intelligence & Repository IndexingVerified
Summary
Two indexes, because they cost different amounts.

The shallow one answers where is this file instantly; the deep one answers what is in it and is built only when asked. That split, plus literal-by-default search, is what keeps a large repository navigable without turning every question into a full scan.

What it is

A code index for assistants. Point it at a project and it builds a shallow file index for quick discovery, with a deeper symbol index built on request when you need structure rather than location. Search is literal by default, with regex and fuzzy matching available and results paginated.

What you get
  • A project initialised by path and indexed, with the index rebuilt on demand after files change
  • A deep symbol index built separately, because symbol-level analysis costs more than file discovery and is not always needed
  • Search that is literal unless you ask otherwise, with regex, fuzzy matching, file-type filtering and paging — ten results a page by default
  • Files located by glob pattern rather than by guessing at paths
  • A file summarised into its structure, functions, imports and complexity, and a named symbol's body pulled out on its own
  • A file watcher that can keep the index fresh automatically, with its status and settings both readable and changeable
  • The search backend re-detected on request, so installing ripgrep or ugrep is picked up without a restart
  • The index storage directory created, checked, and cleared when you want to start over
Requirements

Python 3.10 or newer with uv; launched over stdio as uvx code-index-mcp, or installed from PyPI with pip. It indexes a local directory, set with the project-path tool or passed as an argument at startup so the server comes up already pointed at the repository. Regex search needs a native search tool such as ripgrep or ugrep on the machine — the built-in fallback is literal only — and symbol summaries need the deep index built first. On Windows, uvx wants the standard profile directories present in the server's environment.

Setup effort

One command — uvx code-index-mcp