Ckb

io.github.SimplyLiz由 GitHub 帳號 SimplyLiz 發布v8.0.3更新於 Oct 24, 2026

Code intelligence MCP server — 80+ tools for navigation, impact analysis, and architecture

概覽

AI 產生的概覽

本機程式碼智慧 MCP 伺服器,把程式碼庫變成可查詢的知識庫,用於程式碼導覽、影響分析、歸屬與架構問答。

可以做什麼
  • 搜尋與導覽程式碼:語意符號搜尋、呼叫圖、使用追蹤、進入點與架構圖
  • 分析變更:影響範圍、風險評分、受影響測試、破壞性變更比對與 PR 審查檢查
  • 查看歸屬與品質:CODEOWNERS 加 git blame、審查人建議、死程式碼、耦合度與熱點
  • 掃描外洩的密鑰與憑證樣式,並檢查文件覆蓋率
  • 使用組合工具(explore、understand、prepareChange、batchGet、batchSearch)把多次查詢合併為一次呼叫
適用情境
適合 AI 助理在大型或陌生的程式碼庫中工作,需要準確回答誰呼叫了誰、改動會破壞什麼、該跑哪些測試、某個模組由誰負責等問題。也適合重視影響面的 PR 審查與重構工作。
執行需求
以 stdio 在本機執行,通常透過 npx,需要 Node.js 16+ 與 Git。每個專案需先用 ckb init 初始化;可選的 SCIP 索引(ckb index)才能啟用跨檔案參照與精確影響分析。Claude Desktop 需設定 CKB_REPO 環境變數指向單一儲存庫。可選的 LIP 守護程式與語言索引器可提升效果。
安裝前請注意
它會讀取原始碼樹與 git 歷史,結果取決於儲存庫內容;靜態分析可能漏掉動態分派與產生程式碼,關鍵決策仍需核對程式碼。review 命令可向拉取請求張貼留言。可選的 HTTP 索引伺服器使用 bearer 權杖上傳,密鑰掃描會回報程式碼中的憑證問題。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ckb,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

CKB — Code Knowledge Backend

Know your code. Change it safely. Ship with confidence.

[npm version] [Website] [Documentation] [MCP Badge] [LIP] [LIP docs]

CKB transforms your codebase into a queryable knowledge base. Ask questions, understand impact, find owners, detect dead code—all through CLI, API, or AI assistants.

Think of it as a senior engineer who knows every line of code, every decision, and every owner—available 24/7 to answer your questions.


Instant Answers to Hard Questions

QuestionWithout CKBWith CKB
"What breaks if I change this?"Grep and hopePrecise blast radius with risk score
"Who should review this PR?"Guess from git blameData-driven reviewer suggestions
"Is this code still used?"Delete and see what breaksConfidence-scored dead code detection
"What tests should I run?"Run everything (30 min)Run affected tests only (2 min)
"How does this system work?"Read code for hoursQuery architecture instantly
"Who owns this code?"Search CODEOWNERS manuallyOwnership with drift detection
"Are there exposed secrets?"Manual grep for patternsAutomated scanning with 26 patterns

What You Can Do

🔍 Understand — Semantic search, call graphs, usage tracing, architecture maps

⚡ Analyze — Impact analysis, risk scoring, hotspot detection, coupling analysis

🛡️ Protect — Affected test detection, breaking change warnings, PR risk assessment

🔐 Secure — Secret detection, credential scanning, security-sensitive code identification

👥 Collaborate — Ownership lookup, reviewer suggestions, architectural decisions (ADRs)

📊 Improve — Dead code detection, tech debt tracking, documentation coverage

🚀 Compound Operations — Single-call tools (explore, understand, prepareChange) reduce AI tool calls by 60-70%

🔗 Integrate — CLI, HTTP API, MCP for AI tools, CI/CD pipelines, custom scripts


Try It Now

bash
# See what's risky in your codebaseckb hotspots --format=human
# Check what changed and what might breakckb diff-summary --format=human
# Scan for exposed secretsckb audit --format=human
# Check architecture at a glanceckb arch --format=human
# Check system statusckb status

Works Everywhere

AI AssistantsCI/CDYour Tools
Claude Code, Cursor, Windsurf, VS Code, GrokGitHub Actions, GitLab CICLI, HTTP API, Scripts

83% token reduction with smart presets—load only the tools you need.

bash
# One command to connect to Claude Codeckb setup

Building your own tools? Use CKB as a backend via CLI, HTTP API, or MCP. See the Integration Guide for examples in Node.js, Python, Go, and shell scripts.


Learn More

ResourceDescription
📖 Features GuideComplete feature list with examples
💬 Prompt CookbookReal prompts for real problems
🔌 Integration GuideUse CKB in your own tools and scripts
⚡ Impact AnalysisBlast radius, affected tests, PR risk
🔧 CI/CD IntegrationGitHub Actions, GitLab CI templates

Quick Start

Option 1: npm (Recommended)

bash
# Install globallynpm install -g @tastehub/ckb
# Or run directly with npx (no install needed)npx @tastehub/ckb init

Option 2: Homebrew (macOS/Linux)

bash
brew install simplyliz/ckb/ckb

Use the fully-qualified name. Homebrew 6.0 requires third-party taps to be trusted before it loads them; installing this way grants that trust for this one formula. Tapping first and installing by short name fails with Refusing to load formula ... from untrusted tap.

Option 3: Build from Source

bash
git clone https://github.com/SimplyLiz/CodeMCP.gitcd CodeMCPgo build -o ckb ./cmd/ckb

Setup

bash
# 1. Initialize in your projectcd /path/to/your/projectckb init   # or: npx @tastehub/ckb init
# 2. Generate SCIP index (optional but recommended)ckb index  # auto-detects language and runs appropriate indexer
# 3. Connect to Claude Codeckb setup  # creates .mcp.json automatically
# Or manually:claude mcp add --transport stdio ckb -- npx @tastehub/ckb mcp

Token efficiency shown at startup:

CKB MCP Server v9.3.1  Active tools: 25 / 110 (22%)  Estimated context: ~4k tokens  Preset: core

Now Claude can answer questions like:

  • "What calls the HandleRequest function?"
  • "How is ProcessPayment reached from the API?"
  • "What's the blast radius if I change UserService?"
  • "Who owns the internal/api module?"
  • "Is this legacy code still used?"

Why CKB?

Without CKBWith CKB
AI greps for patternsAI navigates semantically
"I found 47 matches for Handler""HandleRequest is called by 3 routes via CheckoutService"
Guessing at impactKnowing the blast radius with risk scores
Reading entire files for contextGetting exactly what's relevant
"Who owns this?" → search CODEOWNERSInstant ownership with reviewer suggestions
"Is this safe to change?" → hopeHotspot trends + impact analysis

Three Ways to Use It

InterfaceBest For
MCPAI-assisted development — Claude, Cursor, Windsurf, VS Code, OpenCode, Grok
CLIQuick lookups from terminal, scripting
HTTP APIIDE plugins, CI integration, custom tooling

How Indexing Works

CKB uses SCIP indexes to understand your code. Think of it like a database that knows where every function is defined, who calls it, and how everything connects.

The Basics

bash
# 1. Generate an index (auto-detects language)ckb index
# 2. Check if your index is freshckb status

Without an index, CKB still works using tree-sitter parsing (basic mode), but with an index you get:

  • Cross-file references ("who calls this function?")
  • Precise impact analysis
  • Call graph navigation

Language Support

Not all languages are equal. CKB classifies languages into quality tiers based on indexer maturity:

TierQualityLanguages
Tier 1Full support, all featuresGo
Tier 2Full support, minor edge casesTypeScript, JavaScript, Python
Tier 3Basic support, call graph may be incompleteRust, Java, Kotlin, C++, Ruby, Dart
Tier 4ExperimentalC#, PHP

Key limitations:

  • Incremental indexing is Go-only. Other languages require full reindex.
  • TypeScript monorepos may need --infer-tsconfig flag
  • C/C++ requires compile_commands.json
  • Python works best with activated virtual environment

Run ckb doctor --tier standard to check if your language tools are properly installed.

See Language Support for indexer installation, known issues, and the full feature matrix.

Keeping Your Index Fresh

Your index becomes stale when you make commits. CKB offers several ways to stay current:

MethodCommandWhen to Use
Manualckb indexOne-off updates, scripts
Watch modeckb index --watchAuto-refresh during development
MCP watchckb mcp --watchAuto-refresh in AI sessions
CI webhookPOST /api/v1/refreshTrigger from CI/CD

Quick start for AI sessions:

bash
ckb mcp --watch  # Auto-reindexes every 30s when stale

Check staleness:

bash
ckb status# Shows: "5 commits behind HEAD" or "Up to date"

For Go projects, CKB uses incremental indexing—only changed files are processed, making updates fast.

See the Index Management Guide for complete documentation.

Features

FeatureDescription
Compound Operationsexplore, understand, prepareChange — single-call tools that reduce AI overhead by 60-70%
Code NavigationSemantic search, call graphs, trace usage, find entrypoints
Impact AnalysisBlast radius, risk scoring, affected tests, breaking changes (compareAPI)
ArchitectureModule overview, ADRs, dependency graphs, explain origin
OwnershipCODEOWNERS + git blame, reviewer suggestions, drift detection
Code QualityDead code detection (findDeadCode), coupling analysis, complexity
SecuritySecret detection, credential scanning, allowlists
DocumentationDoc-symbol linking, staleness detection, coverage metrics
Multi-RepoFederation, API contracts, remote index serving
RuntimeOpenTelemetry integration, observed usage, production dead code
StreamingSSE streaming for findReferences, searchSymbols with real-time progress
AutomationDaemon mode, watch mode, webhooks, incremental indexing

📖 Full Features Guide — Detailed documentation with examples

📋 Changelog — Version history

PR Review

CKB review runs 21 quality checks in 5 seconds — secrets, breaking changes, dead code, complexity, test gaps, bug patterns, and more. Zero tokens, zero API calls.

When your AI assistant (Claude Code, Cursor, Windsurf) reviews a PR, it calls CKB first and gets structured analysis in ~1k tokens. Then it only reads the files that matter — saving 50-80% of tokens on large PRs.

bash
ckb review --base=main              # Human-readable reviewckb review --base=main --ci         # CI mode (exit codes)ckb review --base=main --post=123   # Post as PR comment

Works in CI without any LLM:

yaml
- run: npx @tastehub/ckb review --base=main --ci --format=sarif > review.sarif
Without CKBWith CKB
LLM tokens on 100-file PR~200k~50k
Files LLM readsall~10 (CKB-flagged)
Secrets/breaking/dead-code checkednoyes (all files)

📖 How it helps AI review · Benchmarks · CI Integration · Quickstart

CLI

bash
ckb status           # System health (with remediation suggestions)ckb search Handler   # Find symbolsckb diff-summary     # Analyze what changedckb hotspots         # Risky areasckb arch             # Architecture overviewckb ownership        # File/path ownershipckb mcp              # Start MCP server

Compound Operations (via MCP):

bash
# These tools combine multiple queries into single callsexplore      # Area exploration: symbols, dependencies, hotspotsunderstand   # Symbol deep-dive: refs, callers, explanationprepareChange # Pre-change analysis: impact, tests, riskbatchGet     # Fetch up to 50 symbols at oncebatchSearch  # Run up to 10 searches at once

📖 User Guide — All CLI commands and options

HTTP API

bash
# Start the HTTP serverckb serve --port 8080
# Example callscurl http://localhost:8080/healthcurl http://localhost:8080/statuscurl "http://localhost:8080/search?q=NewServer"curl http://localhost:8080/architecturecurl "http://localhost:8080/ownership?path=internal/api"curl http://localhost:8080/hotspots
# Index Server Mode (v7.3) - serve indexes to remote clientsckb serve --port 8080 --index-server --index-config config.toml
# Index server endpointscurl http://localhost:8080/index/reposcurl http://localhost:8080/index/repos/company%2Fcore-lib/metacurl "http://localhost:8080/index/repos/company%2Fcore-lib/symbols?limit=100"curl "http://localhost:8080/index/repos/company%2Fcore-lib/search/symbols?q=Handler"
# Upload endpoints (with compression + auth)curl -X POST http://localhost:8080/index/repos \  -H "Content-Type: application/json" \  -H "Authorization: Bearer ckb_xxx" \  -d '{"id":"my-org/my-repo","name":"My Repo"}'
gzip -c index.scip | curl -X POST http://localhost:8080/index/repos/my-org%2Fmy-repo/upload \  -H "Content-Encoding: gzip" \  -H "Authorization: Bearer ckb_xxx" \  --data-binary @-
# Token management (index server admin)ckb token create --name "ci-upload" --scope upload    # Create API keyckb token list                                         # List all tokensckb token revoke ckb_xxx                              # Revoke a tokenckb token rotate ckb_xxx                              # Rotate (new secret, same ID)

MCP Integration

CKB works with any MCP-compatible AI coding tool.

Claude Code
bash
# Auto-configure for current projectnpx @tastehub/ckb setup
# Or add globally for all projectsnpx @tastehub/ckb setup --global

Or manually add to .mcp.json:

json
{  "mcpServers": {    "ckb": {      "command": "npx",      "args": ["@tastehub/ckb", "mcp"]    }  }}
Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

json
{  "mcpServers": {    "ckb": {      "command": "npx",      "args": ["@tastehub/ckb", "mcp"]    }  }}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "ckb": {      "command": "npx",      "args": ["@tastehub/ckb", "mcp"]    }  }}
VS Code

Add to your VS Code settings.json:

json
{  "mcp": {    "servers": {      "ckb": {        "type": "stdio",        "command": "npx",        "args": ["@tastehub/ckb", "mcp"]      }    }  }}
OpenCode

Add to opencode.json in project root:

json
{  "mcp": {    "ckb": {      "type": "local",      "command": ["npx", "@tastehub/ckb", "mcp"],      "enabled": true    }  }}
Grok
bash
# Auto-configure for current projectnpx @tastehub/ckb setup --tool=grok
# Or add globallynpx @tastehub/ckb setup --tool=grok --global

Or manually add to .grok/settings.json (project) or ~/.grok/user-settings.json (global):

json
{  "mcpServers": {    "ckb": {      "name": "ckb",      "transport": "stdio",      "command": "npx",      "args": ["@tastehub/ckb", "mcp"]    }  }}
Claude Desktop

Claude Desktop doesn't have a project context, so you must specify the repository path.

Automatic setup (recommended):

bash
cd /path/to/your/repockb setup --tool=claude-desktop

Manual configuration — add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "ckb": {      "command": "npx",      "args": ["-y", "@tastehub/ckb", "mcp"],      "env": {        "CKB_REPO": "/path/to/your/repo"      }    }  }}

The CKB_REPO environment variable tells CKB which repository to analyze. Claude Desktop can only work with one repository at a time.

Windows

Use cmd /c wrapper in any config above:

json
{  "mcpServers": {    "ckb": {      "command": "cmd",      "args": ["/c", "npx", "@tastehub/ckb", "mcp"]    }  }}
Presets (Token Optimization)

CKB exposes 110+ tools, but most sessions only need a subset. Use presets to reduce token overhead by up to 77%:

bash
# List all available presets with tool counts and token estimatesckb mcp --list-presets
# Default: core preset (25 essential tools)ckb mcp
# Workflow-specific presetsckb mcp --preset=core        # 25 tools - search, explain, impact (default)ckb mcp --preset=review      # 42 tools - core + diff, ownership, PR reviewckb mcp --preset=refactor    # 42 tools - core + coupling, dead codeckb mcp --preset=federation  # 46 tools - core + cross-repockb mcp --preset=docs        # 34 tools - core + doc-symbol linkingckb mcp --preset=ops         # 43 tools - core + jobs, webhooks, metricsckb mcp --preset=full        # 110 tools - complete feature set

In MCP config:

json
{  "mcpServers": {    "ckb": {      "command": "npx",      "args": ["@tastehub/ckb", "mcp", "--preset=review"]    }  }}

The AI can dynamically expand the toolset mid-session using the expandToolset tool.

Under the Hood

CKB orchestrates multiple code intelligence backends, using whatever is available and stacking their strengths — more backends running means richer answers:

  • Cartographer — Fast structural analysis (architecture, dependencies, blast-radius, coupling, directory rollup) that needs no index and works the moment CKB is installed. Compiled into the binary, so it ships in the npm and Homebrew builds by default.
  • SCIP — Precise, pre-indexed symbol data for exact definitions, references, and call graphs (run ckb index)
  • LSP — Real-time language server queries
  • Git — Blame, history, churn analysis, ownership
  • LIP — Semantic embedding daemon for nearest-neighbour search and re-ranking. Runs as a separate, optional daemon — install and start it alongside CKB.

Results are merged intelligently and compressed for LLM context limits. Every backend except Git is optional; CKB degrades gracefully to whatever is present.

LIP enhances semantic search, PR novelty detection, test discovery, file boundary analysis, and architecture coupling signals. When LIP is running alongside CKB, search quality improves significantly — especially for natural-language queries that don't match symbol names literally. See Hybrid Retrieval for details, or the LIP documentation.

Persistent knowledge survives across sessions:

  • Module Registry — Boundaries, responsibilities, tags
  • Ownership Registry — CODEOWNERS + git-blame with time decay
  • Hotspot Tracker — Historical snapshots with trend analysis
  • Decision Log — ADRs with full-text search

Who Should Use CKB?

  • Developers using AI assistants — Give your AI tools superpowers
  • Teams with large codebases — Navigate complexity efficiently
  • Anyone doing refactoring — Understand impact before changing
  • Code reviewers — See the full picture of changes
  • Tech leads — Track architectural health over time

Limitations (Honest Take)

CKB excels at:

  • Static code navigation—finding definitions, references, call graphs
  • Impact analysis for safe refactoring
  • Ownership lookup (CODEOWNERS + git blame)
  • Architecture and module understanding

CKB won't help with:

  • Dynamic dispatch / runtime behavior (use debugger)
  • Generated code that isn't indexed
  • Code generation, linting, or formatting
  • Cross-repo calls (use federation for this)

CKB is static analysis, not magic. Always verify critical decisions by reading the actual code.

📖 Practical Limits — Full guide on accuracy, blind spots, and when to trust results

Documentation

See the Full Documentation Wiki for:

Requirements

Using npm (recommended):

  • Node.js 16+
  • Git

Building from source:

  • Go 1.21+
  • Git

Optional (for enhanced analysis):

  • SCIP indexer for your language (scip-go, scip-typescript, etc.) — run ckb index to auto-install
  • LIP v2.3+ semantic embedding daemon (requires Rust/cargo) — strongly recommended for best search quality (docs, crates.io):
    bash
    cargo install lip-clilip daemon --socket ~/.local/share/lip/lip.sock

License

Free for:

  • Personal use
  • Open source projects
  • Startups & small businesses under $25k annual revenue

Commercial license required for organizations with $25k+ annual revenue. See pricing for Team and Enterprise plans, or LICENSE for full terms.

來源:README.md,提交 768a194

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v8.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。