codebase-analyzer-mcp 2.1.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -57
- package/dist/cli/index.js +123 -53
- package/dist/mcp/server.js +4 -10
- package/package.json +4 -10
- package/.claude-plugin/marketplace.json +0 -34
- package/.claude-plugin/plugin.json +0 -32
- package/AGENTS.md +0 -112
- package/CLAUDE.md +0 -160
- package/agents/analysis/architecture-analyzer.md +0 -115
- package/agents/analysis/dataflow-tracer.md +0 -120
- package/agents/analysis/pattern-detective.md +0 -110
- package/agents/research/codebase-explorer.md +0 -114
- package/commands/analyze.md +0 -74
- package/skills/codebase-analysis/SKILL.md +0 -61
- package/skills/codebase-analysis/references/api-reference.md +0 -268
package/README.md
CHANGED
|
@@ -3,30 +3,11 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/codebase-analyzer-mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
MCP server for codebase analysis with Gemini AI. Progressive disclosure keeps costs low — start with free structural analysis, drill into semantic details only when needed.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
claude /plugin install jaykaycodes/codebase-analyzer-mcp
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
This gives you MCP tools + agents + the `/cba:analyze` command. Just ask questions naturally.
|
|
17
|
-
|
|
18
|
-
**Gemini API key (optional):** Enables semantic analysis, pattern detection, and dataflow tracing. Without it, you still get structural analysis.
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
mkdir -p ~/.config/codebase-analyzer
|
|
22
|
-
echo '{"geminiApiKey":"YOUR_KEY"}' > ~/.config/codebase-analyzer/config.json
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Get a free key at https://aistudio.google.com/apikey
|
|
26
|
-
|
|
27
|
-
### Option 2: Standalone MCP Server
|
|
28
|
-
|
|
29
|
-
Add to `~/.mcp.json`:
|
|
10
|
+
Add to your MCP config (`~/.mcp.json` for Claude Code):
|
|
30
11
|
|
|
31
12
|
```json
|
|
32
13
|
{
|
|
@@ -42,20 +23,23 @@ Add to `~/.mcp.json`:
|
|
|
42
23
|
}
|
|
43
24
|
```
|
|
44
25
|
|
|
45
|
-
Restart Claude Code
|
|
26
|
+
Restart Claude Code. The tools will be available immediately.
|
|
46
27
|
|
|
47
|
-
|
|
28
|
+
**Gemini API key** is optional — enables semantic analysis, pattern detection, and dataflow tracing. Without it, you still get structural analysis. Get a free key at https://aistudio.google.com/apikey
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
npx codebase-analyzer-mcp analyze . # Standard analysis
|
|
51
|
-
npx codebase-analyzer-mcp analyze . -d surface # Fast, free overview
|
|
52
|
-
npx codebase-analyzer-mcp analyze . -d deep -s # Full semantic analysis
|
|
53
|
-
npx codebase-analyzer-mcp query . "how is auth handled?" # Ask a question
|
|
54
|
-
npx codebase-analyzer-mcp patterns . # Find design patterns
|
|
55
|
-
npx codebase-analyzer-mcp dataflow . "user login" # Trace data flow
|
|
56
|
-
```
|
|
30
|
+
## Tools
|
|
57
31
|
|
|
58
|
-
|
|
32
|
+
| Tool | Description | Requires Gemini |
|
|
33
|
+
|------|-------------|:---:|
|
|
34
|
+
| `analyze_repo` | Full analysis with progressive disclosure | No |
|
|
35
|
+
| `query_repo` | Ask questions about a codebase | Optional |
|
|
36
|
+
| `expand_section` | Drill into specific analysis sections | No |
|
|
37
|
+
| `read_files` | Read source files from a cached analysis | No |
|
|
38
|
+
| `find_patterns` | Detect design/architecture patterns | Yes |
|
|
39
|
+
| `trace_dataflow` | Trace data flow through the system | Yes |
|
|
40
|
+
| `get_analysis_capabilities` | List supported languages and options | No |
|
|
41
|
+
|
|
42
|
+
## Analysis Layers
|
|
59
43
|
|
|
60
44
|
| Layer | Cost | What You Get |
|
|
61
45
|
|-------|------|--------------|
|
|
@@ -63,38 +47,37 @@ npx codebase-analyzer-mcp dataflow . "user login" # Trace data fl
|
|
|
63
47
|
| **Structural** | Free | Symbols, imports, complexity (via tree-sitter) |
|
|
64
48
|
| **Semantic** | Gemini | Architecture insights, pattern detection |
|
|
65
49
|
|
|
66
|
-
|
|
50
|
+
Results include expandable sections — you only pay for what you drill into.
|
|
67
51
|
|
|
68
|
-
##
|
|
52
|
+
## CLI
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
54
|
+
```bash
|
|
55
|
+
npx codebase-analyzer-mcp analyze . # Standard analysis
|
|
56
|
+
npx codebase-analyzer-mcp analyze . -d surface # Fast, free overview
|
|
57
|
+
npx codebase-analyzer-mcp analyze . -d deep -s # Full semantic analysis
|
|
58
|
+
npx codebase-analyzer-mcp analyze . -o analysis.md # Write structured markdown to file
|
|
59
|
+
npx codebase-analyzer-mcp analyze . -o analysis.json # Write JSON to file
|
|
60
|
+
npx codebase-analyzer-mcp query . "how is auth handled?" # Ask a question
|
|
61
|
+
npx codebase-analyzer-mcp patterns . # Find design patterns
|
|
62
|
+
npx codebase-analyzer-mcp dataflow . "user login" # Trace data flow
|
|
63
|
+
```
|
|
79
64
|
|
|
80
|
-
##
|
|
65
|
+
## Usage with Claude Code
|
|
81
66
|
|
|
82
|
-
|
|
67
|
+
Dump an analysis and reference it from your CLAUDE.md:
|
|
83
68
|
|
|
84
|
-
```
|
|
85
|
-
|
|
69
|
+
```bash
|
|
70
|
+
npx codebase-analyzer-mcp analyze . -o docs/codebase-analysis.md
|
|
86
71
|
```
|
|
87
72
|
|
|
88
|
-
|
|
73
|
+
Then add to your project's CLAUDE.md:
|
|
89
74
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
| `dataflow-tracer` | Data flow tracing through systems |
|
|
95
|
-
| `codebase-explorer` | Quick exploration and Q&A |
|
|
75
|
+
```markdown
|
|
76
|
+
## Codebase Analysis
|
|
77
|
+
See [docs/codebase-analysis.md](docs/codebase-analysis.md) for full analysis.
|
|
78
|
+
```
|
|
96
79
|
|
|
97
|
-
|
|
80
|
+
Claude Code will read the summary (~50 lines) for context, then drill into specific module sections as needed using `Read` with offset/limit.
|
|
98
81
|
|
|
99
82
|
## Development
|
|
100
83
|
|
|
@@ -102,8 +85,7 @@ Agents are routed automatically based on your question.
|
|
|
102
85
|
git clone https://github.com/jaykaycodes/codebase-analyzer-mcp.git
|
|
103
86
|
cd codebase-analyzer-mcp
|
|
104
87
|
bun install
|
|
105
|
-
bun run build
|
|
106
|
-
bun run dev # Watch mode
|
|
88
|
+
bun run build
|
|
107
89
|
```
|
|
108
90
|
|
|
109
91
|
For local MCP testing, create `.mcp.json` at repo root:
|
package/dist/cli/index.js
CHANGED
|
@@ -44251,8 +44251,8 @@ var package_default;
|
|
|
44251
44251
|
var init_package = __esm(() => {
|
|
44252
44252
|
package_default = {
|
|
44253
44253
|
name: "codebase-analyzer-mcp",
|
|
44254
|
-
version: "2.
|
|
44255
|
-
description: "Multi-layer codebase analysis
|
|
44254
|
+
version: "2.3.0",
|
|
44255
|
+
description: "Multi-layer codebase analysis MCP server with Gemini AI and progressive disclosure.",
|
|
44256
44256
|
type: "module",
|
|
44257
44257
|
main: "dist/mcp/server.js",
|
|
44258
44258
|
packageManager: "bun@1.3.8",
|
|
@@ -44262,13 +44262,7 @@ var init_package = __esm(() => {
|
|
|
44262
44262
|
},
|
|
44263
44263
|
files: [
|
|
44264
44264
|
"dist/cli",
|
|
44265
|
-
"dist/mcp"
|
|
44266
|
-
"agents",
|
|
44267
|
-
"commands",
|
|
44268
|
-
"skills",
|
|
44269
|
-
".claude-plugin",
|
|
44270
|
-
"CLAUDE.md",
|
|
44271
|
-
"AGENTS.md"
|
|
44265
|
+
"dist/mcp"
|
|
44272
44266
|
],
|
|
44273
44267
|
scripts: {
|
|
44274
44268
|
build: "bun scripts/build.ts",
|
|
@@ -44277,7 +44271,7 @@ var init_package = __esm(() => {
|
|
|
44277
44271
|
typecheck: "tsc --noEmit",
|
|
44278
44272
|
test: "bun test",
|
|
44279
44273
|
cli: "bun src/cli/index.ts",
|
|
44280
|
-
version: "
|
|
44274
|
+
version: "git add .",
|
|
44281
44275
|
postversion: "git push --follow-tags",
|
|
44282
44276
|
prepublishOnly: "bun run build"
|
|
44283
44277
|
},
|
|
@@ -74135,7 +74129,7 @@ function extractSourceName3(source) {
|
|
|
74135
74129
|
}
|
|
74136
74130
|
var program2 = new Command;
|
|
74137
74131
|
program2.name("cba").description("Codebase Analyzer - Multi-layer repository analysis with Gemini AI").version(package_default.version);
|
|
74138
|
-
program2.command("analyze").description("Perform architectural analysis of a repository").argument("<source>", "Local path or GitHub URL").option("-d, --depth <depth>", "Analysis depth: surface, standard, deep", "standard").option("-f, --focus <areas...>", "Specific areas to focus on").option("-e, --exclude <patterns...>", "Glob patterns to exclude").option("-t, --token-budget <tokens>", "Maximum token budget", "800000").option("-s, --semantics", "Include deep semantic analysis (uses LLM)").option("-v, --verbose", "Show detailed progress and subagent activity").option("-q, --quiet", "Only output the final result (no progress)").option("--format <format>", "Output format (json or markdown)", "json").action(async (source, options) => {
|
|
74132
|
+
program2.command("analyze").description("Perform architectural analysis of a repository").argument("<source>", "Local path or GitHub URL").option("-d, --depth <depth>", "Analysis depth: surface, standard, deep", "standard").option("-f, --focus <areas...>", "Specific areas to focus on").option("-e, --exclude <patterns...>", "Glob patterns to exclude").option("-t, --token-budget <tokens>", "Maximum token budget", "800000").option("-s, --semantics", "Include deep semantic analysis (uses LLM)").option("-v, --verbose", "Show detailed progress and subagent activity").option("-q, --quiet", "Only output the final result (no progress)").option("--format <format>", "Output format (json or markdown)", "json").option("-o, --output <path>", "Write analysis to a file (markdown by default, .json for JSON)").action(async (source, options) => {
|
|
74139
74133
|
try {
|
|
74140
74134
|
if (options.verbose)
|
|
74141
74135
|
logger.setVerbose(true);
|
|
@@ -74152,7 +74146,12 @@ program2.command("analyze").description("Perform architectural analysis of a rep
|
|
|
74152
74146
|
includeSemantics: options.semantics,
|
|
74153
74147
|
sourceName
|
|
74154
74148
|
});
|
|
74155
|
-
if (options.
|
|
74149
|
+
if (options.output) {
|
|
74150
|
+
const { writeFile: writeFile2 } = await import("fs/promises");
|
|
74151
|
+
const content = options.output.endsWith(".json") ? JSON.stringify(result, null, 2) : formatAnalysisAsMarkdown(result);
|
|
74152
|
+
await writeFile2(options.output, content, "utf-8");
|
|
74153
|
+
console.error(`Analysis written to ${options.output}`);
|
|
74154
|
+
} else if (options.format === "markdown") {
|
|
74156
74155
|
console.log(formatAnalysisAsMarkdown(result));
|
|
74157
74156
|
} else {
|
|
74158
74157
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -74226,66 +74225,137 @@ program2.command("capabilities").description("Show available analysis capabiliti
|
|
|
74226
74225
|
const { formatCapabilitiesResponse: formatCapabilitiesResponse2 } = await Promise.resolve().then(() => (init_capabilities(), exports_capabilities));
|
|
74227
74226
|
console.log(JSON.stringify(formatCapabilitiesResponse2(), null, 2));
|
|
74228
74227
|
});
|
|
74228
|
+
function renderTree(node, depth, maxDepth) {
|
|
74229
|
+
const SKIP_DIRS = new Set(["node_modules", ".git", "dist", ".next", "__pycache__", ".cache", "coverage"]);
|
|
74230
|
+
const lines = [];
|
|
74231
|
+
const indent = " ".repeat(depth);
|
|
74232
|
+
if (depth > 0) {
|
|
74233
|
+
lines.push(`${indent}${node.name}${node.type === "directory" ? "/" : ""}`);
|
|
74234
|
+
}
|
|
74235
|
+
if (node.type === "directory" && node.children && depth < maxDepth) {
|
|
74236
|
+
const dirs = node.children.filter((c) => c.type === "directory" && !SKIP_DIRS.has(c.name)).sort((a, b) => a.name.localeCompare(b.name));
|
|
74237
|
+
const files = node.children.filter((c) => c.type === "file").sort((a, b) => a.name.localeCompare(b.name));
|
|
74238
|
+
for (const dir of dirs) {
|
|
74239
|
+
lines.push(...renderTree(dir, depth + 1, maxDepth));
|
|
74240
|
+
}
|
|
74241
|
+
if (depth === 0 || files.length <= 5) {
|
|
74242
|
+
for (const file2 of files) {
|
|
74243
|
+
lines.push(`${" ".repeat(depth + 1)}${file2.name}`);
|
|
74244
|
+
}
|
|
74245
|
+
} else if (files.length > 5) {
|
|
74246
|
+
lines.push(`${" ".repeat(depth + 1)}... ${files.length} files`);
|
|
74247
|
+
}
|
|
74248
|
+
}
|
|
74249
|
+
return lines;
|
|
74250
|
+
}
|
|
74229
74251
|
function formatAnalysisAsMarkdown(result) {
|
|
74230
74252
|
const lines = [];
|
|
74231
|
-
|
|
74253
|
+
const name = result.repositoryMap?.name || "Repository";
|
|
74254
|
+
const date6 = new Date().toISOString().split("T")[0];
|
|
74255
|
+
lines.push(`<!-- codebase-analyzer-mcp | ${date6} | depth: ${result.depth} | id: ${result.analysisId} -->`);
|
|
74232
74256
|
lines.push("");
|
|
74233
|
-
lines.push(
|
|
74234
|
-
lines.push(`**Depth:** ${result.depth}`);
|
|
74235
|
-
lines.push(`**Duration:** ${result.durationMs}ms`);
|
|
74257
|
+
lines.push(`# ${name}`);
|
|
74236
74258
|
lines.push("");
|
|
74237
|
-
if (result.
|
|
74238
|
-
lines.push(
|
|
74239
|
-
lines.push(
|
|
74240
|
-
|
|
74241
|
-
|
|
74242
|
-
|
|
74259
|
+
if (result.forAgent?.quickSummary) {
|
|
74260
|
+
lines.push(result.forAgent.quickSummary);
|
|
74261
|
+
lines.push("");
|
|
74262
|
+
}
|
|
74263
|
+
const repoMap = result.repositoryMap;
|
|
74264
|
+
const summary = result.summary;
|
|
74265
|
+
if (repoMap || summary) {
|
|
74266
|
+
lines.push("## Overview");
|
|
74267
|
+
lines.push("");
|
|
74268
|
+
lines.push("| Metric | Value |");
|
|
74269
|
+
lines.push("|--------|-------|");
|
|
74270
|
+
if (repoMap?.fileCount != null) {
|
|
74271
|
+
lines.push(`| Files | ${repoMap.fileCount} |`);
|
|
74272
|
+
}
|
|
74273
|
+
if (repoMap?.languages?.length > 0) {
|
|
74274
|
+
const langs = repoMap.languages.map((l) => `${l.language} (${l.percentage}%)`).join(", ");
|
|
74275
|
+
lines.push(`| Languages | ${langs} |`);
|
|
74276
|
+
}
|
|
74277
|
+
if (summary?.architectureType) {
|
|
74278
|
+
lines.push(`| Architecture | ${summary.architectureType} |`);
|
|
74279
|
+
}
|
|
74280
|
+
if (summary?.complexity) {
|
|
74281
|
+
lines.push(`| Complexity | ${summary.complexity} |`);
|
|
74282
|
+
}
|
|
74283
|
+
if (repoMap?.entryPoints?.length > 0) {
|
|
74284
|
+
lines.push(`| Entry points | ${repoMap.entryPoints.slice(0, 5).join(", ")} |`);
|
|
74243
74285
|
}
|
|
74244
|
-
if (
|
|
74245
|
-
lines.push(
|
|
74286
|
+
if (summary?.techStack?.length > 0) {
|
|
74287
|
+
lines.push(`| Tech stack | ${summary.techStack.join(", ")} |`);
|
|
74288
|
+
}
|
|
74289
|
+
if (summary?.primaryPatterns?.length > 0) {
|
|
74290
|
+
lines.push(`| Patterns | ${summary.primaryPatterns.join(", ")} |`);
|
|
74246
74291
|
}
|
|
74247
74292
|
lines.push("");
|
|
74248
74293
|
}
|
|
74249
|
-
if (result.
|
|
74250
|
-
lines.push("##
|
|
74251
|
-
lines.push(`- **Total Files:** ${result.repositoryMap.fileCount}`);
|
|
74252
|
-
lines.push(`- **Estimated Tokens:** ${result.repositoryMap.estimatedTokens}`);
|
|
74253
|
-
lines.push(`- **Languages:** ${result.repositoryMap.languages?.map((l) => `${l.language} (${l.percentage}%)`).join(", ")}`);
|
|
74254
|
-
lines.push(`- **Entry Points:** ${result.repositoryMap.entryPoints?.slice(0, 5).join(", ")}`);
|
|
74294
|
+
if (result.forAgent?.keyInsights?.length > 0) {
|
|
74295
|
+
lines.push("## Key Insights");
|
|
74255
74296
|
lines.push("");
|
|
74256
|
-
|
|
74257
|
-
|
|
74258
|
-
lines.push("## Sections");
|
|
74259
|
-
for (const section of result.sections) {
|
|
74260
|
-
lines.push(`### ${section.title}`);
|
|
74261
|
-
lines.push(section.summary);
|
|
74262
|
-
if (section.canExpand) {
|
|
74263
|
-
lines.push(`*Expandable (detail: ~${section.expansionCost?.detail} tokens, full: ~${section.expansionCost?.full} tokens)*`);
|
|
74264
|
-
}
|
|
74265
|
-
lines.push("");
|
|
74297
|
+
for (const insight of result.forAgent.keyInsights) {
|
|
74298
|
+
lines.push(`- ${insight}`);
|
|
74266
74299
|
}
|
|
74300
|
+
lines.push("");
|
|
74267
74301
|
}
|
|
74268
|
-
if (
|
|
74269
|
-
lines.push("##
|
|
74270
|
-
lines.push(result.forAgent.quickSummary);
|
|
74302
|
+
if (repoMap?.structure) {
|
|
74303
|
+
lines.push("## Structure");
|
|
74271
74304
|
lines.push("");
|
|
74272
|
-
|
|
74273
|
-
|
|
74274
|
-
|
|
74275
|
-
|
|
74276
|
-
|
|
74305
|
+
lines.push("```");
|
|
74306
|
+
const treeLines = renderTree(repoMap.structure, 0, 3);
|
|
74307
|
+
lines.push(...treeLines);
|
|
74308
|
+
lines.push("```");
|
|
74309
|
+
lines.push("");
|
|
74310
|
+
}
|
|
74311
|
+
const moduleSections = result.sections?.filter((s2) => s2.type === "module") || [];
|
|
74312
|
+
if (moduleSections.length > 0) {
|
|
74313
|
+
lines.push("## Modules");
|
|
74314
|
+
lines.push("");
|
|
74315
|
+
for (const section of moduleSections) {
|
|
74316
|
+
const modulePath = section.id.replace("module_", "").replace(/_/g, "/");
|
|
74317
|
+
const detail = section.detail;
|
|
74318
|
+
let header = `### ${modulePath}`;
|
|
74319
|
+
const meta3 = [];
|
|
74320
|
+
if (section.summary)
|
|
74321
|
+
meta3.push(section.summary);
|
|
74322
|
+
if (meta3.length)
|
|
74323
|
+
header += ` — ${meta3.join(", ")}`;
|
|
74324
|
+
lines.push(header);
|
|
74277
74325
|
lines.push("");
|
|
74278
|
-
|
|
74279
|
-
|
|
74280
|
-
|
|
74281
|
-
|
|
74282
|
-
|
|
74326
|
+
if (detail) {
|
|
74327
|
+
if (detail.type === "documentation") {
|
|
74328
|
+
if (detail.headings?.length > 0) {
|
|
74329
|
+
lines.push(`Headings: ${detail.headings.map((h2) => h2.title).join(", ")}`);
|
|
74330
|
+
}
|
|
74331
|
+
} else {
|
|
74332
|
+
if (detail.exports?.length > 0) {
|
|
74333
|
+
lines.push(`Exports: ${detail.exports.slice(0, 10).join(", ")}${detail.exports.length > 10 ? ", ..." : ""}`);
|
|
74334
|
+
}
|
|
74335
|
+
const cx = detail.complexity;
|
|
74336
|
+
if (cx) {
|
|
74337
|
+
lines.push(`Complexity: ${cx.cyclomaticComplexity} cyclomatic | ${cx.linesOfCode} LOC | ${cx.functionCount} functions | ${cx.classCount} classes`);
|
|
74338
|
+
}
|
|
74339
|
+
if (detail.symbolCount != null || detail.importCount != null) {
|
|
74340
|
+
lines.push(`Symbols: ${detail.symbolCount ?? 0} | Imports: ${detail.importCount ?? 0}`);
|
|
74341
|
+
}
|
|
74342
|
+
}
|
|
74343
|
+
lines.push("");
|
|
74283
74344
|
}
|
|
74345
|
+
}
|
|
74346
|
+
}
|
|
74347
|
+
const otherSections = result.sections?.filter((s2) => s2.type !== "module") || [];
|
|
74348
|
+
if (otherSections.length > 0) {
|
|
74349
|
+
for (const section of otherSections) {
|
|
74350
|
+
lines.push(`## ${section.title}`);
|
|
74351
|
+
lines.push("");
|
|
74352
|
+
lines.push(section.summary);
|
|
74284
74353
|
lines.push("");
|
|
74285
74354
|
}
|
|
74286
74355
|
}
|
|
74287
74356
|
if (result.warnings?.length > 0) {
|
|
74288
74357
|
lines.push("## Warnings");
|
|
74358
|
+
lines.push("");
|
|
74289
74359
|
for (const warning of result.warnings) {
|
|
74290
74360
|
lines.push(`- ${warning}`);
|
|
74291
74361
|
}
|
package/dist/mcp/server.js
CHANGED
|
@@ -71136,8 +71136,8 @@ function buildFallbackAnswer(question, analysisId, cached2, scored, fileContents
|
|
|
71136
71136
|
// package.json
|
|
71137
71137
|
var package_default = {
|
|
71138
71138
|
name: "codebase-analyzer-mcp",
|
|
71139
|
-
version: "2.
|
|
71140
|
-
description: "Multi-layer codebase analysis
|
|
71139
|
+
version: "2.3.0",
|
|
71140
|
+
description: "Multi-layer codebase analysis MCP server with Gemini AI and progressive disclosure.",
|
|
71141
71141
|
type: "module",
|
|
71142
71142
|
main: "dist/mcp/server.js",
|
|
71143
71143
|
packageManager: "bun@1.3.8",
|
|
@@ -71147,13 +71147,7 @@ var package_default = {
|
|
|
71147
71147
|
},
|
|
71148
71148
|
files: [
|
|
71149
71149
|
"dist/cli",
|
|
71150
|
-
"dist/mcp"
|
|
71151
|
-
"agents",
|
|
71152
|
-
"commands",
|
|
71153
|
-
"skills",
|
|
71154
|
-
".claude-plugin",
|
|
71155
|
-
"CLAUDE.md",
|
|
71156
|
-
"AGENTS.md"
|
|
71150
|
+
"dist/mcp"
|
|
71157
71151
|
],
|
|
71158
71152
|
scripts: {
|
|
71159
71153
|
build: "bun scripts/build.ts",
|
|
@@ -71162,7 +71156,7 @@ var package_default = {
|
|
|
71162
71156
|
typecheck: "tsc --noEmit",
|
|
71163
71157
|
test: "bun test",
|
|
71164
71158
|
cli: "bun src/cli/index.ts",
|
|
71165
|
-
version: "
|
|
71159
|
+
version: "git add .",
|
|
71166
71160
|
postversion: "git push --follow-tags",
|
|
71167
71161
|
prepublishOnly: "bun run build"
|
|
71168
71162
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-analyzer-mcp",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Multi-layer codebase analysis
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "Multi-layer codebase analysis MCP server with Gemini AI and progressive disclosure.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/mcp/server.js",
|
|
7
7
|
"packageManager": "bun@1.3.8",
|
|
@@ -11,13 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist/cli",
|
|
14
|
-
"dist/mcp"
|
|
15
|
-
"agents",
|
|
16
|
-
"commands",
|
|
17
|
-
"skills",
|
|
18
|
-
".claude-plugin",
|
|
19
|
-
"CLAUDE.md",
|
|
20
|
-
"AGENTS.md"
|
|
14
|
+
"dist/mcp"
|
|
21
15
|
],
|
|
22
16
|
"scripts": {
|
|
23
17
|
"build": "bun scripts/build.ts",
|
|
@@ -26,7 +20,7 @@
|
|
|
26
20
|
"typecheck": "tsc --noEmit",
|
|
27
21
|
"test": "bun test",
|
|
28
22
|
"cli": "bun src/cli/index.ts",
|
|
29
|
-
"version": "
|
|
23
|
+
"version": "git add .",
|
|
30
24
|
"postversion": "git push --follow-tags",
|
|
31
25
|
"prepublishOnly": "bun run build"
|
|
32
26
|
},
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "codebase-analyzer",
|
|
3
|
-
"owner": {
|
|
4
|
-
"name": "Jake Correa",
|
|
5
|
-
"url": "https://github.com/jaykaycodes"
|
|
6
|
-
},
|
|
7
|
-
"metadata": {
|
|
8
|
-
"description": "Multi-layer codebase analysis tools",
|
|
9
|
-
"version": "2.1.2"
|
|
10
|
-
},
|
|
11
|
-
"plugins": [
|
|
12
|
-
{
|
|
13
|
-
"name": "codebase-analyzer",
|
|
14
|
-
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents, 1 command, 1 skill for architecture analysis, pattern detection, and dataflow tracing.",
|
|
15
|
-
"version": "2.1.2",
|
|
16
|
-
"author": {
|
|
17
|
-
"name": "Jake Correa",
|
|
18
|
-
"url": "https://github.com/jaykaycodes"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://github.com/jaykaycodes/codebase-analyzer-mcp",
|
|
21
|
-
"tags": [
|
|
22
|
-
"codebase-analysis",
|
|
23
|
-
"architecture",
|
|
24
|
-
"patterns",
|
|
25
|
-
"gemini",
|
|
26
|
-
"mcp"
|
|
27
|
-
],
|
|
28
|
-
"source": {
|
|
29
|
-
"source": "github",
|
|
30
|
-
"repo": "jaykaycodes/codebase-analyzer-mcp"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "codebase-analyzer",
|
|
3
|
-
"version": "2.1.2",
|
|
4
|
-
"description": "Multi-layer codebase analysis with Gemini AI. 4 agents, 1 command, 1 skill for architecture analysis, pattern detection, and dataflow tracing.",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Jake Correa",
|
|
7
|
-
"url": "https://github.com/jaykaycodes"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://github.com/jaykaycodes/codebase-analyzer-mcp",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"codebase-analysis",
|
|
13
|
-
"architecture",
|
|
14
|
-
"patterns",
|
|
15
|
-
"gemini",
|
|
16
|
-
"mcp",
|
|
17
|
-
"progressive-disclosure",
|
|
18
|
-
"tree-sitter"
|
|
19
|
-
],
|
|
20
|
-
"mcpServers": {
|
|
21
|
-
"codebase-analyzer": {
|
|
22
|
-
"type": "stdio",
|
|
23
|
-
"command": "node",
|
|
24
|
-
"args": [
|
|
25
|
-
"${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js"
|
|
26
|
-
],
|
|
27
|
-
"env": {
|
|
28
|
-
"GEMINI_API_KEY": "${GEMINI_API_KEY}"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
package/AGENTS.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# Agent Instructions
|
|
2
|
-
|
|
3
|
-
This repository is both an MCP server and a Claude plugin for multi-layer codebase analysis.
|
|
4
|
-
|
|
5
|
-
## Working Agreement
|
|
6
|
-
|
|
7
|
-
- **Branching:** Feature branches for non-trivial changes
|
|
8
|
-
- **Safety:** No destructive git commands, no deleting user data
|
|
9
|
-
- **Testing:** Run `pnpm build` after changes - TypeScript errors break everything
|
|
10
|
-
- **Architecture:** Respect layer separation (surface → structural → semantic)
|
|
11
|
-
- **Counts:** When adding agents/commands/skills, update plugin.json description
|
|
12
|
-
|
|
13
|
-
## Repository Structure
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
codebase-analyzer-mcp/
|
|
17
|
-
├── .claude-plugin/
|
|
18
|
-
│ └── plugin.json # Plugin metadata
|
|
19
|
-
├── agents/
|
|
20
|
-
│ ├── analysis/ # Analysis agents
|
|
21
|
-
│ └── research/ # Research agents
|
|
22
|
-
├── commands/ # Slash commands
|
|
23
|
-
├── skills/ # Context-loaded skills
|
|
24
|
-
├── src/
|
|
25
|
-
│ ├── mcp/ # MCP server + tools
|
|
26
|
-
│ ├── cli/ # CLI interface
|
|
27
|
-
│ └── core/ # Analysis engine
|
|
28
|
-
│ └── layers/ # Surface, structural, semantic
|
|
29
|
-
└── docs/ # Documentation
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Key Decisions
|
|
33
|
-
|
|
34
|
-
| Decision | Rationale |
|
|
35
|
-
|----------|-----------|
|
|
36
|
-
| Gemini for semantic | Keep Claude context clean |
|
|
37
|
-
| Tree-sitter for parsing | Fast AST without LLM |
|
|
38
|
-
| Progressive disclosure | Minimize initial context cost |
|
|
39
|
-
| Plugin + MCP | Both distribution paths |
|
|
40
|
-
|
|
41
|
-
## Layer Responsibilities
|
|
42
|
-
|
|
43
|
-
**Surface Layer** (`src/core/layers/surface.ts`)
|
|
44
|
-
- File enumeration, language detection
|
|
45
|
-
- Entry points, module identification
|
|
46
|
-
- NO LLM calls
|
|
47
|
-
|
|
48
|
-
**Structural Layer** (`src/core/layers/structural.ts`)
|
|
49
|
-
- Tree-sitter parsing
|
|
50
|
-
- Symbol extraction
|
|
51
|
-
- Import/export mapping
|
|
52
|
-
- NO LLM calls
|
|
53
|
-
|
|
54
|
-
**Semantic Layer** (`src/core/layers/semantic.ts`)
|
|
55
|
-
- Gemini API calls
|
|
56
|
-
- Architecture detection
|
|
57
|
-
- Pattern recognition
|
|
58
|
-
- EXPENSIVE - opt-in only
|
|
59
|
-
|
|
60
|
-
## Code Patterns
|
|
61
|
-
|
|
62
|
-
**Partial failures:** Capture in `warnings[]` or `partialFailures[]`, don't throw
|
|
63
|
-
|
|
64
|
-
**Token budget:** Check before expensive operations, warn if exceeded
|
|
65
|
-
|
|
66
|
-
**Logging:** Use `logger` from `src/core/logger.ts`
|
|
67
|
-
|
|
68
|
-
## Plugin Component Guidelines
|
|
69
|
-
|
|
70
|
-
### Agents
|
|
71
|
-
|
|
72
|
-
- Place in `agents/[category]/` by purpose
|
|
73
|
-
- YAML frontmatter: `name`, `description` with examples
|
|
74
|
-
- Description explains when to use the agent
|
|
75
|
-
- Use haiku model for efficiency
|
|
76
|
-
|
|
77
|
-
### Commands
|
|
78
|
-
|
|
79
|
-
- Place in `commands/`
|
|
80
|
-
- Set `user-invocable: true`
|
|
81
|
-
- Document usage, options, examples
|
|
82
|
-
- Show workflow and implementation
|
|
83
|
-
|
|
84
|
-
### Skills
|
|
85
|
-
|
|
86
|
-
- Directory in `skills/[name]/`
|
|
87
|
-
- SKILL.md is entry point (<500 lines)
|
|
88
|
-
- references/ for detailed docs
|
|
89
|
-
- Description in third person
|
|
90
|
-
|
|
91
|
-
## Updating Plugin Counts
|
|
92
|
-
|
|
93
|
-
After adding/removing components:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Count components
|
|
97
|
-
ls agents/**/*.md | wc -l # agents
|
|
98
|
-
ls commands/*.md | wc -l # commands
|
|
99
|
-
ls -d skills/*/ | wc -l # skills
|
|
100
|
-
|
|
101
|
-
# Update description in .claude-plugin/plugin.json
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Format: `"X agents, Y commands, Z skills"`
|
|
105
|
-
|
|
106
|
-
## Testing Checklist
|
|
107
|
-
|
|
108
|
-
- [ ] `pnpm build` succeeds
|
|
109
|
-
- [ ] `pnpm cba capabilities` returns JSON
|
|
110
|
-
- [ ] `pnpm cba analyze . -d surface -q` works
|
|
111
|
-
- [ ] New agent/command/skill follows patterns
|
|
112
|
-
- [ ] plugin.json counts match actual files
|