LabscoMCP early access ↗
mef-programmingMCP SERVER · OFFICIAL PROJECT

MCP Cpp Project Indexer

Point an AI at a large C++ codebase and have it read exact source ranges instead of whole files.

by mef-programming ↗Code Intelligence & Repository Indexing✓ Official

LABSCO SUMMARY

Metadata first, source second — and it says which is which.

The discipline that makes this useful on a big tree is that locating and reading are separate operations. Routing tools return ranges and never source text, so a search does not spend context; only read_symbol and read_range return code. The docs are equally clear about the boundary: hunk intersections are routing hints, not analysis, and you are expected to read the source before making a claim about behaviour. Source file operations are jailed to the project's source directory.

What it is

A deterministic source-range indexer for large, module-heavy C++ projects. It maps symbols, files and C++20 modules to exact line ranges so a client can ask where something is and then read only that range. It is not a compiler, LSP replacement or semantic analyzer.

What you get

  • find_symbol, find_declaration and find_symbols_glob locate by name, with matchKind on every result saying why it matched
  • read_symbol returns one symbol's body, sliceable by offset; read_range reads explicit lines or an around-line window with beforeLines and afterLines
  • get_nearest_symbol_for_line maps a line from a diagnostic, a build error or a hunk onto the containing indexed range
  • list_file_symbols, find_files, list_file_includes and get_file_structure work when the file is already known
  • Change tracking, when git is available: list_changed_files, list_recent_revisions, get_revision_summary, get_file_change_hunks and resolve_hunk_to_indexed_range — read-only, with no generic command runner
  • get_project_summary plus get_index_fingerprint, get_file_fingerprint, get_symbol_fingerprint and get_data_fingerprint let a caller tell which cached facts went stale after a rebuild; validate_fingerprints checks up to 500 items in one call and returns metadata only
  • Routing controls narrow results before any source is read: compact, symbolTypes, container, filePattern, exactOnly, hideNamespaces and limit

Requirements

Python, a clone of the repository, and two steps: build the index with build_project_index.py --root <YOUR_PROJECT_ROOT> --output-root <YOUR_PROJECT_ROOT>\.mcp-cpp-project-indexer, then start code_index_mcp_server.py with --project-root and --index-root. For several clients or a long-lived process, add --transport http --http-host 127.0.0.1 --http-port 8765. No account, no network service.

Setup effort

Build from source — git clone https://github.com/walti1972/mcp-cpp-project-indexer.git