Codemap MCP server
Commit Nov 1, 2026Enables AI agents to query codebase structure, symbols, and imports using a local SQLite index to reduce token usage and file reads.
Also known as stainless-code/codemap
- Stars
- 8
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 1, 2026
- License
- MIT
What is Codemap MCP?
Codemap enables AI agents to query codebase structure, symbols, and imports using a local SQLite index to reduce token usage and file reads.
Summary generated from the project's README
About Codemap MCP server
Navigating complex codebases by querying structural metadata instead of scanning entire file trees is what codemap enables for AI agents. It creates a local SQLite index containing symbols, imports, calls, and other structural information to help agents answer questions about where specific components or definitions reside. This approach reduces token consumption and the number of file reads required by an AI client during a session.
Developers can set this up locally using Node or Bun to index a repository. The server supports both direct SQL queries and pre-defined recipes, such as find-symbol-definitions, to simplify common tasks. While it is not a replacement for grep or ripgrep for raw text searches, users can opt-in to FTS5 for full-text search capabilities when they need to join body matches with structural data. It works through a CLI or a programmatic ESM API for integration into custom workflows.
What you can do with it
- 1Locating symbol definitionsAn AI agent can find exactly where a specific function or variable is defined using a single SQL command.
- 2Analyzing import directionsDevelopers can use the index to understand how different parts of a codebase interact through their imports.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablestainless-code/codemap is public and reachablegithub.com/stainless-code/codemap ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-01github.com/stainless-code/codemap ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubCodemap
Query your codebase. Local codebase intelligence for AI agents — a SQLite index of symbols, imports, calls, and more structural metadata so agents answer “where / what / who” with SQL and recipes instead of scanning the tree.
- Not grep by default — use ripgrep / your IDE for raw text. Opt-in FTS5 (
--with-fts/fts5: true) when body matches need to JOIN with structure. - Is a fast, token-efficient way to navigate structure.
Docs: https://stainless-code.com/codemap
What you get
Structural questions in one SQL round-trip instead of 3–5 file reads — symbol definitions, import direction, components, CSS tokens, @deprecated symbols, and more. Named patterns ship as recipes (codemap query --recipe …); full catalog and schema live in the docs.
Install
bun add @stainless-code/codemap
# or: npm install @stainless-code/codemap
Engines: Node >=22.12.0 and/or Bun >=1.0.31.
CLI
codemap # incremental index
codemap query --json --recipe find-symbol-definitions --params name=foo
codemap query --json "SELECT name, file_path FROM symbols WHERE name = 'foo'"
codemap show foo
codemap agents init --mcp # agent templates + MCP
Full command reference, recipes, MCP/HTTP, config, and the GitHub Action: docs site.
Programmatic API (ESM)
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");
API reference: https://stainless-code.com/codemap/reference/api.
Development
Contributor workflow, checks, and conventions: .github/CONTRIBUTING.md.
bun install
bun run check
Maintainer hub: docs/README.md.
License
MIT — see LICENSE.
Codemap MCP questions
How does Codemap differ from grep?
Codemap is not grep by default; you should use ripgrep or your IDE for raw text searches, whereas Codemap is designed for navigating structural metadata.
What kind of information can I query?
You can query symbol definitions, import directions, components, CSS tokens, deprecated symbols, and more via SQL.
What are the engine requirements for installation?
The tool requires Node version 22.12.0 or higher, or Bun version 1.0.31 or higher.