codebase-analyzer-mcp 2.1.2 → 2.2.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.
@@ -1,268 +0,0 @@
1
- # API Reference
2
-
3
- Complete reference for codebase-analyzer MCP tools.
4
-
5
- ## analyze_repo
6
-
7
- Full architectural analysis with progressive disclosure.
8
-
9
- ### Parameters
10
-
11
- | Parameter | Type | Required | Default | Description |
12
- |-----------|------|----------|---------|-------------|
13
- | `source` | string | Yes | - | Local path or GitHub URL |
14
- | `depth` | enum | No | "standard" | surface, standard, deep |
15
- | `focus` | string[] | No | - | Paths to focus on |
16
- | `exclude` | string[] | No | - | Glob patterns to exclude |
17
- | `tokenBudget` | number | No | 800000 | Max tokens for analysis |
18
- | `includeSemantics` | boolean | No | false | Enable LLM analysis |
19
-
20
- ### Response
21
-
22
- ```typescript
23
- {
24
- analysisId: string; // Use for expand_section, read_files
25
- version: 2;
26
- timestamp: string;
27
- source: string;
28
- depth: "surface" | "standard" | "deep";
29
- tokenCost: number;
30
- durationMs: number;
31
-
32
- repositoryMap: {
33
- name: string;
34
- languages: Array<{
35
- language: string;
36
- fileCount: number;
37
- percentage: number;
38
- extensions: string[];
39
- }>;
40
- fileCount: number;
41
- totalSize: number;
42
- estimatedTokens: number;
43
- entryPoints: string[];
44
- structure: DirectoryNode;
45
- readme?: string;
46
- };
47
-
48
- summary: {
49
- architectureType: string;
50
- primaryPatterns: string[];
51
- techStack: string[];
52
- complexity: "low" | "medium" | "high";
53
- };
54
-
55
- sections: Array<{
56
- id: string;
57
- title: string;
58
- type: "module" | "pattern" | "datamodel" | "api" | "custom";
59
- summary: string;
60
- canExpand: boolean;
61
- expansionCost: {
62
- detail: number;
63
- full: number;
64
- };
65
- }>;
66
-
67
- forAgent: {
68
- quickSummary: string;
69
- keyInsights: string[];
70
- suggestedNextSteps: string[];
71
- };
72
-
73
- warnings?: string[];
74
- partialFailures?: Array<{
75
- layer: string;
76
- error: string;
77
- }>;
78
- }
79
- ```
80
-
81
- ## expand_section
82
-
83
- Expand a section from previous analysis.
84
-
85
- ### Parameters
86
-
87
- | Parameter | Type | Required | Description |
88
- |-----------|------|----------|-------------|
89
- | `analysisId` | string | Yes | From analyze_repo result |
90
- | `sectionId` | string | Yes | Section ID to expand |
91
- | `depth` | enum | No | "detail" or "full" (default: detail) |
92
-
93
- ### Response
94
-
95
- ```typescript
96
- {
97
- section: ExpandableSection | null;
98
- error?: string;
99
- }
100
- ```
101
-
102
- ## find_patterns
103
-
104
- Detect patterns in codebase.
105
-
106
- ### Parameters
107
-
108
- | Parameter | Type | Required | Description |
109
- |-----------|------|----------|-------------|
110
- | `source` | string | Yes | Local path or GitHub URL |
111
- | `patternTypes` | string[] | No | Filter to specific patterns |
112
-
113
- ### Available Pattern Types
114
-
115
- **Design Patterns:**
116
- - `singleton` - Single instance pattern
117
- - `factory` - Object creation abstraction
118
- - `observer` - Event subscription pattern
119
- - `strategy` - Interchangeable algorithms
120
- - `decorator` - Dynamic behavior extension
121
- - `adapter` - Interface compatibility
122
- - `facade` - Simplified interface
123
- - `repository` - Data access abstraction
124
- - `dependency-injection` - Inversion of control
125
-
126
- **Architectural Patterns:**
127
- - `event-driven` - Event-based architecture
128
- - `pub-sub` - Publish-subscribe messaging
129
- - `middleware` - Request processing chain
130
- - `mvc` - Model-View-Controller
131
- - `mvvm` - Model-View-ViewModel
132
- - `clean-architecture` - Dependency rule layers
133
- - `hexagonal` - Ports and adapters
134
- - `cqrs` - Command Query Responsibility Segregation
135
- - `saga` - Distributed transaction pattern
136
-
137
- ### Response
138
-
139
- ```typescript
140
- {
141
- patterns: Array<{
142
- name: string;
143
- type: "architectural" | "design" | "anti-pattern";
144
- confidence: number; // 0-1
145
- locations: string[]; // File paths
146
- description: string;
147
- }>;
148
- summary: string;
149
- }
150
- ```
151
-
152
- ## trace_dataflow
153
-
154
- Trace data flow through the system.
155
-
156
- ### Parameters
157
-
158
- | Parameter | Type | Required | Description |
159
- |-----------|------|----------|-------------|
160
- | `source` | string | Yes | Local path or GitHub URL |
161
- | `from` | string | Yes | Entry point (function, file, or description) |
162
- | `to` | string | No | Destination to trace to |
163
-
164
- ### Response
165
-
166
- ```typescript
167
- {
168
- entryPoint: string;
169
- destination?: string;
170
- steps: Array<{
171
- location: string;
172
- operation: string;
173
- dataShape?: string;
174
- }>;
175
- securityObservations: string[];
176
- recommendations: string[];
177
- }
178
- ```
179
-
180
- ## read_files
181
-
182
- Read specific files from a previously analyzed repository. Uses the cached clone so you don't need to re-analyze or re-clone.
183
-
184
- ### Parameters
185
-
186
- | Parameter | Type | Required | Default | Description |
187
- |-----------|------|----------|---------|-------------|
188
- | `analysisId` | string | Yes | - | From analyze_repo or query_repo result |
189
- | `paths` | string[] | Yes | - | Relative file paths (min 1, max 20) |
190
- | `maxLines` | number | No | 500 | Max lines per file (max 2000) |
191
-
192
- ### Response
193
-
194
- ```typescript
195
- {
196
- analysisId: string;
197
- files: Array<{
198
- path: string;
199
- content?: string; // File content (if readable)
200
- lineCount?: number; // Total lines in file
201
- truncated?: boolean; // True if content was truncated
202
- error?: string; // Error message (if not readable)
203
- }>;
204
- }
205
- ```
206
-
207
- ### Notes
208
-
209
- - Paths must be relative to the repository root
210
- - Path traversal (../) is blocked for security
211
- - Works with both local repos and GitHub clones
212
- - Cache expires after 1 hour — re-run analyze_repo or query_repo if expired
213
-
214
- ## query_repo
215
-
216
- Ask a question about a codebase and get an AI-powered answer with relevant file references.
217
-
218
- ### Parameters
219
-
220
- | Parameter | Type | Required | Description |
221
- |-----------|------|----------|-------------|
222
- | `source` | string | Yes | Local path or GitHub URL |
223
- | `question` | string | Yes | Question about the codebase |
224
-
225
- ### Response
226
-
227
- ```typescript
228
- {
229
- answer: string; // Detailed answer referencing code
230
- relevantFiles: Array<{
231
- path: string; // Relative file path
232
- reason: string; // Why this file is relevant
233
- }>;
234
- confidence: "high" | "medium" | "low";
235
- analysisId: string; // Use for follow-up read_files
236
- suggestedFollowUps: string[];
237
- }
238
- ```
239
-
240
- ### Notes
241
-
242
- - Reuses cached analysis when available (fast for repeated queries on same repo)
243
- - With `GEMINI_API_KEY`: AI-powered answer using structural analysis + file contents
244
- - Without `GEMINI_API_KEY`: keyword-matching fallback with pointers to relevant files
245
- - The `analysisId` enables follow-up `read_files` calls to examine code in detail
246
-
247
- ## get_analysis_capabilities
248
-
249
- List available analysis options.
250
-
251
- ### Parameters
252
-
253
- None.
254
-
255
- ### Response
256
-
257
- ```typescript
258
- {
259
- layers: string[];
260
- depths: string[];
261
- supportedLanguages: string[];
262
- tools: Array<{
263
- name: string;
264
- description: string;
265
- parameters: string[];
266
- }>;
267
- }
268
- ```