io.github.SimplyLiz/ckb

编码与调试

by simplyliz

面向代码智能的 MCP server,提供 80+ 工具用于导航、影响分析与架构理解。

ckb 把代码导航、变更影响分析和架构理解整合进 MCP,内置 80+ 工具,读大仓库和评估改动范围更省心。

什么是 io.github.SimplyLiz/ckb

面向代码智能的 MCP server,提供 80+ 工具用于导航、影响分析与架构理解。

README

CKB — Code Knowledge Backend

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

npm version Website Documentation

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 codebase
ckb hotspots --format=human

# Check what changed and what might break
ckb diff-summary --format=human

# Scan for exposed secrets
ckb audit --format=human

# Check architecture at a glance
ckb arch --format=human

# Check system status
ckb 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 Code
ckb 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 globally
npm install -g @tastehub/ckb

# Or run directly with npx (no install needed)
npx @tastehub/ckb init

Option 2: Homebrew (macOS/Linux)

bash
brew tap SimplyLiz/ckb
brew install ckb

Option 3: Build from Source

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

Setup

bash
# 1. Initialize in your project
cd /path/to/your/project
ckb 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 Code
ckb setup  # creates .mcp.json automatically

# Or manually:
claude mcp add --transport stdio ckb -- npx @tastehub/ckb mcp

Token efficiency shown at startup:

code
CKB MCP Server v8.0.0
  Active tools: 14 / 76 (18%)
  Estimated context: ~1k 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 fresh
ckb 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 20 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 review
ckb 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 symbols
ckb diff-summary     # Analyze what changed
ckb hotspots         # Risky areas
ckb arch             # Architecture overview
ckb ownership        # File/path ownership
ckb mcp              # Start MCP server

v8.0 Compound Operations (via MCP):

bash
# These tools combine multiple queries into single calls
explore      # Area exploration: symbols, dependencies, hotspots
understand   # Symbol deep-dive: refs, callers, explanation
prepareChange # Pre-change analysis: impact, tests, risk
batchGet     # Fetch up to 50 symbols at once
batchSearch  # Run up to 10 searches at once

📖 User Guide — All CLI commands and options

HTTP API

bash
# Start the HTTP server
ckb serve --port 8080

# Example calls
curl http://localhost:8080/health
curl http://localhost:8080/status
curl "http://localhost:8080/search?q=NewServer"
curl http://localhost:8080/architecture
curl "http://localhost:8080/ownership?path=internal/api"
curl http://localhost:8080/hotspots

# Index Server Mode (v7.3) - serve indexes to remote clients
ckb serve --port 8080 --index-server --index-config config.toml

# Index server endpoints
curl http://localhost:8080/index/repos
curl http://localhost:8080/index/repos/company%2Fcore-lib/meta
curl "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 key
ckb token list                                         # List all tokens
ckb token revoke ckb_xxx                              # Revoke a token
ckb token rotate ckb_xxx                              # Rotate (new secret, same ID)

MCP Integration

CKB works with any MCP-compatible AI coding tool.

<details> <summary><strong>Claude Code</strong></summary>
bash
# Auto-configure for current project
npx @tastehub/ckb setup

# Or add globally for all projects
npx @tastehub/ckb setup --global

Or manually add to .mcp.json:

json
{
  "mcpServers": {
    "ckb": {
      "command": "npx",
      "args": ["@tastehub/ckb", "mcp"]
    }
  }
}
</details> <details> <summary><strong>Cursor</strong></summary>

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

json
{
  "mcpServers": {
    "ckb": {
      "command": "npx",
      "args": ["@tastehub/ckb", "mcp"]
    }
  }
}
</details> <details> <summary><strong>Windsurf</strong></summary>

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

json
{
  "mcpServers": {
    "ckb": {
      "command": "npx",
      "args": ["@tastehub/ckb", "mcp"]
    }
  }
}
</details> <details> <summary><strong>VS Code</strong></summary>

Add to your VS Code settings.json:

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

Add to opencode.json in project root:

json
{
  "mcp": {
    "ckb": {
      "type": "local",
      "command": ["npx", "@tastehub/ckb", "mcp"],
      "enabled": true
    }
  }
}
</details> <details> <summary><strong>Grok</strong></summary>
bash
# Auto-configure for current project
npx @tastehub/ckb setup --tool=grok

# Or add globally
npx @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"]
    }
  }
}
</details> <details> <summary><strong>Claude Desktop</strong></summary>

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

Automatic setup (recommended):

bash
cd /path/to/your/repo
ckb 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.

</details> <details> <summary><strong>Windows</strong></summary>

Use cmd /c wrapper in any config above:

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

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

bash
# List all available presets with tool counts and token estimates
ckb mcp --list-presets

# Default: core preset (14 essential tools)
ckb mcp

# Workflow-specific presets
ckb mcp --preset=core        # 14 tools - search, explain, impact (default)
ckb mcp --preset=review      # 19 tools - core + diff, ownership
ckb mcp --preset=refactor    # 19 tools - core + coupling, dead code
ckb mcp --preset=federation  # 28 tools - core + cross-repo
ckb mcp --preset=docs        # 20 tools - core + doc-symbol linking
ckb mcp --preset=ops         # 25 tools - core + jobs, webhooks, metrics
ckb mcp --preset=full        # 80+ tools - all tools (legacy)

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.

</details>

Under the Hood

CKB orchestrates multiple code intelligence backends:

  • SCIP — Precise, pre-indexed symbol data (fastest)
  • LSP — Real-time language server queries
  • Git — Blame, history, churn analysis, ownership

Results are merged intelligently and compressed for LLM context limits.

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

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.

常见问题

io.github.SimplyLiz/ckb 是什么?

面向代码智能的 MCP server,提供 80+ 工具用于导航、影响分析与架构理解。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描111.1k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描111.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描111.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.0k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.7k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论