@jahales/mcp-zoekt 2.2.3
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/LICENSE +190 -0
- package/README.md +400 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +83 -0
- package/dist/config.js.map +1 -0
- package/dist/errors/codes.d.ts +28 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/codes.js +161 -0
- package/dist/errors/codes.js.map +1 -0
- package/dist/formatting/repoList.d.ts +14 -0
- package/dist/formatting/repoList.d.ts.map +1 -0
- package/dist/formatting/repoList.js +55 -0
- package/dist/formatting/repoList.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +36 -0
- package/dist/logger.js.map +1 -0
- package/dist/pagination/cursor.d.ts +103 -0
- package/dist/pagination/cursor.d.ts.map +1 -0
- package/dist/pagination/cursor.js +136 -0
- package/dist/pagination/cursor.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +468 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/find-references.d.ts +53 -0
- package/dist/tools/find-references.d.ts.map +1 -0
- package/dist/tools/find-references.js +284 -0
- package/dist/tools/find-references.js.map +1 -0
- package/dist/tools/get-health.d.ts +37 -0
- package/dist/tools/get-health.d.ts.map +1 -0
- package/dist/tools/get-health.js +128 -0
- package/dist/tools/get-health.js.map +1 -0
- package/dist/tools/search-files.d.ts +58 -0
- package/dist/tools/search-files.d.ts.map +1 -0
- package/dist/tools/search-files.js +139 -0
- package/dist/tools/search-files.js.map +1 -0
- package/dist/tools/search-symbols.d.ts +49 -0
- package/dist/tools/search-symbols.d.ts.map +1 -0
- package/dist/tools/search-symbols.js +235 -0
- package/dist/tools/search-symbols.js.map +1 -0
- package/dist/zoekt/client.d.ts +51 -0
- package/dist/zoekt/client.d.ts.map +1 -0
- package/dist/zoekt/client.js +262 -0
- package/dist/zoekt/client.js.map +1 -0
- package/dist/zoekt/types.d.ts +208 -0
- package/dist/zoekt/types.d.ts.map +1 -0
- package/dist/zoekt/types.js +6 -0
- package/dist/zoekt/types.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a Go date string, treating Go zero-value dates as undefined.
|
|
3
|
+
* Go's zero time is 0001-01-01T00:00:00Z.
|
|
4
|
+
*/
|
|
5
|
+
function parseGoDate(dateStr) {
|
|
6
|
+
if (!dateStr || dateStr.startsWith('0001-01-01')) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const date = new Date(dateStr);
|
|
10
|
+
if (isNaN(date.getTime())) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return date;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom error class for Zoekt-related errors
|
|
17
|
+
*/
|
|
18
|
+
export class ZoektError extends Error {
|
|
19
|
+
code;
|
|
20
|
+
statusCode;
|
|
21
|
+
constructor(message, code, statusCode) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = 'ZoektError';
|
|
24
|
+
this.code = code;
|
|
25
|
+
this.statusCode = statusCode;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* HTTP client for Zoekt webserver API
|
|
30
|
+
*/
|
|
31
|
+
export class ZoektClient {
|
|
32
|
+
baseUrl;
|
|
33
|
+
timeoutMs;
|
|
34
|
+
constructor(baseUrl, timeoutMs = 30000) {
|
|
35
|
+
// Remove trailing slash if present
|
|
36
|
+
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
37
|
+
this.timeoutMs = timeoutMs;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Search for code across indexed repositories
|
|
41
|
+
* Uses POST /api/search endpoint with JSON payload
|
|
42
|
+
*/
|
|
43
|
+
async search(query, options) {
|
|
44
|
+
const url = `${this.baseUrl}/api/search`;
|
|
45
|
+
const body = JSON.stringify({
|
|
46
|
+
Q: query,
|
|
47
|
+
Opts: {
|
|
48
|
+
NumContextLines: options.contextLines ?? 3,
|
|
49
|
+
MaxDocDisplayCount: options.limit ?? 30,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
try {
|
|
53
|
+
const response = await this.fetchWithTimeout(url, {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: { 'Content-Type': 'application/json' },
|
|
56
|
+
body,
|
|
57
|
+
});
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
const errorText = await response.text();
|
|
60
|
+
throw new ZoektError(`Query error: ${errorText || response.statusText}`, 'QUERY_ERROR', response.status);
|
|
61
|
+
}
|
|
62
|
+
// The /api/search endpoint returns { Result: SearchResult }
|
|
63
|
+
// Normalize Files -> FileMatches for consistent downstream usage
|
|
64
|
+
const data = await response.json();
|
|
65
|
+
const result = data.Result;
|
|
66
|
+
if (result && result.Files && !result.FileMatches) {
|
|
67
|
+
result.FileMatches = result.Files;
|
|
68
|
+
}
|
|
69
|
+
return { result };
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (error instanceof ZoektError) {
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
76
|
+
throw new ZoektError(`Search timed out after ${this.timeoutMs}ms. Try a more specific query.`, 'TIMEOUT');
|
|
77
|
+
}
|
|
78
|
+
throw new ZoektError(`Search backend unavailable at ${this.baseUrl}. Ensure zoekt-webserver is running.`, 'UNAVAILABLE');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* List indexed repositories
|
|
83
|
+
* Uses POST /api/list endpoint for complete, accurate results
|
|
84
|
+
*/
|
|
85
|
+
async listRepos(filter) {
|
|
86
|
+
// Validate and compile regex filter upfront if provided
|
|
87
|
+
let filterRegex;
|
|
88
|
+
if (filter) {
|
|
89
|
+
try {
|
|
90
|
+
filterRegex = new RegExp(filter, 'i');
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
throw new ZoektError(`Invalid filter pattern: '${filter}' is not a valid regular expression`, 'QUERY_ERROR');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const url = `${this.baseUrl}/api/list`;
|
|
97
|
+
const body = JSON.stringify({ Q: '' });
|
|
98
|
+
try {
|
|
99
|
+
const response = await this.fetchWithTimeout(url, {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: { 'Content-Type': 'application/json' },
|
|
102
|
+
body,
|
|
103
|
+
});
|
|
104
|
+
if (!response.ok) {
|
|
105
|
+
const errorText = await response.text();
|
|
106
|
+
throw new ZoektError(`Failed to list repositories: ${errorText || response.statusText}`, 'QUERY_ERROR', response.status);
|
|
107
|
+
}
|
|
108
|
+
const data = await response.json();
|
|
109
|
+
// Validate response shape so malformed responses don't appear as "no repos indexed"
|
|
110
|
+
const list = data?.List;
|
|
111
|
+
if (!list || (list.Repos !== null && !Array.isArray(list.Repos))) {
|
|
112
|
+
throw new ZoektError('Malformed /api/list response: missing or invalid List.Repos field', 'QUERY_ERROR');
|
|
113
|
+
}
|
|
114
|
+
const entries = list.Repos ?? [];
|
|
115
|
+
const repositories = entries.map((entry) => ({
|
|
116
|
+
name: entry.Repository.Name,
|
|
117
|
+
url: entry.Repository.URL ?? '',
|
|
118
|
+
branches: (entry.Repository.Branches ?? []).map((b) => ({
|
|
119
|
+
name: b.Name,
|
|
120
|
+
version: b.Version,
|
|
121
|
+
})),
|
|
122
|
+
hasSymbols: entry.Repository.HasSymbols ?? false,
|
|
123
|
+
documentCount: entry.Stats.Documents ?? 0,
|
|
124
|
+
contentBytes: entry.Stats.ContentBytes ?? 0,
|
|
125
|
+
indexBytes: entry.Stats.IndexBytes ?? 0,
|
|
126
|
+
indexTime: parseGoDate(entry.IndexMetadata.IndexTime),
|
|
127
|
+
latestCommitDate: parseGoDate(entry.Repository.LatestCommitDate),
|
|
128
|
+
}));
|
|
129
|
+
// Apply client-side filter if provided
|
|
130
|
+
if (filterRegex) {
|
|
131
|
+
return repositories.filter((repo) => filterRegex.test(repo.name));
|
|
132
|
+
}
|
|
133
|
+
return repositories;
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (error instanceof ZoektError) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
140
|
+
throw new ZoektError(`List repositories timed out after ${this.timeoutMs}ms.`, 'TIMEOUT');
|
|
141
|
+
}
|
|
142
|
+
throw new ZoektError(`Zoekt backend unavailable at ${this.baseUrl}/api/list. Ensure zoekt-webserver is running.`, 'UNAVAILABLE');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get file content from an indexed repository
|
|
147
|
+
*/
|
|
148
|
+
async getFileContent(repository, path, branch) {
|
|
149
|
+
const params = new URLSearchParams({
|
|
150
|
+
r: repository,
|
|
151
|
+
f: path,
|
|
152
|
+
format: 'raw',
|
|
153
|
+
});
|
|
154
|
+
if (branch) {
|
|
155
|
+
params.append('b', branch);
|
|
156
|
+
}
|
|
157
|
+
const url = `${this.baseUrl}/print?${params.toString()}`;
|
|
158
|
+
try {
|
|
159
|
+
const response = await this.fetchWithTimeout(url);
|
|
160
|
+
if (!response.ok) {
|
|
161
|
+
if (response.status === 404) {
|
|
162
|
+
throw new ZoektError(`File not found: ${repository}/${path}`, 'NOT_FOUND', 404);
|
|
163
|
+
}
|
|
164
|
+
const errorText = await response.text();
|
|
165
|
+
throw new ZoektError(`Failed to get file content: ${errorText || response.statusText}`, 'QUERY_ERROR', response.status);
|
|
166
|
+
}
|
|
167
|
+
return await response.text();
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (error instanceof ZoektError) {
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
throw new ZoektError(`Search backend unavailable at ${this.baseUrl}. Ensure zoekt-webserver is running.`, 'UNAVAILABLE');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Fetch with timeout support
|
|
178
|
+
*/
|
|
179
|
+
async fetchWithTimeout(url, options) {
|
|
180
|
+
const controller = new AbortController();
|
|
181
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
182
|
+
try {
|
|
183
|
+
const fetchOptions = {
|
|
184
|
+
method: options?.method ?? 'GET',
|
|
185
|
+
signal: controller.signal,
|
|
186
|
+
};
|
|
187
|
+
if (options?.headers) {
|
|
188
|
+
fetchOptions.headers = options.headers;
|
|
189
|
+
}
|
|
190
|
+
if (options?.body) {
|
|
191
|
+
fetchOptions.body = options.body;
|
|
192
|
+
}
|
|
193
|
+
const response = await fetch(url, fetchOptions);
|
|
194
|
+
return response;
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
clearTimeout(timeoutId);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Check Zoekt backend health via /healthz endpoint
|
|
202
|
+
*/
|
|
203
|
+
async checkHealth() {
|
|
204
|
+
const url = `${this.baseUrl}/healthz`;
|
|
205
|
+
try {
|
|
206
|
+
const response = await this.fetchWithTimeout(url);
|
|
207
|
+
if (!response.ok) {
|
|
208
|
+
const errorText = await response.text();
|
|
209
|
+
return { healthy: false, error: errorText || response.statusText };
|
|
210
|
+
}
|
|
211
|
+
// Parse response to confirm it's valid
|
|
212
|
+
await response.json();
|
|
213
|
+
return { healthy: true };
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
if (error instanceof Error) {
|
|
217
|
+
return { healthy: false, error: error.message };
|
|
218
|
+
}
|
|
219
|
+
return { healthy: false, error: 'Unknown error checking health' };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Get index statistics via POST /api/list endpoint
|
|
224
|
+
* Returns aggregate stats across all indexed repositories
|
|
225
|
+
*/
|
|
226
|
+
async getStats() {
|
|
227
|
+
const url = `${this.baseUrl}/api/list`;
|
|
228
|
+
const body = JSON.stringify({ Q: '' });
|
|
229
|
+
try {
|
|
230
|
+
const response = await this.fetchWithTimeout(url, {
|
|
231
|
+
method: 'POST',
|
|
232
|
+
headers: { 'Content-Type': 'application/json' },
|
|
233
|
+
body,
|
|
234
|
+
});
|
|
235
|
+
if (!response.ok) {
|
|
236
|
+
throw new ZoektError('Failed to get index stats', 'QUERY_ERROR', response.status);
|
|
237
|
+
}
|
|
238
|
+
const data = await response.json();
|
|
239
|
+
const stats = data?.List?.Stats;
|
|
240
|
+
if (!stats) {
|
|
241
|
+
throw new ZoektError('Malformed /api/list response: missing List.Stats field', 'QUERY_ERROR');
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
repositoryCount: stats.Repos ?? 0,
|
|
245
|
+
documentCount: stats.Documents ?? 0,
|
|
246
|
+
indexBytes: stats.IndexBytes ?? 0,
|
|
247
|
+
contentBytes: stats.ContentBytes ?? 0,
|
|
248
|
+
shardCount: stats.Shards ?? 0,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (error instanceof ZoektError) {
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
256
|
+
throw new ZoektError(`Get stats timed out after ${this.timeoutMs}ms.`, 'TIMEOUT');
|
|
257
|
+
}
|
|
258
|
+
throw new ZoektError(`Zoekt backend unavailable at ${this.baseUrl}/api/list. Ensure zoekt-webserver is running.`, 'UNAVAILABLE');
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceR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AI,EAAE,IAAI,EAAE,KAAK,CAAC;YAChC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,UAAU,CAClB,wDAAwD,EACxD,aAAa,CACd,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,eAAe,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;gBACjC,aAAa,EAAE,KAAK,CAAC,SAAS,IAAI,CAAC;gBACnC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,CAAC;gBACjC,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,CAAC;gBACrC,UAAU,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAChC,MAAM,KAAK,CAAC;YACd,CAAC;YACD,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBACjE,MAAM,IAAI,UAAU,CAClB,6BAA6B,IAAI,CAAC,SAAS,KAAK,EAChD,SAAS,CACV,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,UAAU,CAClB,gCAAgC,IAAI,CAAC,OAAO,+CAA+C,EAC3F,aAAa,CACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoekt API Types
|
|
3
|
+
* Based on zoekt-webserver JSON response format
|
|
4
|
+
*/
|
|
5
|
+
export interface SearchInput {
|
|
6
|
+
query: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
contextLines?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SearchResponse {
|
|
11
|
+
result: SearchResult;
|
|
12
|
+
}
|
|
13
|
+
export interface SearchResult {
|
|
14
|
+
FileMatches?: FileMatch[];
|
|
15
|
+
Files?: FileMatch[];
|
|
16
|
+
RepoURLs?: Record<string, string[]>;
|
|
17
|
+
Stats?: SearchStats;
|
|
18
|
+
MatchCount?: number;
|
|
19
|
+
FileCount?: number;
|
|
20
|
+
Duration?: number;
|
|
21
|
+
ContentBytesLoaded?: number;
|
|
22
|
+
IndexBytesLoaded?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface FileMatch {
|
|
25
|
+
Repository?: string;
|
|
26
|
+
Repo?: string;
|
|
27
|
+
FileName: string;
|
|
28
|
+
Branches?: string[];
|
|
29
|
+
Language: string;
|
|
30
|
+
ChunkMatches?: ChunkMatch[];
|
|
31
|
+
LineMatches?: LineMatch[];
|
|
32
|
+
}
|
|
33
|
+
export interface ChunkMatch {
|
|
34
|
+
Content: string;
|
|
35
|
+
ContentStart: ContentPosition;
|
|
36
|
+
Ranges?: MatchRange[];
|
|
37
|
+
FileName: boolean;
|
|
38
|
+
SymbolInfo?: (SymbolInfo | null)[];
|
|
39
|
+
}
|
|
40
|
+
export interface ContentPosition {
|
|
41
|
+
ByteOffset: number;
|
|
42
|
+
LineNumber: number;
|
|
43
|
+
Column: number;
|
|
44
|
+
}
|
|
45
|
+
export interface MatchRange {
|
|
46
|
+
Start: ContentPosition;
|
|
47
|
+
End: ContentPosition;
|
|
48
|
+
}
|
|
49
|
+
export interface LineMatch {
|
|
50
|
+
Line: string;
|
|
51
|
+
LineNumber: number;
|
|
52
|
+
LineStart: number;
|
|
53
|
+
LineEnd: number;
|
|
54
|
+
Before?: string;
|
|
55
|
+
After?: string;
|
|
56
|
+
FileName?: boolean;
|
|
57
|
+
Score?: number;
|
|
58
|
+
DebugScore?: string;
|
|
59
|
+
LineFragments?: LineFragment[];
|
|
60
|
+
}
|
|
61
|
+
export interface LineFragment {
|
|
62
|
+
LineOffset: number;
|
|
63
|
+
Offset: number;
|
|
64
|
+
MatchLength: number;
|
|
65
|
+
SymbolInfo?: SymbolInfo | null;
|
|
66
|
+
}
|
|
67
|
+
export interface SearchStats {
|
|
68
|
+
MatchCount: number;
|
|
69
|
+
FileCount: number;
|
|
70
|
+
Duration: number;
|
|
71
|
+
ContentBytesLoaded: number;
|
|
72
|
+
IndexBytesLoaded: number;
|
|
73
|
+
Crashes?: number;
|
|
74
|
+
FilesConsidered?: number;
|
|
75
|
+
FilesLoaded?: number;
|
|
76
|
+
FilesSkipped?: number;
|
|
77
|
+
ShardsScanned?: number;
|
|
78
|
+
ShardsSkipped?: number;
|
|
79
|
+
}
|
|
80
|
+
/** Top-level envelope from POST /api/list */
|
|
81
|
+
export interface ZoektListResponse {
|
|
82
|
+
List: ZoektRepoList;
|
|
83
|
+
}
|
|
84
|
+
export interface ZoektRepoList {
|
|
85
|
+
Repos: ZoektRepoListEntry[] | null;
|
|
86
|
+
Stats: ZoektRepoStats;
|
|
87
|
+
Crashes: number;
|
|
88
|
+
}
|
|
89
|
+
export interface ZoektRepoListEntry {
|
|
90
|
+
Repository: ZoektRepository;
|
|
91
|
+
IndexMetadata: ZoektIndexMetadata;
|
|
92
|
+
Stats: ZoektRepoStats;
|
|
93
|
+
}
|
|
94
|
+
/** Subset of Zoekt Repository fields we consume */
|
|
95
|
+
export interface ZoektRepository {
|
|
96
|
+
Name: string;
|
|
97
|
+
URL: string;
|
|
98
|
+
Branches: ZoektBranch[] | null;
|
|
99
|
+
HasSymbols: boolean;
|
|
100
|
+
LatestCommitDate: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ZoektBranch {
|
|
103
|
+
Name: string;
|
|
104
|
+
Version: string;
|
|
105
|
+
}
|
|
106
|
+
export interface ZoektIndexMetadata {
|
|
107
|
+
IndexTime: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ZoektRepoStats {
|
|
110
|
+
Repos: number;
|
|
111
|
+
Shards: number;
|
|
112
|
+
Documents: number;
|
|
113
|
+
IndexBytes: number;
|
|
114
|
+
ContentBytes: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ListReposInput {
|
|
117
|
+
filter?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface Branch {
|
|
120
|
+
name: string;
|
|
121
|
+
version: string;
|
|
122
|
+
}
|
|
123
|
+
export interface Repository {
|
|
124
|
+
name: string;
|
|
125
|
+
url: string;
|
|
126
|
+
branches: Branch[];
|
|
127
|
+
hasSymbols: boolean;
|
|
128
|
+
documentCount: number;
|
|
129
|
+
contentBytes: number;
|
|
130
|
+
indexBytes: number;
|
|
131
|
+
indexTime: Date | undefined;
|
|
132
|
+
latestCommitDate: Date | undefined;
|
|
133
|
+
}
|
|
134
|
+
export interface ListReposResponse {
|
|
135
|
+
repositories: Repository[];
|
|
136
|
+
total: number;
|
|
137
|
+
}
|
|
138
|
+
export interface FileContentInput {
|
|
139
|
+
repository: string;
|
|
140
|
+
path: string;
|
|
141
|
+
branch?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface FileContentResponse {
|
|
144
|
+
content: string;
|
|
145
|
+
repository: string;
|
|
146
|
+
path: string;
|
|
147
|
+
branch?: string;
|
|
148
|
+
}
|
|
149
|
+
export type SymbolKind = 'function' | 'class' | 'method' | 'variable' | 'interface' | 'type' | 'constant' | 'property' | 'unknown';
|
|
150
|
+
/** Symbol information from Zoekt's ctags integration */
|
|
151
|
+
export interface SymbolInfo {
|
|
152
|
+
/** Symbol name (e.g., "handleRequest") */
|
|
153
|
+
Sym: string;
|
|
154
|
+
/** Symbol type (e.g., "function", "class") */
|
|
155
|
+
Kind: string;
|
|
156
|
+
/** Parent symbol name (e.g., "UserService") */
|
|
157
|
+
Parent: string;
|
|
158
|
+
/** Parent symbol type */
|
|
159
|
+
ParentKind: string;
|
|
160
|
+
}
|
|
161
|
+
/** Parsed symbol with normalized types */
|
|
162
|
+
export interface Symbol {
|
|
163
|
+
name: string;
|
|
164
|
+
kind: SymbolKind;
|
|
165
|
+
parent?: string;
|
|
166
|
+
parentKind?: SymbolKind;
|
|
167
|
+
file: string;
|
|
168
|
+
repository: string;
|
|
169
|
+
line: number;
|
|
170
|
+
column: number;
|
|
171
|
+
}
|
|
172
|
+
/** Reference type for find_references */
|
|
173
|
+
export type ReferenceType = 'definition' | 'usage';
|
|
174
|
+
/** A location where a symbol is defined or used */
|
|
175
|
+
export interface ReferenceResult {
|
|
176
|
+
type: ReferenceType;
|
|
177
|
+
file: string;
|
|
178
|
+
repository: string;
|
|
179
|
+
line: number;
|
|
180
|
+
column: number;
|
|
181
|
+
context: string;
|
|
182
|
+
symbol?: Symbol;
|
|
183
|
+
}
|
|
184
|
+
export type HealthState = 'healthy' | 'degraded' | 'unhealthy';
|
|
185
|
+
/** Index statistics from Zoekt */
|
|
186
|
+
export interface IndexStats {
|
|
187
|
+
repositoryCount: number;
|
|
188
|
+
documentCount: number;
|
|
189
|
+
indexBytes: number;
|
|
190
|
+
contentBytes: number;
|
|
191
|
+
shardCount: number;
|
|
192
|
+
}
|
|
193
|
+
/** Health status response */
|
|
194
|
+
export interface HealthStatus {
|
|
195
|
+
status: HealthState;
|
|
196
|
+
serverVersion: string;
|
|
197
|
+
zoektReachable: boolean;
|
|
198
|
+
zoektVersion?: string;
|
|
199
|
+
indexStats?: IndexStats;
|
|
200
|
+
errorMessage?: string;
|
|
201
|
+
}
|
|
202
|
+
/** Raw health response from Zoekt /healthz endpoint */
|
|
203
|
+
export interface HealthResponse {
|
|
204
|
+
result?: {
|
|
205
|
+
Stats?: SearchStats;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/zoekt/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,SAA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B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/zoekt/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jahales/mcp-zoekt",
|
|
3
|
+
"version": "2.2.3",
|
|
4
|
+
"description": "MCP server for Zoekt code search - enables AI assistants to search across indexed repositories",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"mcpName": "io.github.jahales/mcp-zoekt",
|
|
7
|
+
"author": "Jacob Hales",
|
|
8
|
+
"homepage": "https://github.com/jahales/mcp-zoekt#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/jahales/mcp-zoekt/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/jahales/mcp-zoekt.git"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"bin": {
|
|
19
|
+
"mcp-zoekt": "dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc && shx chmod +x dist/*.js",
|
|
26
|
+
"prepare": "npm run build",
|
|
27
|
+
"start": "node dist/index.js",
|
|
28
|
+
"dev": "tsx src/index.ts",
|
|
29
|
+
"watch": "tsc --watch",
|
|
30
|
+
"test": "vitest run tests/unit",
|
|
31
|
+
"test:unit": "vitest run tests/unit",
|
|
32
|
+
"test:integration": "vitest run tests/integration",
|
|
33
|
+
"test:all": "vitest run",
|
|
34
|
+
"test:watch": "vitest tests/unit",
|
|
35
|
+
"lint": "eslint src/**/*.ts",
|
|
36
|
+
"typecheck": "tsc --noEmit"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"mcp",
|
|
40
|
+
"model-context-protocol",
|
|
41
|
+
"zoekt",
|
|
42
|
+
"code-search",
|
|
43
|
+
"ai",
|
|
44
|
+
"copilot",
|
|
45
|
+
"claude"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
52
|
+
"pino": "^9.0.0",
|
|
53
|
+
"zod": "^3.23.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^20.0.0",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
58
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
59
|
+
"eslint": "^9.0.0",
|
|
60
|
+
"globals": "^17.2.0",
|
|
61
|
+
"shx": "^0.3.4",
|
|
62
|
+
"tsx": "^4.0.0",
|
|
63
|
+
"typescript": "^5.5.0",
|
|
64
|
+
"vitest": "^2.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|