# MikeRecognex/mcp-codebase-index [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/MikeRecognex/mcp-codebase-index  
**GitHub Stars:** 63  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mikerecognex-mcp-codebase-index

## Description
Structural codebase indexer exposing 17 query tools (functions, classes, imports, dependency graphs, change impact) via MCP. Zero dependencies.

## Tools
Capabilities this server exposes over MCP:

- **get_project_summary** — File count, packages, top classes/functions
- **list_files** — List indexed files with optional glob filter
- **get_structure_summary** — Structure of a file or the whole project
- **get_functions** — List functions with name, lines, params
- **get_classes** — List classes with name, lines, methods, bases
- **get_imports** — List imports with module, names, line
- **get_function_source** — Full source of a function/method
- **get_class_source** — Full source of a class
- **find_symbol** — Find where a symbol is defined (file, line, type)
- **get_dependencies** — What a symbol calls/uses
- **get_dependents** — What calls/uses a symbol
- **get_change_impact** — Direct + transitive dependents
- **get_call_chain** — Shortest dependency path (BFS)
- **get_file_dependencies** — Files imported by a given file
- **get_file_dependents** — Files that import from a given file
- **search_codebase** — Regex search across all files (max 100 results)
- **reindex** — Force full re-index (rarely needed — incremental updates happen automatically in git repos)
- **get_usage_stats** — Session efficiency stats: tool calls, characters returned vs total source, estimated token savings

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mcp-codebase-index": {
    "command": "uvx",
    "args": ["openclaw-mcp-adapter"],
    "env": {
      "PROJECT_ROOT": ""
    }
  }
}
```

**Requires environment variables:** `PROJECT_ROOT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What MikeRecognex/mcp-codebase-index does

MikeRecognex/mcp-codebase-index turns a local project into a queryable structural index for MCP clients. It can report project and file structure, locate symbol definitions, return the source for functions or classes, inspect imports, and trace relationships between symbols or files.

The index supports Python files through the Python AST. TypeScript and JavaScript, Go, Rust, and C# are parsed with regular expressions and language-specific patterns. Markdown and text files are indexed by headings, while unsupported file types receive line-count metadata.

The tool set covers project summaries, file listing, structure inspection, functions, classes, imports, symbol lookup, source retrieval, dependency and dependent analysis, call-chain discovery, regex search, file-level relationships, reindexing, and session usage statistics. Search results are limited to 100 matches.

## How it works

The server indexes the directory selected by `PROJECT_ROOT` and serves queries over MCP. In a Git repository, it checks repository changes before queries and reparses only modified files when possible. This incremental behavior also rebuilds the dependency graph after changes, including edits, branch switches, and pulls.

MikeRecognex/mcp-codebase-index stores the generated index in `.codebase-index-cache.pkl` at the project root. On startup, it can reuse the cache when the Git revision is unchanged. For a cache with 20 or fewer changed files, it loads the existing data and applies an incremental update; larger changes or a missing cache trigger a full rebuild.

## Setup and configuration

Install the MCP-enabled package with:

```bash
pip install "mcp-codebase-index[mcp]"
```

The server can run as a console command:

```bash
PROJECT_ROOT=/path/to/project mcp-codebase-index
```

It can also run as a Python module:

```bash
PROJECT_ROOT=/path/to/project python -m mcp_codebase_index.server
```

`PROJECT_ROOT` selects the directory to index and defaults to the current working directory when omitted. Claude Code can start it from a project `.mcp.json`, either through the installed command or a Python executable and module path.

Add `.codebase-index-cache.pkl` to the project’s `.gitignore`, because the cache is a local build artifact rather than source data.

## Limitations and notes

Parsing depth depends on the language. Python receives AST-based analysis, whereas TypeScript/JavaScript, Go, Rust, and C# use regular-expression parsing, so extracted structures may not have the same coverage as Python. Other file types are represented only with line counts, except Markdown and text files where headings are recognized.

The server has no runtime dependencies according to the project description, but the MCP installation extra installs the MCP server dependency. Python 3.11 or newer is required.

OpenClaw’s documented default integration may start a new process for each tool call, which loses the in-memory index and can cause repeated startup work. Automatic change checks add approximately 1–2 ms before a query in Git repositories.

MikeRecognex/mcp-codebase-index is intended for structural navigation and targeted retrieval. It does not replace direct reading of configuration, frontmatter, or other content that its indexed representations do not expose.

_Full upstream README: https://allmcps.com/mcp/mikerecognex-mcp-codebase-index/readme_

