roam-code MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
roam-code MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
roam-code MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/Cranot/roam-code
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"roam-code-mcp--": {
"command": "npx",
"args": ["-y", "roam-code"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 roam-code MCP工具 执行以下任务... Claude: [自动调用 roam-code MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"roam-code_mcp__": {
"command": "npx",
"args": ["-y", "roam-code"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
v14.0.4 (2026-09-05) — the proof schema now travels with your installation. The JSON Schema used to check proof-bundle structure is included in both package formats, not just the source checkout. Installed-package tests now exercise its public loader, and a new packaging guard catches undeclared data files. Full notes: CHANGELOG.md.
v14.0.3 (2026-09-05) — clearer guidance and more trustworthy check results. Saved proof files keep their review results when read back. Malformed evidence and failed collection cannot turn into a passing result. Benchmark reports keep missing measurements unknown and count failed attempts. The README and verification guide now explain how to get useful answers—and where tests and human review still matter. Full notes: CHANGELOG.md.
v14.0.2 (2026-09-05) — controlled cold starts and more precise loop advice. Keep index control files with a redirected database, opt out of implicit indexing, and receive parseable JSON even on cold starts. Workspace import checks recognize shared development tools without hiding undeclared sibling dependencies. Loop advice accounts for collection mutation, positional lookups, clocks and randomness; complexity-hint matching avoids unrelated AST work. The pinned wheel build tool also receives its path-traversal fix. Full notes: CHANGELOG.md.
v14.0.1 (2026-09-05) — more precise findings and clearer verification. Browser and TypeScript checks distinguish lifecycle calls from database operations, resolve NodeNext source extensions, and show stronger evidence for algorithm advice. Incomplete searches require review instead of authorizing deletion. MCP compatibility is tested against the supported SDK generation, retrieval benchmarks name their dependency profiles, and release checks enforce their stated worker budget. Official container publication remains on hold pending image-wide security review. Full notes: CHANGELOG.md.
<details> <summary><strong>Earlier release notes — v13.10</strong></summary>
v13.10 (2026-07-28) — repeated work becomes measurable procedures, and post-edit verification becomes proof-complete. Privacy-preserving transcript/shell-template mining can nominate repeated-work interventions without exposing raw prompts or claiming causal savings; roam savings promotes only prospectively joined, integrity-checked outcomes. The Claude adapter now binds every edited turn to a strict Verify receipt and blocks unavailable, malformed, incomplete, or failing evidence. Interrupted indexes carry a generation-bound, durably synced lifecycle marker and force a full non-light rebuild before analysis regardless of the direct caller; completion is published only after SQLite checkpoint/fsync, so a crash cannot turn partial graph state into plausible empty answers. Roam owns the canonical hooks end to end—Compile Code no longer rewrites installed source. Full notes: CHANGELOG.md.
</details>
<details> <summary><strong>Earlier release notes — v13.6 → v13.0</strong></summary>
v13.6 (2026-06-11) — The verify loop grows teeth + compiler injection economics. The post-edit loop now runs a secrets leak gate by default (credential shapes + an optional repo-local .roam-leak-patterns.py catalogue) and an advisory algorithm/idiom sweep scoped to the diff; suppressions are symbol-keyed (refactor-proof) and the suppression file is append-only after a confirmed data-loss fix; the naming rule samples production code only (~2000 false positives removed on a test-heavy codebase) and verify --auto is 16× faster on sweeping diffs. The compiler learns injection economics — generation-shaped prompts get no envelope (measured pure overhead) — plus graph-ranked retrieval (PageRank + file-role + path-token blend), new answer probes (taint scan, world-model idempotency/side-effects, design patterns, scoped algo findings, and verify findings riding into envelopes as known_findings), and routing waves for trace/entry-point phrasings. New offline lock suites (procedure-registry lint, suppression fuzz corpus, self-dogfood FP lock, envelope byte budgets, L1-rate floor) and a prepush_check.py --release gate that proves the full CI surface green before any release push. Full diff in CHANGELOG.md.
v13.5 (2026-06-10) — Compiler coverage waves + the Claude Code adapter. Eight new compile intent procedures land from production-telemetry mining (file_history "what changed in X last week", repo_structure layers/clusters/health, entry_point_where with the authoritative [project.scripts] answer, config_where env-var lookup, module-name describe_file recall, session_meta, a zero-probe fast-path for self-contained batch prompts, and a bug_site_slice that embeds the source around "fix the bug in cli.py:45"); roam hooks claude --write wires the full compile-before/verify-after loop into Claude Code in one command (fail-open, idempotent, --no-verify / --uninstall); two reliability fixes seal a CliRunner stdout-swap race in the in-process probe pool and add a compiler fingerprint to all three compile cache keys; envelope-diff regression rules stop false-flagging budget bookkeeping keys. Compiler A/B on Claude (Fable 5): −83% turns / −80% input tokens / −63% cost on nav-comprehension (41 cells). Full diff in CHANGELOG.md.
v13.4 (released 2026-05-21) — Perf wave + Pattern-1 stabilisation + assurance hardening. Major detector speed-ups (clones 43.8s → 13.1s, intent 66s → 12s, doc-staleness 93s → 19s, sbom 30s → 9s — all byte-identical output), 17 commands now emit isError/status on error envelopes + 11 commands route their argless --json path through a proper envelope (Pattern-1C drift-guards added), a persisted per-snapshot spectral gap powering a real roam forecast failure budget, MCP prompt-injection marker scan on tool-call egress, release supply-chain hardening (PEP 740 attestations, tag-bound artifacts), and large false-positive cuts in feature-envy / shotgun-surgery / god-components. Full diff in CHANGELOG.md.
docker build -t roam-code . docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD:/workspace" roam-code index docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD:/workspace" roam-code health ```
Works on Linux, macOS, and Windows. Windows: if roam is not found after installing with uv, run uv tool update-shell and restart your terminal.
</details>
---
<a id="the-compiler--your-agents-first-token-already-knows-the-answer"></a>
Install Roam in a Git repository your agent works on. The commands below are also a quick way to inspect what the agent will get; for ongoing use, follow the agent setup guide and include checks before and after edits in its instructions.
pip install "roam-code[mcp]" # 1. install the CLI and optional agent-tool server
cd /path/to/your/repo
roam init # 2. build the local index and project configuration
roam health # 3. see a summary of code structure and findings
roam preflight <symbol> # 4. check a function or class before changing it
Python 3.10+. pipx install roam-code and uv tool install roam-code work too. Drop [mcp] for CLI-only. See docs/fresh-install-smoke.md for a verbatim transcript of these four commands against a clean venv.
Replace <symbol> with a function or class from your project. To find one, run roam search <name>. The first index takes longer than later refreshes; timing depends on repository size and your machine. Use roam index instead of init if you only want the index, without creating project configuration.
Here is a recorded example from Roam's own codebase. open_db is used widely, so the report calls out the size of the change before you make it. The counts below are a snapshot, not live measurements of your checkout:
$ roam preflight open_db
VERDICT: Significant risk — CRITICAL, 17922 symbols in blast radius
Pre-flight check for `open_db (src/roam/db/connection.py:1076)`:
Blast radius: 17922 symbols in 1732 files [CRITICAL]
Affected tests: 681 direct, 14126 transitive [OK]
Complexity: cc=5, nest=2 [LOW]
Coupling: 2 files often change together [MEDIUM]
Conventions: no violations [OK]
Fitness: target passes; 1 rule(s) fail on sibling symbols [OK]
Overall risk: CRITICAL
Risk driver: blast radius (17922 symbols in 1732 files, CRITICAL)
“Blast radius” means code that could be affected through the indexed connections; it does not mean all of those functions will break.
<details> <summary><strong>Alternate install methods + Docker</strong></summary>
```bash pipx install roam-code # isolated environment (recommended) uv tool install roam-code # uv-managed tool pip install git+https://github.com/Cranot/roam-code.git # from source
The CLI is Apache 2.0, uses a local zero-API-key analysis engine, and never expires. Three optional paid layers build on the same engine:
roam pr-analyze. CodeRabbit/Greptile review PR semantics; Roam Review reads the graph (who calls the changed symbol, which layer it sits in) and emits a portable ChangeEvidence packet. The CLI engine is a working CI gate today: git diff main..HEAD | roam pr-analyze --gate (exit 5 on BLOCK).roam metrics-push sends a summary-only payload (numerical metrics, paths or SHA-256 hashes, identifier names) — never source-code bodies. Inspect the exact payload with --dry-run.roam pr-replay --tier sample.Early access — email hello@roam-code.com. Full pricing at <https://roam-code.com/pricing>.
Roam is designed to be called by coding agents. Instead of repeatedly grepping and reading files, the agent runs one roam command and gets a verdict-first envelope. roam preflight (above) replaces grep+read+test-impact+complexity+fitness in one ~3KB call; roam health rolls the whole codebase into one score:
$ roam health
VERDICT: Fair codebase (77/100) — 65 critical, 0 warnings, focus: god_components
Health Score: 77/100 | Tangle: 0.0% (0/44056 symbols in cycles)
Propagation Cost: 6.0% | Algebraic Connectivity: 0.0146
Health: 65 issues — 65 CRITICAL, 37 INFO
(0 actionable cycles, 37 local/test cycles ignored, 50 god components
(19 actionable, 31 expected utilities), 15 bottlenecks (2 actionable))
Breakdown: cycles [0 issues], god [50 CRITICAL], bottlenecks [15 CRITICAL], layers [0 issues]
Top CRITICAL issues (run `roam --detail health` for the full breakdown):
god component: result (prop, degree=2198)
god component: path (prop, degree=677)
The verdict line works alone — an agent that reads nothing else still knows where to look. Pipe --json for the structured envelope your agent consumes.
Fastest setup (Claude Code): wire the compile/verify loop in one command — no config files, no MCP setup, no rules to write:
roam hooks claude --write # compile-before + verify-after hooks; --uninstall to undo
For other agents (or alongside the hooks), point them at Roam via instructions in their config file:
roam describe --write # auto-detects CLAUDE.md, AGENTS.md, .cursor/rules, etc.
roam describe --agent-prompt # compact ~500-token prompt — copy-paste into an existing config
roam minimap --update # inject/refresh an annotated codebase minimap (won't touch other content)
This teaches the agent which command fits each situation: roam preflight before changes, roam context for files to read, roam diagnose for debugging.
<details> <summary><strong>Where to put agent instructions for each tool</strong></summary>
| Tool | Config file |
|---|---|
| **Claude Code** | CLAUDE.md in your project root |
| **OpenAI Codex CLI** | AGENTS.md in your project root |
| **Gemini CLI** | GEMINI.md in your project root |
| **Cursor** | .cursor/rules/roam.mdc (add alwaysApply: true frontmatter) |
| **Windsurf** | .windsurf/rules/roam.md (add trigger: always_on frontmatter) |
| **GitHub Copilot** | .github/copilot-instructions.md |
| **Aider** | CONVENTIONS.md |
| **Continue.dev** | config.yaml rules |
| **Cline** | .clinerules/ directory |
</details>
All you need is Python 3.10+ and pip install roam-code.
```yaml
name: Roam Analysis on: [pull_request]
jobs: roam: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 persist-credentials: false # For production, replace the tag with the reviewed 40-character SHA it # points at — a release tag is readable but remains movable. - uses: Cranot/roam-code@v14.0.4 with: version: '14.0.4' commands: health gate: "score>=70" sarif: 'true' comment: 'true'
Generate this workflow explicitly with `roam init --with-ci=github` or
`roam ci-setup --platform github --write`; plain `roam init` does not modify CI configuration.
The Action accepts `commands`, `gate` (quality-gate expression, exit 5 on
failure), `sarif` (upload to GitHub Code Scanning), `comment` (sticky PR
comment), `cache`, and `changed-only` (incremental mode).
**SARIF output.** 39 commands honour the global `--sarif` flag (health, complexity, dead, smells, clones, vulns, taint, secrets, n1, …). Minimal upload:
yaml - run: roam --sarif health > roam-health.sarif - uses: github/codeql-action/upload-sarif@03e4368ac7daa2bd82b3e85262f3bf87ee112f57 # v3.36.0 with: sarif_file: roam-health.sarif ```
For GitLab / Jenkins / Azure / Bitbucket templates, severity gates, and upload guardrails, see docs/ci-integration.md.
Roam's surfaces differ in how rigorously they've been validated — know which is which before you gate on them:
roam retrieve --repair-intent <patch>) — the one surface with a preregistered, held-out, stranger-repo result. Give it the diff of a fix you just made and it reranks toward the other files that need the same repair, rather than the files that merely look similar. Measured on 576 real multi-site fixes from 12 third-party repos (rich, aiohttp, httpx, fastapi, click, flask, jinja, werkzeug, pydantic, pytest, attrs, urllib3), frozen before scoring and shipped in-repo:| vs plain lexical search | delta | 95% CI (bootstrap, n=2000) | |---|---|---| | nDCG@10 | +0.064 (0.605 vs 0.541) | [+0.032, +0.097] | | P@3 | +0.041 | [+0.024, +0.058] | | MRR | +0.059 | [+0.026, +0.092] | | recall@10 | +0.034 | [−0.002, +0.070] — not significant |
That clears the preregistered bar (nDCG@10 ≥ +0.05 with a CI excluding zero) and it survived an adversarial falsifier. Read it for what it is: a real but modest improvement over lexical search on this task — not a step change. The one striking result underneath: our graph-sibling candidate pool on its own scores 0.258, far worse than lexical's 0.541. It only beats lexical once repair-intent reranking is applied. The reranking is not polish on a good pool — it is the reason the pool is usable at all.
Scope honestly: it needs a real patch as input, and it finds repair siblings. It is not a general-purpose search improvement, and recall is not measurably better. This is the only roam surface we would put in front of your codebase without hedging. - Reachability triage (roam vuln-reach, roam sbom) — the most conservatively designed surface: reachability is derived only from import evidence (import sites and import edges, with file:line), never from symbol-name coincidence, so a CVE with no import evidence reports as unknown rather than reachable. Strong precision by construction; real-CVE recall on unfamiliar repos is still being measured — use it as a high-precision triage signal, and treat "unknown" as unverified rather than safe. - Taint packs (roam taint) — validated on synthetic fixtures; real-code recall on arbitrary repositories is low/unmeasured. Treat findings as leads to investigate, not a completeness guarantee; the --ci gate is opt-in. - Idiom & long-tail detectors (roam auth-gaps, roam missing-index, roam over-fetch, roam n1, framework idioms) — advisory. Blind precision on unfamiliar repos is not yet measured for all of them, and framework idiom detectors that measured low on stranger repos are opt-in (not on the default surface). Review each finding; don't gate CI on these alone.
Choose Roam when you want a reusable local map of how a project fits together. Use this checklist to see whether it helps with your own code:
| Capability | Roam behavior | How to evaluate it |
|---|---|---|
| Persistent local index | SQLite symbols, references, and Git history | Index your repository and inspect the edges behind an answer |
| Architecture analysis | Centrality, cycles, communities, churn, and co-change | Review roam health --explain and the underlying findings |
| Change planning | Blast radius, simulation, and work partitioning | Compare predicted affected files with actual tests and changes |
| MCP tools for agents | 246 (17 in default core preset) | Choose a preset and inspect roam mcp --list-tools |
| Languages | 28 | Check the extraction tier and resolution limits for your language |
| Local analysis | No API keys for the local engine | Review explicit network features in the network-boundary inventory |
| Open source | Apache 2.0 | Inspect the implementation and reproduce results on your own code |
| Security integration | Taint heuristics and SARIF evidence | Pair findings with your security scanner and review false positives |
461stars表示社区认可度良好。MCP标准设计使其易于集成,代码图谱能力是核心亮点,适合AI编码工作流场景,维护活跃度有保障。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,roam-code MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | roam-code |
| 原始描述 | 开源MCP工具:Local codebase intelligence CLI + MCP server for AI coding agents: SQLite code g。⭐461 · Python |
| Topics | 代码分析MCP服务AI编码代理代码图谱SQLite |
| GitHub | https://github.com/Cranot/roam-code |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-17 · 更新时间:2026-05-19 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端