Codemap logo

Codemap

Indexes JavaScript, TypeScript, and CSS structure in SQLite for SQL and recipe-based codebase queries.

Install Codemap

Run the project’s own setup commands, in order.

Setup steps from the project

codemap installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    bun add @stainless-code/codemap
    
  2. 2. Add to your MCP client
    codemap agents init --mcp                                    # agent templates + MCP
    

Overview

The codemap MCP server indexes local JavaScript, TypeScript, and CSS code into SQLite, exposing structural metadata for agent queries. Its MCP interface provides 21 tools, while SQL and named recipes answer questions about symbols, imports, calls, components, CSS tokens, coverage, and markers in one round-trip. Reach for codemap when agents need code navigation without repeatedly reading files; use ripgrep or an IDE for ordinary text search, or enable FTS5 when body matches must be combined with structure.

Use cases

  • Find symbol definitions and their file paths
  • Trace imports and calls across a codebase
  • Inspect components and CSS tokens
  • Run structural checks in CI
  • Combine body matches with indexed structure using FTS5

Key features

  • Local SQLite structural index
  • 21 MCP tools
  • SQL queries and named recipes
  • Incremental AST and resolver indexing
  • Optional FTS5 body search
  • CLI, HTTP, ESM API, and GitHub Action

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars8Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.

How Codemap works

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:

Dockerfile
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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Codemap

codemap is an MCP server that connects AI agents to a local SQLite index of JavaScript, TypeScript, and CSS codebases. Its main tools expose SQL and recipe-based queries for symbols, imports, calls, components, CSS tokens, coverage, markers, and related structural metadata without repeated file reads.

Install it with `bun add @stainless-code/codemap` or `npm install @stainless-code/codemap`. It requires Node.js 22.12.0 or newer and/or Bun 1.0.31 or newer. The CLI command `codemap agents init --mcp` can create agent templates and MCP setup.

Yes, but body search is opt-in through FTS5. Enable it with the CLI's `--with-fts` option or the `fts5: true` configuration setting, then join content matches with structural data. For ordinary raw-text searches, use ripgrep or an IDE.

Use its ESM API by calling `createCodemap` with a repository root, indexing with incremental mode, and passing SQL to `cm.query`. The package also supports direct CLI SQL queries and named recipes for common structural questions.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodemap AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codemap-2?style=directory)](https://allmcps.com/mcp/codemap-2)
HTML Embed
<a href="https://allmcps.com/mcp/codemap-2"><img src="https://allmcps.com/api/badge/codemap-2?style=directory" alt="Codemap on AllMCPs" /></a>