# codemap [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/stainless-code/codemap  
**GitHub Stars:** 8  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codemap-2

## Description
Cut AI-agent token waste ~90% — query a local SQLite structural index of your JS/TS/CSS codebase with SQL in one round-trip instead of 3–5 file reads. Symbols, imports, calls, components, CSS tokens, coverage, markers. CLI, MCP (21 tools), HTTP, GitHub Action, ESM API. 71 recipes; AST+resolver; SARIF/audit/baselines for CI.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/stainless-code/codemap), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
bun add @stainless-code/codemap
```

2. Add to your MCP client:

```sh
codemap agents init --mcp                                    # agent templates + MCP
```

## Documentation

## What codemap MCP server does

codemap builds a local structural index of a JavaScript, TypeScript, or CSS codebase. The index is stored in SQLite and represents relationships and metadata such as symbol definitions, import direction, calls, components, CSS tokens, deprecated symbols, coverage, and markers. Agents can query that index with SQL or use named recipes for common navigation tasks.

The MCP interface exposes 21 tools for agent access. The same project also provides a CLI, an HTTP interface, a GitHub Action, and an ESM API. These entry points support both interactive development and automated checks, while the MCP server focuses on making indexed codebase information available to compatible agents.

## How it works

Indexing supports incremental updates, so a local checkout can be refreshed without rebuilding all indexed content each time. Structural analysis uses AST and resolver information to connect declarations and relationships across the supported source files. Queries can be issued directly as SQL, such as selecting symbol names and file paths, or through recipes such as finding symbol definitions.

The primary search model is structural rather than raw-text matching. For ordinary text searches, use ripgrep or an IDE. When matching file bodies is necessary, FTS5 can be enabled and joined with the structural tables; the CLI uses `--with-fts`, while configuration uses `fts5: true`.

## Setup and configuration

Install the package with either Bun or npm:

```bash
bun add @stainless-code/codemap
# or
npm install @stainless-code/codemap
```

The supported runtimes are Node.js 22.12.0 or newer and Bun 1.0.31 or newer. After installation, running `codemap` performs an incremental index. The CLI can return JSON for queries and gates, and `codemap agents init --mcp` creates agent templates together with MCP setup.

The ESM API creates an index for a repository and runs queries programmatically:

```ts
import { createCodemap } from "@stainless-code/codemap";

const cm = await createCodemap({ root: "/path/to/repo" });
await cm.index({ mode: "incremental" });
const rows = cm.query("SELECT name FROM symbols LIMIT 5");
```

## Tools and capabilities

- Expose indexed codebase data through 21 MCP tools.
- Query symbols, imports, calls, components, CSS tokens, coverage, and markers.
- Run SQL against the local SQLite structural index.
- Use named recipes for recurring questions such as symbol-definition lookup.
- Produce JSON output from CLI queries and configured gate evaluations.
- Integrate indexing or checks through the HTTP interface, ESM API, or GitHub Action.
- Generate SARIF, audit results, and baselines for CI workflows.

## Limitations and notes

codemap is intended for structural navigation, not as a default replacement for grep or IDE text search. FTS5 is optional and must be enabled when body-content matches need to participate in structural queries. Its indexed language scope is JavaScript, TypeScript, and CSS. The package is distributed under the MIT license.

_Full upstream README: https://allmcps.com/mcp/codemap-2/readme_

