Context7
Up-to-date docs for AI agents
作者による説明(英語の原文)
Intelligent code knowledge graph for AI coding agents — 71% cheaper, 72% faster
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
CODEMESH_PROJECT_ROOT必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"codemesh": {
"command": "npx",
"args": [
"-y",
"@pyalwin/codemesh"
],
"env": {
"CODEMESH_PROJECT_ROOT": "your-value"
}
}
}
}ターミナルでこれを実行します
claude mcp add codemesh --env CODEMESH_PROJECT_ROOT=your-value -- npx -y @pyalwin/codemesh動かす前に、空欄の値を入力してください。
プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"codemesh": {
"command": "npx",
"args": [
"-y",
"@pyalwin/codemesh"
],
"env": {
"CODEMESH_PROJECT_ROOT": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"codemesh": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@pyalwin/codemesh"
],
"env": {
"CODEMESH_PROJECT_ROOT": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
CODEMESH_PROJECT_ROOT envこの設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月6日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント pyalwin で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(0.1.2)がレジストリに届いたのは7 か月前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。
同じカテゴリには:Context7, Codebase Memory, Exa
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
Intelligent code knowledge graph for AI coding agents
71% cheaper, 72% faster, 82% fewer tool calls vs baseline Grep+Read\ on 6 real-world repos (Sonnet 4.6) — from a single codemesh index.
Benchmarks · Quick Start · Integrations · Write-Back · How It Works · API Reference · Full Results
AI coding agents waste 40-80% of their tokens on discovery — grepping through files, reading irrelevant code, and rebuilding context they've already seen in previous sessions.
On a 600-file codebase, a typical exploration task involves 10+ file reads before the agent even knows what's relevant.
Before: Agent → Grep → 50 matches → Read 10 files → Understand → Work
After: Agent → codemesh_map → expand chosen branches → read exact symbols → Work
Codemesh is an MCP server that gives agents a persistent, queryable knowledge graph. The graph gets smarter over time: agents write back what they learn, so the next session starts informed.
Benchmarked on 6 real-world codebases (Alamofire, Excalidraw, VS Code, Swift Compiler, pydantic-validators, pydantic-basemodel) with Claude Sonnet 4.6, compared alongside baseline and graph-based approaches for context.
Full methodology, per-repo breakdowns, and pairwise comparisons: docs/benchmark-results.md | Early pydantic evals
These historical runs used the earlier answer-first workflow. The map-first navigation workflow described below is evaluated in an exploratory Pydantic pilot; the figures in this section should not be read as its measured performance.
| Mode | Alamofire | Excalidraw | VS Code | Swift Compiler[^swift] | pydantic-validators | pydantic-basemodel | Avg |
|---|---|---|---|---|---|---|---|
| Baseline | $0.54 | $0.89 | $0.21 | $0.83 | $1.32 | $0.78 | $0.76 |
| Codemesh MCP | $0.25 | $0.21 | $0.16 | $0.23 | $0.33 | $0.13 | $0.22 |
| Codemesh CLI | $0.67 | $0.51 | $0.16 | $0.83 | $1.00 | $0.18 | $0.56 |
| Codegraph | $0.37 | $0.56 | $0.57 | $0.74 | $0.29 | $0.19 | $0.45 |
| Mode | Alamofire | Excalidraw | VS Code | Swift[^swift] | pydantic-v | pydantic-b | Avg |
|---|---|---|---|---|---|---|---|
| Baseline | 180s | 191s | 87s | 199s | 352s | 232s | 207s |
| Codemesh MCP | 78s | 45s | 35s | 87s | 72s | 32s | 58s |
| Codemesh CLI | 226s | 177s | 62s | 227s | 235s | 51s | 163s |
| Codegraph | 134s | 180s | 192s | 199s | 75s | 60s | 140s |
| Mode | Alamofire | Excalidraw | VS Code | Swift[^swift] | pydantic-v | pydantic-b | Avg |
|---|---|---|---|---|---|---|---|
| Baseline | 31 | 48 | 12 | 29 | 84 | 65 | 45 |
| Codemesh MCP | 9 | 5 | 3 | 14 | 14 | 3 | 8 |
| Codemesh CLI | 30 | 32 | 12 | 56 | 64 | 9 | 34 |
| Codegraph | 31 | 35 | 44 | 44 | 20 | 12 | 31 |
| Mode | Alamofire[^alamo] | Excalidraw | VS Code | Swift Compiler | pydantic-validators | pydantic-basemodel | Avg |
|---|---|---|---|---|---|---|---|
| Baseline | n/a | 9 | 8 | 7 | 2 | 9 | 7.0 |
| Codemesh MCP | 9 | 9 | 7 | 8 | 7 | 7.8 | 7.9 |
| Codemesh CLI | 9 | 7 | 7 | 9 | 1 | 8.4 | 6.9 |
| Codegraph | 8 | 9 | 8.7 | 8 | 8 | 9 | 8.4 |
| Repo | Baseline | Codemesh MCP | Cost saved | Time saved |
|---|---|---|---|---|
| Alamofire | $0.54 | $0.25 | −54% | −57% (180s → 78s) |
| Excalidraw | $0.89 | $0.21 | −76% | −76% (191s → 45s) |
| VS Code | $0.21 | $0.16 | −24% | −60% (87s → 35s) |
| Swift Compiler[^swift] | $0.83 | $0.23 | −72% | −56% (199s → 87s) |
| pydantic-validators | $1.32 | $0.33 | −75% | −79% (352s → 72s) |
| pydantic-basemodel | $0.78 | $0.13 | −83% | −86% (232s → 32s) |
| Average | $0.76 | $0.22 | −71% | −72% |
[!NOTE]
Codemesh MCP achieves the lowest cost and fastest time of any mode tested — 71% cheaper and 72% faster than baseline on average across 6 repos, using 82% fewer tool calls (8 vs 45). Quality is comparable to baseline (7.9 vs 7.0); Codegraph edges Codemesh on quality (8.4) but at roughly double the cost ($0.45 vs $0.22). Every repo shows cost and time savings — including the comprehension-heavy queries (Excalidraw, pydantic-basemodel) that regressed in prior builds of codemesh.
npm install -g @pyalwin/codemesh
Or run directly without installing:
npx -y @pyalwin/codemesh --help
Build from source
git clone https://github.com/pyalwin/codemesh.git
cd codemesh npm install && npm run build npm link
Verify the install:
codemesh --versionshould print the package version.
cd /your/project
codemesh index
The default index and retrieval path uses one SQLite database in .codemesh/. It does not generate embeddings or require a vector database. Existing vector artifacts from older runs are left untouched but are not used by this path.
Indexed 656 files
Symbols found: 16733 Edges created: 33266 Duration: 10009ms PageRank: 13843 nodes scored
Codemesh offers two ways to integrate with AI agents:
Option A: MCP Server (structured tool calls)
Add to your Claude Code MCP config (~/.claude/mcp-servers.json or project .mcp.json):
{
"mcpServers": { "codemesh": { "command": "npx", "args": ["-y", "@pyalwin/codemesh"], "env": { "CODEMESH_PROJECT_ROOT": "/path/to/your/project" } } } }
The agent gets native MCP tools:
codemesh_map — browse one level of the indexed repository or follow a linkcodemesh_source — read a revision-checked source view by symbol ID; ifHash avoids repeat deliverycodemesh_inspect — inspect an exact symbol and its direct calls with bounded, exact source blockscodemesh_hydrate — verify saved symbol references and reopen exact source after a handoffcodemesh_answer — optional ranked context assemblycodemesh_explore — search, context (multi-target), impactcodemesh_trace — follow call chainscodemesh_enrich / codemesh_workflow — write backcodemesh_recall — retrieve notes and workflows with freshness statuscodemesh_status — health checkBest for: Opus, structured workflows, enrichment/write-back
Option B: CLI Mode (via Bash — zero MCP overhead)
No MCP config needed. The agent calls codemesh directly via Bash:
export CODEMESH_PROJECT_ROOT=/path/to/your/project
codemesh explore map codemesh explore map --node 'dir:src' codemesh explore map --node 'file:src/server.ts' codemesh explore source 'symbol:src/server.ts:createServer' codemesh explore source 'symbol:src/server.ts:createServer' --mode preview codemesh explore inspect 'symbol:src/server.ts:createServer' --depth 1 --max-symbols 4 --compact codemesh explore hydrate --references '[{"id":"symbol:src/server.ts:createServer","bodyHash":"HASH"}]' --compact
codemesh explore search "request flow" codemesh explore context Source/Core/Session.swift Source/Core/Request.swift codemesh explore trace Session.request --depth 5 codemesh explore recall --path src/server.ts codemesh remember --path src/server.ts --summary "Server tool registration" --session my-task
Exploration and write commands return JSON to stdout. No MCP server process is required.
Best for: Sonnet/Haiku, speed-sensitive workflows, simpler setup
| MCP Server | CLI Mode | |
|---|---|---|
| Setup | MCP config file | Just export CODEMESH_PROJECT_ROOT |
| Invocation | Persistent MCP process | CLI subprocess |
| Enrichment | Native codemesh_enrich tool | codemesh remember ... |
| Retrieval | Shared SQLite-backed handlers | Same handlers and JSON data |
| Recommended | Hosts with reliable MCP tool use | Deterministic shell workflows |
The agent can choose a path through the persistent graph before reading code:
You: "Find how pydantic handles validation"
Agent calls: codemesh_map({}) gets: immediate repository directories and files, each with an ID
Agent calls: codemesh_map({ node: "dir:pydantic" }) gets: immediate files and subdirectories
Agent calls: codemesh_map({ node: "file:pydantic/main.py" }) gets: top-level symbols, including BaseModel
Agent calls: codemesh_map({ node: "symbol:pydantic/main.py:BaseModel" }) gets: methods, including model_validate
Agent calls: codemesh_source({ id: "symbol:pydantic/main.py:BaseModel.model_validate" }) reads: only the selected symbol's source
Agent calls: codemesh_enrich({ path: "pydantic/functional_validators.py", summary: "Primary V2 validator API..." }) saves: summary for next session
Codemesh speaks the Model Context Protocol, so any MCP-compatible client can use it. Paste one of the snippets below, restart the client, and the codemesh_* tools show up in the agent's toolbox.
Claude Code (CLI)
Add to ~/.claude/mcp-servers.json (user-wide) or .mcp.json (project-local):
{
"mcpServers": { "codemesh": { "command": "npx", "args": ["-y", "@pyalwin/codemesh"], "env": { "CODEMESH_PROJECT_ROOT": "/absolute/path/to/your/project" } } } }
Claude Desktop (macOS / Windows app)
Edit claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": { "codemesh": { "command": "npx", "args": ["-y", "@pyalwin/codemesh"], "env": { "CODEMESH_PROJECT_ROOT": "/absolute/path/to/your/project" } } } }
Restart Claude Desktop. Codemesh's tools will appear in the tool picker (hammer icon).
Cursor — stop the agent from wandering your codebase
Cursor reads .cursor/mcp.json per project (or ~/.cursor/mcp.json for all projects):
{
"mcpServers": { "codemesh": { "command": "npx", "args": ["-y", "@pyalwin/codemesh"], "env": { "CODEMESH_PROJECT_ROOT": "${workspaceFolder}" } } } }
Open Settings → MCP
冒頭だけを表示しています。続きはリポジトリで読めます