Codemesh logo

Codemesh

Indexes a codebase into a SQLite knowledge graph and exposes structured navigation, source, tracing, and write-back tools over MCP.

Install Codemesh

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "codemesh": {
      "command": "npx",
      "args": [
        "-y",
        "@pyalwin/codemesh"
      ],
      "env": {
        "CODEMESH_PROJECT_ROOT": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command didn't complete successfully in our automated test.

npx -y @pyalwin/codemesh

ntimes/linux-x64/native/libonnxruntime_providers_cuda.so to /tmp/allmcps-pre/node_modules/onnxruntime-node/bin/napi-v6/linux/x64/libonnxruntime_providers_cuda.so npm error Killed npm notice npm notice New major version of npm available! 10.9.9 -> 12.2.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v12.2.2 npm notice To update run: npm install -g npm@12.2.2 npm notice npm error A complete log of this run can be found in: /home/user/.npm/_logs/2026-11-06T14_49_12_988Z-debug-0.log

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The codemesh MCP server indexes a repository into a persistent SQLite knowledge graph for AI coding agents. It exposes structured tools for browsing repository structure, reading checked source, inspecting symbols, tracing calls, searching, assembling context, and saving notes or workflows. Run it after indexing a project when agents spend too much time grepping and opening unrelated files. The repository reports benchmark results from six codebases, but also documents an indexer limitation on codebases larger than 30,000 files.

Use cases

  • Index a repository before an agent investigates unfamiliar code
  • Trace calls across files without repeated broad searches
  • Retrieve exact symbol source with revision checks
  • Save repository notes and workflows for later sessions

Key features

  • SQLite-backed code knowledge graph
  • Repository map and symbol navigation
  • Revision-checked source retrieval
  • Call-chain tracing and impact exploration
  • Agent write-back for notes and workflows
  • MCP and JSON CLI modes

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.

14/14 checks healthy over the last 84d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · @pyalwin/codemesh (npm)

Adoption & maintenance

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

npm downloads199Package downloads in the last 30 days.
Last commit28d agoMost recent push to the default branch.
Install checkInconclusiveInstall command did not finish in our automated test.

How Codemesh works

What codemesh MCP server does

The codemesh MCP server turns a repository into a queryable graph of files, symbols, and relationships. Agents can navigate the graph a level at a time, select relevant branches, and then request exact source for chosen symbols instead of repeatedly searching and reading broad file ranges. The index is stored in a .codemesh/ directory within the project and uses SQLite for the default indexing and retrieval path.

The graph can also retain information learned during agent work. Notes and workflows can be written back, then retrieved later with freshness information. This makes the codemesh MCP server suitable for repeated work on the same codebase, especially when discovery is a significant part of each task.

The README reports tests on six repositories comparing MCP retrieval with baseline Grep and Read workflows. Across those historical runs, the MCP mode averaged lower cost, shorter elapsed time, and fewer agent turns. The results are benchmark observations rather than a guarantee for a particular repository; one documented Swift Compiler run did not complete indexing because of a regression affecting codebases with more than 30,000 files.

How it works

First install the package and run codemesh index from the project directory. Indexing discovers files and symbols, creates graph edges, and calculates PageRank scores. The default path does not generate embeddings and does not require a vector database. Older vector artifacts may remain on disk, but they are not used by this retrieval path.

After indexing, configure an MCP client to start the package with npx. The server reads the project location from CODEMESH_PROJECT_ROOT. Agents can begin with a map view, follow links to files or symbols, and request bounded source blocks only after selecting a target. Source responses can be revision-checked, and a supplied hash can prevent sending the same content again.

A separate CLI mode is available through Bash. It returns JSON and does not require an MCP server process, so it can be used when an agent is already able to invoke local commands. The MCP mode is presented in the README as the structured-call option, while CLI mode is presented as the lower-overhead alternative.

Setup and configuration

Install globally with:

Terminal
npm install -g @pyalwin/codemesh

Alternatively, run it without a global installation using npx -y @pyalwin/codemesh. From the repository to analyze, execute:

bash
codemesh index

Verify an installation with codemesh --version.

Tools and capabilities

The codemesh MCP server exposes these documented tool groups:

  • codemesh_map browses one repository level or follows a graph link.
  • codemesh_source returns revision-checked source for a symbol and can avoid repeat delivery with ifHash.
  • codemesh_inspect examines an exact symbol and direct calls using bounded source blocks.
  • codemesh_hydrate validates saved symbol references and reopens source after a handoff.
  • codemesh_answer optionally assembles ranked context.
  • codemesh_explore supports search, multi-target context, and impact exploration.
  • codemesh_trace follows call chains.
  • codemesh_enrich and codemesh_workflow write information back to the graph.
  • codemesh_recall retrieves notes and workflows with freshness status.
  • codemesh_status checks server health.

The command-line interface provides corresponding exploration commands for maps, source, inspection, hydration, search, context, tracing, recall, and remembering notes.

Limitations and notes

The documented benchmark figures come from six real-world repositories and use Claude Sonnet 4.6. They should not be treated as universal performance measurements. The README specifically notes that the Swift Compiler index failed to complete because of an indexer regression on a 30,000-plus-file codebase. A correctly indexed project may behave differently from that benchmark case.

The default path relies on one SQLite database rather than embeddings or a vector store. Existing vector files are not automatically removed, but they are ignored by the current default retrieval path. MCP and CLI are separate operating modes: MCP requires client configuration, while CLI mode uses local Bash commands instead.

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 Codemesh

codemesh is an MCP server that connects AI coding agents to a SQLite-backed knowledge graph of a project’s files, symbols, and relationships. Its main tools map repositories, retrieve checked source, inspect symbols, trace calls, search context, check status, and write back notes or workflows for later sessions.

Install it with `npm install -g @pyalwin/codemesh`, or run it directly with `npx -y @pyalwin/codemesh`. Then change to the project directory and run `codemesh index` before configuring an MCP client.

Add an MCP entry that starts `npx` with `-y` and `@pyalwin/codemesh`, and set `CODEMESH_PROJECT_ROOT` to the project path.

No, codemesh’s default indexing and retrieval path uses a SQLite database in `.codemesh/` and does not generate embeddings or require a vector database. Older vector artifacts can remain on disk, but this path does not use them.

Yes, codemesh provides a CLI mode that agents can invoke through Bash, and it returns JSON. This mode does not require an MCP server process and includes commands for mapping, source retrieval, inspection, search, context, tracing, recall, hydration, and saving notes.

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 PreviewCodemesh AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codemesh?style=directory)](https://allmcps.com/mcp/codemesh)
HTML Embed
<a href="https://allmcps.com/mcp/codemesh"><img src="https://allmcps.com/api/badge/codemesh?style=directory" alt="Codemesh on AllMCPs" /></a>