codebase-intelligence MCP server
2026년 10월 22일 커밋TypeScript 코드베이스를 분석하여 AI 에이전트와 개발자에게 아키텍처 메트릭, 의존성 영향 분석, 미사용 코드 탐지 기능을 제공합니다.
다른 이름 bntvllnt/codebase-intelligence
- 스타
- 8
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 10월 22일
- 라이선스
- MIT
codebase-intelligence MCP란?
codebase-intelligence은(는) MCP server입니다. TypeScript 코드베이스를 분석하여 AI 에이전트와 개발자에게 아키텍처 메트릭, 의존성 영향 분석, 미사용 코드 탐지 기능을 제공합니다.
프로젝트 README에서 생성된 요약
codebase-intelligence MCP server 정보
codebase-intelligence는 TypeScript 코드베이스를 분석하여 아키텍처 메트릭, 의존성 영향 분석, 미사용 코드 탐지 기능을 개발자와 AI 에이전트에게 제공합니다. 이 도구는 기본적으로 CLI 중심 도구로 작동하며, 프로젝트를 파싱하여 의존성 그래프를 구축하고 PageRank, 결합도(coupling), 순환 복잡도(cyclomatic complexity)와 같은 복잡한 품질 메트릭을 계산합니다. 사용자는 npx를 통해 실행하거나 전역으로 설치하여 소스 디렉토리에 대한 심층 검사를 수행할 수 있습니다.
CLI가 주요 인터페이스이지만, Claude 또는 Cursor와 같은 클라이언트 내에서 사용할 수 있도록 25개의 도구, 2개의 프롬프트, 3개의 리소스를 제공하는 선택적 MCP 구현체도 포함되어 있습니다. 서버는 stdio를 사용하여 로컬에 설정할 수 있습니다. 이 도구는 팀이 코드의 핫스팟을 식별하고, 중복된 함수군을 탐지하며, 계층형(layered) 또는 헥사고날(hexagonal)과 같은 프리셋을 사용하여 아키텍처 경계를 강제할 수 있도록 설계되었습니다. init 명령어를 통해 AI 에이전트와 통합함으로써, 모델이 단순한 텍스트 검색에 의존하지 않고 구조화된 코드베이스 인텔리전스를 쿼리하도록 보장합니다.
활용 사례
- 1고위험 코드 핫스팟 식별복잡도, 변경 빈도(churn), 영향 범위(blast radius) 등의 특정 메트릭을 기준으로 파일을 순위화하여 리팩토링이 필요한 영역을 찾습니다.
- 2미사용 코드 export 탐지TypeScript 프로젝트 내의 미사용 export를 찾아 코드베이스를 안전하게 정리합니다.
- 3의존성 영향 분석심볼의 영향 범위를 결정하여 변경 사항이 어떤 파일에 영향을 미치는지 확인합니다.
- 4아키텍처 경계 강제import 문이 계층형 또는 헥사고날 설계와 같은 특정 아키텍처 패턴을 따르는지 검증합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능bntvllnt/codebase-intelligence is public and reachablegithub.com/bntvllnt/codebase-intelligence ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-10-22github.com/bntvllnt/codebase-intelligence ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기codebase-intelligence
CLI-first codebase analysis for TypeScript projects.
Parse your codebase, build a dependency graph, compute architectural metrics, and query everything from your terminal/CI. MCP support is included as an optional secondary interface.
Quick Start
CLI (recommended)
npx codebase-intelligence overview ./src
Common workflows:
npx codebase-intelligence hotspots ./src --metric complexity --limit 10
npx codebase-intelligence opportunities ./src --limit 10
npx codebase-intelligence duplicates ./src --mode mild --min-tokens 30
npx codebase-intelligence impact ./src parseCodebase
npx codebase-intelligence dead-exports ./src --limit 20
npx codebase-intelligence changes ./src --json
npx codebase-intelligence boundaries ./src --preset layered --list --json
MCP (optional)
claude mcp add -s user -t stdio codebase-intelligence -- npx -y codebase-intelligence@latest .
Table of Contents
- Features
- Installation
- CLI Usage
- Agent Adoption
- MCP Integration (Secondary)
- Metrics
- Architecture
- Requirements
- Limitations
- Release
- Security
- Contributing
- License
Features
- 24 CLI commands for architecture analysis, dependency impact, duplicate families, focused map/context packs, content drift, health scoring, boundary enforcement, Highways convergence, improvement opportunities, dead code detection, search, CI rules, and agent setup
- Machine-readable JSON output (
--json) for automation and CI pipelines - Auto-cached index in
.codebase-intelligence/for fast repeat queries - Cache migration facts in JSON (
cacheDir,legacyCacheDir,migrated,gitignoreUpdated,warnings[]) - Quality metrics — PageRank, betweenness, coupling, cohesion, tension, churn, cyclomatic/cognitive complexity, blast radius, dead exports, test coverage, escape velocity, risk, maintainability, and CRAP score
- Symbol-level analysis — callers/callees, symbol importance, impact blast radius
- BM25 search — ranked keyword search across files, symbols, and type/shape facts
- Process tracing — detect entry points and execution flows through the call graph
- Codebase maps + context packs — focused file/symbol/test graph with deterministic evidence IDs and token-bounded context for agents
- Content drift — report-only detection for file/name/scope/side-effect/shape/test placement mismatch with stable evidence
- Health score — CI-gateable composite score with per-file maintainability, CRAP, coverage source, and risk hotspots
- Highways analysis — find repeated routes that bypass canonical dataflow paths and synthesize safe proposed highways
- Community detection — Louvain clustering for natural file groupings
- Agent adoption —
initwrites per-agent instruction files + installs a skill so AI agents query CI before grep/read - MCP parity (secondary) — same analysis and rules gate available as 25 MCP tools, 2 prompts, and 3 resources
Installation
Run directly with npx (no install):
npx codebase-intelligence overview ./src
Or install globally:
npm install -g codebase-intelligence
codebase-intelligence overview ./src
CLI Usage
codebase-intelligence <command> <path> [options]
Commands
| Command | What it does |
|---|---|
overview |
High-level codebase snapshot |
hotspots |
Rank files by metric (coupling, churn, complexity, cognitive complexity, blast radius, coverage, risk, etc.) |
file |
Full context for one file |
search |
BM25 keyword and shape search |
changes |
Git diff analysis with risk metrics |
dependents |
File-level blast radius |
modules |
Module architecture + cross-dependencies |
forces |
Cohesion/tension/escape-velocity analysis |
dead-exports |
Unused export detection |
opportunities |
Ranked code-quality and refactoring opportunities |
duplicates |
Duplicate function families (strict, mild, weak) |
groups |
Top-level directory groups + aggregate metrics |
symbol |
Callers/callees and symbol metrics |
impact |
Symbol-level blast radius |
rename |
Reference discovery for rename planning |
processes |
Entry-point execution flow tracing |
map |
Focused codebase graph + token-bounded context pack |
drift |
Report-only content drift findings with evidence and recommendations |
health |
CI-gateable health score with maintainability, CRAP, coverage, and risk hotspots |
boundaries |
Architecture boundary zones, allow/forbid import rules, and violation evidence |
highways |
Repeated route convergence, canonical path opportunities, and synthesis proposals |
clusters |
Community-detected file clusters |
owners |
Ownership, bus-factor, and risk grouping |
architecture |
Evidence-backed extraction/seam/locality recommendations |
workspaces |
Package workspace scope and changed-workspace detection |
lsp |
Advisory editor diagnostics snapshot or minimal LSP server |
watch |
Local watch readiness and debounced analysis events |
check |
Rules-engine gate for CI, including opt-in dead-code and dependency gates |
ci |
One PR quality gate around check, changes, health, formats, baselines, and history |
doctor |
Read-only setup auditor for local, CI, MCP, and agent workflows |
explain |
Explain one analyzer rule and next action |
migrate-config |
Dry-run config migration to codebase-intelligence.json |
hooks |
Plan or install local hooks that run the same CI gate |
history |
Read local finding history from .codebase-intelligence/ |
init |
Set up AI agents to use CI — writes per-agent instruction files (skill opt-in via --skill) |
Useful flags
| Flag | Description |
|---|---|
--json |
Stable JSON output |
--force |
Rebuild index even if cache is valid |
--limit <n> |
Limit results on supported commands |
--metric <m> |
Select ranking metric for hotspots |
--scope <s> |
Select git diff scope for changes; directory/module scope for map and drift |
--mode <m> |
Select clone mode for duplicates: strict, mild, weak |
--min-tokens <n> |
Minimum duplicate token size for duplicates |
--skip-local |
Ignore duplicate families confined to one file |
--trace <id> |
Return token evidence for one duplicate family |
--focus <name> |
Focus map or drift on one symbol, file, or scope |
--context-budget <n> |
Bound map context pack size |
--min-score <n> |
Minimum drift score for drift findings; minimum health score before health exits 1 |
--score |
Print compact health score text |
--preset <name> |
Run boundaries with bulletproof, layered, hexagonal, or feature-sliced |
--list |
List resolved boundaries zones and rules |
--format <fmt> |
Export map as markdown, json, dot, or graphml; export check/ci as text, json, sarif, markdown, annotations, pr-comment-github, pr-comment-gitlab, badge, codeclimate, or compact |
--operation <verb> |
Focus highways on one operation verb |
--shape <name> |
Focus highways on one type/DTO shape |
--production |
Exclude test/dev files from production-risk check/ci output |
--changed-since <ref> |
Line-level check/ci filtering from a git diff |
--diff-file <path> |
Line-level check/ci filtering from a unified diff file |
The scanner always excludes common generated and agent-workspace directories such as .codebase-intelligence/, legacy .code-visualizer/, .next/, dist/, coverage/, .worktrees/, and .claude/worktrees/.
Analysis commands with --json and init --json include a top-level cache object with the canonical cache path, legacy cache path, migration status, .gitignore update status, and non-fatal cache warnings.
For full command details, see docs/cli-reference.md.
Agent Adoption
codebase-intelligence has the data — but AI agents only benefit if they actually
query it instead of defaulting to grep/read. init closes that gap.
codebase-intelligence init # interactive picker (TTY)
codebase-intelligence init --agents claude,cursor
codebase-intelligence init --all --skill # every agent + global skill
codebase-intelligence init --yes # non-interactive defaults
Nothing is written unless you choose it. On a terminal, init shows an interactive
picker (AGENTS.md + CLAUDE.md preselected); non-interactively it defaults to those
two. The global skill is opt-in (--skill). It writes an idempotent, marked
instruction block ("query CI before grep/read") into each selected agent's native file:
| Layer | Target | Default |
|---|---|---|
| Repo instructions | AGENTS.md, CLAUDE.md |
selected |
| Repo instructions | .cursor/rules/*.mdc, .github/copilot-instructions.md, GEMINI.md, CONVENTIONS.md (Aider) |
opt-in |
| Portable skill | ~/.claude/skills/codebase-intelligence/SKILL.md |
opt-in (--skill) |
Writes are idempotent — only content between the
<!-- codebase-intelligence:start --> / :end markers is ever touched, so re-running
is safe and your own edits are preserved.
Install the skill directly
The skill is also published to the skills.sh registry:
ags install codebase-intelligence
# or
npx skills add github.com/bntvllnt/codebase-intelligence
MCP Integration (Secondary)
Running without a subcommand starts the MCP stdio server (backward compatible):
npx codebase-intelligence ./src
Claude Code (manual)
Add to .mcp.json:
{
"mcpServers": {
"codebase-intelligence": {
"type": "stdio",
"command": "npx",
"args": ["-y", "codebase-intelligence@latest", "./src"],
"env": {}
}
}
}
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"servers": {
"codebase-intelligence": {
"command": "npx",
"args": ["-y", "codebase-intelligence@latest", "./src"]
}
}
}
For MCP tool details, see docs/mcp-tools.md.
Metrics
| Metric | What it reveals |
|---|---|
| PageRank | Most-referenced files (importance) |
| Betweenness | Bridge files between disconnected modules |
| Coupling | How tangled a file is (fan-out / total connections) |
| Cohesion | Does a module belong together? (internal / total deps) |
| Tension | Is a file torn between modules? (entropy of cross-module pulls) |
| Escape Velocity | Should this module be its own package? |
| Churn | Git commit frequency |
| Complexity | Average cyclomatic and cognitive complexity of exports/symbols |
| Blast Radius | Transitive dependents affected by a change |
| Dead Exports | Unused exports (safe to remove) |
| Test Coverage | Whether a test file exists for each source file |
| Risk Score | Composite file risk from complexity, churn, coupling, size, blast radius, and test reachability |
| Maintainability Index | Health-derived 0-100 per-file maintainability score |
| CRAP Score | Complexity x uncovered-code risk, using Istanbul coverage when present or static test reachability otherwise |
Architecture
codebase-intelligence <command> <path>
|
v
+---------+ +---------+ +----------+
| Parser | --> | Graph | --> | Analyzer |
| TS AST | | grapho- | | metrics |
| | | logy | | |
+---------+ +---------+ +----------+
|
+--> CLI output (default)
+--> MCP stdio (optional mode)
- Parser — extracts files, functions, and imports via TypeScript Compiler API.
- Graph — builds dependency/call graphs with graphology.
- Analyzer — computes file/module/symbol metrics.
- Interfaces — CLI is primary; MCP is available for agent integrations.
Requirements
- Node.js >= 18
- TypeScript codebase (
.ts/.tsxfiles)
Limitations
- TypeScript-focused analysis
- Static analysis only (no runtime tracing)
- Call graph confidence varies by symbol resolution quality
Release
Publishing is automated through GitHub Actions. See CHANGELOG.md for release notes.
Normal CI (before release)
CIworkflow runs on every PR and push tomain:- lint → typecheck → build → test
Canary publish
- Pushes to
maintrigger a canary publish. - The package is published to npm with the
canarytag. - Canary versions are derived from the current package version plus the short commit SHA.
Create a release
- Bump
package.jsonversion in a normal PR. - Merge that PR to
main. - Run the
Publishworkflow manually from GitHub Actions. - The workflow will:
- verify the tag does not already exist
- create and push
vX.Y.Z - publish to npm with provenance via OIDC
- create a GitHub Release with generated notes
No PAT is required for npm publish. The workflow uses GitHub repository permissions for tagging and OIDC for npm publishing.
Security
Please do not report security vulnerabilities in public issues.
- Read
SECURITY.mdfor supported versions and disclosure guidance. - Use GitHub Security Advisories or private maintainer contact for sensitive reports.
Contributing
Contributions are welcome.
Start here:
CONTRIBUTING.md— setup, workflow, testing, and PR expectationsCODE_OF_CONDUCT.md— community standardsSECURITY.md— vulnerability reporting
Quick setup:
git clone https://github.com/bntvllnt/codebase-intelligence.git
cd codebase-intelligence
pnpm install
pnpm dev # tsx watch mode
pnpm test # vitest
pnpm lint # eslint
pnpm typecheck # tsc --noEmit
pnpm build # production build
pnpm verify:cli-real # default real-repo CLI matrix
pnpm verify:cli-real:heavy # large /home/ubuntu repo matrix
License
codebase-intelligence MCP 질문
Claude에서 codebase-intelligence를 어떻게 사용하나요?
claude mcp add -s user -t stdio codebase-intelligence -- npx -y codebase-intelligence@latest . 명령어를 사용하여 MCP server로 추가할 수 있습니다.
CI/CD 파이프라인을 지원하나요?
네, 머신이 읽을 수 있는 JSON 출력을 제공하며, CI 환경에서 품질 게이트 역할을 하도록 설계된 check 및 ci와 같은 특정 명령어를 지원합니다.
사용하지 않는 코드를 찾는 데 도움이 되나요?
네, 미사용 export를 탐지하기 위한 전용 dead-exports 명령어가 포함되어 있습니다.
AI 에이전트가 제 코드를 더 잘 이해하도록 어떻게 도와주나요?
init 명령어를 통해 Claude 또는 Cursor와 같은 에이전트용 지침 파일을 작성합니다. 이를 통해 에이전트가 단순한 grep/read 명령어에 의존하는 대신, 컨텍스트 파악을 위해 이 도구에 직접 쿼리하도록 학습시킵니다.