Cartograph

io.github.anthony-maio由 GitHub 账号 anthony-maio 发布v1.3.0更新于 Oct 29, 2026

Repo analysis for coding agents with ranked files, dependency maps, and task-scoped context.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,为编码代理提供按任务排序的仓库上下文,而不是把整个代码库塞进上下文。

可以做什么
  • 分析本地仓库或 GitHub 地址:为文件打分、梳理依赖关系,返回精简分析结果或内嵌的顶层文件内容
  • 在分析之后获取指定文件的完整内容
  • 生成带类型的任务包,包含关键文件、依赖枢纽、验证目标、风险与任务细节
  • 在提供变更文件时让缺陷修复任务包保持聚焦,优先精确验证目标与共享依赖
适用场景
适合编码代理需要快速熟悉大型或不熟悉的代码库时使用,也适合为某个缺陷修复或功能任务准备最小且匹配的文件集合,而无需为静态分析消耗模型调用。
运行要求
以本地 stdio 进程运行,来自 npm 包 @anthony-maio/cartograph,需要 Node.js 和已安装的命令行工具。静态分析无需 API 密钥;可选的模型驱动上下文模式需要配置提供商(gemini、openai、openrouter、ollama),并通过 --key 或 CARTOGRAPH_API_KEY 提供密钥,Ollama 除外。仅支持桌面端。
安装前请注意
分析默认会把运行清单和产物写入本地缓存目录。静态匹配可能漏掉相关代码,编辑前应核对返回的源码。非静态上下文模式会把仓库内容发送给所选模型提供商,并需要 API 密钥。主机安装器会修改用户目录下的主机配置文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cartograph,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Cartograph

Cartograph provides task-focused repository context for coding agents. It ships a CLI, an MCP server, install adapters for Claude Code, OpenClaw, and Hermes, and agent assets for documentation workflows.

Instead of dumping an entire repository into context, Cartograph ranks the files that matter, maps dependencies, caches structured artifacts, and lets the next tool or agent pick up from those artifacts.

The primary workflow is:

  1. analyze to map the repo
  2. packet to prepare the work
  3. context --static to load task-matched files without a model call

wiki, host installs, and benchmarks are secondary surfaces built around that core path.

Install

bash
npm installnpm run build

For global use from npm:

bash
npm install -g @anthony-maio/cartograph

For MCP host discovery via the official registry:

For Claude Code plugin install from this public repo:

text
/plugin marketplace add anthony-maio/cartograph/plugin install cartograph@making-minds-tools

For global use from a local checkout:

bash
npm install -g .

See CONTRIBUTING.md for the development workflow and SECURITY.md for vulnerability reporting.

Run a complete example

The npm package includes a small refresh-token example. From a new working directory:

sh
npm init -ynpm install @anthony-maio/[email protected]npx cartograph analyze ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --staticnpx cartograph packet ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --type bug-fix --task "fix refresh token expiry"npx cartograph context ./node_modules/@anthony-maio/cartograph/examples/auth-refresh --task "fix refresh token expiry" --static --jsonnode --test ./node_modules/@anthony-maio/cartograph/examples/auth-refresh/tests/auth-refresh.test.js

The packet should point to src/auth/refresh.js and tests/auth-refresh.test.js. The context bundle includes the clock helper and leaves unrelated billing/catalog files out. The three behavioral checks should pass. Walk through the investigation for expected results and how to apply the same process to your repository.

Hermes plugin

The native Hermes plugin exposes cartograph_analyze for repository orientation and cartograph_context for task-focused source excerpts. Both run locally in static mode without a model API call. Install the npm package and its included adapter:

sh
npm install -g @anthony-maio/[email protected]cartograph install hermeshermes plugins enable cartographcartograph doctor hermes

Run these commands in the same OS environment as Hermes. For Hermes in WSL, use WSL Node and repository paths such as /mnt/d/Development/cartograph. Restart an existing Hermes session to load the tools. The installer binds the plugin to the installed CLI; rerun the install command after moving the package or changing Node.

See the Hermes setup and real-repository example for profile settings, verification, and removal. The plugin caches source excerpts under the selected Hermes profile and supports an optional repository allowlist. Static matching can miss relevant code, so check the returned source before editing.

For a Hermes-managed plugin checkout, see the standalone plugin guide and the commit-pinned installation option.

Claude Code Plugin

This repo also acts as a Claude Code plugin marketplace. The cartograph plugin bundles:

  • a plugin-scoped Cartograph MCP server
  • slash commands: /cartograph:analyze, /cartograph:context, /cartograph:wiki
  • the use-cartograph and repo-surveyor skills
  • the documentation-agent bundle: repo-scout, dependency-tracer, context-picker, api-surface-writer, and wiki-writer

Install it with:

text
/plugin marketplace add anthony-maio/cartograph/plugin install cartograph@making-minds-tools

Primary Workflow

If you only remember one thing, remember this:

bash
cartograph analyze <repo> --staticcartograph packet <repo> --type <type> --task "<task>"cartograph context <repo> --task "<task>" --static --json
  • analyze maps the repo and tells you what matters.
  • packet turns a concrete job into a reusable working artifact.
  • context --static selects task-matched files and their nearby dependencies and tests, with their contents. It uses local heuristics and needs no API key.

The separate model-backed context workflow runs when you omit --static; configure a provider before using it. Neither mode proves that a selected file contains the bug.

Command Surface

bash
cartograph analyze <repo> [options]cartograph packet <repo> --type <type> --task "<task>" [--changed <paths...>]cartograph context <repo> --task "<task>" [options]cartograph wiki <repo> [options]cartograph export <run-id> --to <path> [--artifact <name>]cartograph install <claude|openclaw|mcp|hermes>cartograph uninstall <claude|openclaw|mcp|hermes>cartograph doctor [target] [--json]cartograph mcp

Legacy compatibility still works:

bash
cartograph <repo> --staticcartograph <repo> -c "trace auth flow"

CLI Usage

bash
# Map the repocartograph analyze ./my-project --static
# Prepare a concrete jobcartograph packet ./my-project --type bug-fix --task "fix auth refresh bug" --changed src/auth/service.ts tests/auth/service.test.ts
# Load the minimum file set for that jobcartograph context ./my-project --task "add user authentication" --static --json
# Force embedded snippets when you really want themcartograph analyze ./my-project --static --json --include-contents
# Full wiki outputcartograph wiki ./my-project -p gemini -k $CARTOGRAPH_API_KEY -o wiki.md
# Export a cached artifact to an explicit pathcartograph export run-abc123 --to ./artifacts/wiki.md
# Run the MCP server directlycartograph mcp

For small repos, analyze --static --json now defaults to compact output instead of embedding top-file contents. That keeps tiny repos readable and lets direct file reads stay cheaper than a giant JSON blob. Use --include-contents when you explicitly want embedded snippets.

The default markdown output from analyze --static is human-first: it highlights what matters, surfaces dependency hubs, and recommends the next commands instead of dumping raw file contents immediately.

Providers

  • gemini
  • openai
  • openrouter
  • ollama

Set the API key with --key or CARTOGRAPH_API_KEY. Ollama does not require a key.

Cache Model

Cartograph writes successful runs into the user cache by default:

  • Windows: %USERPROFILE%\\.cartograph\\cache
  • POSIX: ~/.cartograph/cache

Each run gets a manifest plus named artifacts, which keeps agent handoffs lightweight and makes cartograph export deterministic.

Host Installs

Installing the package does not modify host configuration. Use the host-specific installer to copy its assets, then enable the integration in that host.

bash
cartograph install claudecartograph install openclawcartograph install mcpcartograph install hermes

What each target installs:

  • claude: user-scope skills plus the bundled documentation agents under ~/.claude
  • openclaw: user-scope skill pack under ~/.openclaw
  • mcp: a Cartograph MCP config snippet under ~/.cartograph/mcp
  • hermes: a native tool plugin and local runtime binding under the selected Hermes profile; enable it with hermes plugins enable cartograph

Check status at any time:

bash
cartograph doctorcartograph doctor --json

Choose Your Surface

  • CLI: best default path when you want deterministic local analysis and explicit artifacts.
  • Claude Code plugin: best when you want plugin install, bundled skills, slash commands, and a plugin-scoped MCP server.
  • OpenClaw skills: best when you want the same Cartograph workflow inside an OpenClaw skill-first environment.
  • Hermes plugin: native repository orientation and source-context tools backed by the local CLI.
  • MCP Registry: best when your host already prefers tool wiring over shell commands.

MCP Server

Cartograph's MCP server exposes static repo analysis directly to hosts that prefer MCP over shell commands.

Tools:

  • analyze_repo: score files, map dependencies, and return compact analysis output or embedded top-file contents for a local repo or GitHub URL
  • get_file_contents: fetch full contents for specific files after analysis
  • build_task_packet: return a typed task packet with key files, dependency hubs, validation targets, risks, and task-specific details

Bug-fix packets are tuned to stay focused when you provide --changed or changed_files: they keep explicit change surfaces in view, prefer exact validation targets, and bias toward shared dependencies over peripheral utility scripts.

If you want Cartograph's packaged MCP snippet, run:

bash
cartograph install mcp

That writes a reusable config file that points at:

json
{  "mcpServers": {    "cartograph": {      "command": "cartograph",      "args": ["mcp"]    }  }}

MCP Registry

Cartograph is published in the official MCP Registry with the server name io.github.anthony-maio/cartograph.

Repo-side metadata lives in:

The current install artifact published to npm is:

  • @anthony-maio/cartograph

For repeatable registry releases, this repo also includes a GitHub Actions workflow at publish-mcp.yml. It is set up for npm trusted publishing on GitHub Actions, then authenticates to the MCP Registry with GitHub OIDC and publishes server.json.

Packaged Agent Assets

The package currently ships:

  • two Claude skills: use-cartograph and repo-surveyor
  • five Claude documentation agents: repo-scout, dependency-tracer, context-picker, api-surface-writer, and wiki-writer
  • two OpenClaw skills: use-cartograph and repo-surveyor
  • bundled OpenProse templates inside both OpenClaw skills for repo-doc and task-context workflows

Skill roles:

  • use-cartograph: tool-first path when the CLI or MCP server is available
  • repo-surveyor: manual fallback path when Cartograph is unavailable or needs verification

Both skills are designed to produce the same downstream contract:

  • key files
  • dependency hubs
  • minimal task context
  • doc-ready summary

These assets are meant to pass run IDs and artifact paths between steps instead of copying large prose into the main context.

The Claude plugin marketplace in this repo ships the same skills and agents, plus plugin-first slash commands and a bundled Cartograph MCP server.

Task Packet Benchmark

This repo includes a public benchmark pack for task packets under benchmarks/task-packets.

Use it to compare packet quality across large visible repos with a stable set of task prompts:

bash
npm run benchmark:task-packets -- --listnpm run benchmark:task-packets -- --case llama-cpp-bug-fix --dry-run

The benchmark runner writes packet artifacts to benchmarks/task-packets/output/, which is gitignored.

Curated scorecards and public artifact links are also published on the site:

Example Artifacts

Tracked examples live under docs/examples:

These are useful when you want to show what a focused bug-fix packet and a curated repo brief look like on a large public codebase.

Development

bash
npm installnpm testnpm run checknpm run buildnpm run pack:smoke

License

MIT

来源:README.md,提交 e2e06db

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v1.3.0最新Oct 29, 2026
  2. v1.2.0Oct 2, 2026
  3. v1.1.4Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分