From 93a3f89a709ec50de54500a521bb627e9da055bf Mon Sep 17 00:00:00 2001 From: bkellam Date: Thu, 20 Nov 2025 17:27:35 -0800 Subject: [PATCH] update mcp --- packages/mcp/src/index.ts | 8 ++------ packages/mcp/src/schemas.ts | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.ts index 3e4750a7..a8d17889 100644 --- a/packages/mcp/src/index.ts +++ b/packages/mcp/src/index.ts @@ -70,16 +70,12 @@ server.tool( query += ` ( lang:${languages.join(' or lang:')} )`; } - if (caseSensitive) { - query += ` case:yes`; - } else { - query += ` case:no`; - } - const response = await search({ query, matches: env.DEFAULT_MATCHES, contextLines: env.DEFAULT_CONTEXT_LINES, + isRegexEnabled: true, + isCaseSensitivityEnabled: caseSensitive, }); if (isServiceError(response)) { diff --git a/packages/mcp/src/schemas.ts b/packages/mcp/src/schemas.ts index ba46b2f1..bab83a0d 100644 --- a/packages/mcp/src/schemas.ts +++ b/packages/mcp/src/schemas.ts @@ -21,15 +21,17 @@ export const symbolSchema = z.object({ kind: z.string(), }); +export const searchOptionsSchema = z.object({ + matches: z.number(), // The number of matches to return. + contextLines: z.number().optional(), // The number of context lines to return. + whole: z.boolean().optional(), // Whether to return the whole file as part of the response. + isRegexEnabled: z.boolean().optional(), // Whether to enable regular expression search. + isCaseSensitivityEnabled: z.boolean().optional(), // Whether to enable case sensitivity. +}); + export const searchRequestSchema = z.object({ - // The zoekt query to execute. - query: z.string(), - // The number of matches to return. - matches: z.number(), - // The number of context lines to return. - contextLines: z.number().optional(), - // Whether to return the whole file as part of the response. - whole: z.boolean().optional(), + query: z.string(), // The zoekt query to execute. + ...searchOptionsSchema.shape, }); export const repositoryInfoSchema = z.object({ @@ -109,7 +111,7 @@ export const searchStatsSchema = z.object({ regexpsConsidered: z.number(), // FlushReason explains why results were flushed. - flushReason: z.number(), + flushReason: z.string(), }); export const searchResponseSchema = z.object({ @@ -139,7 +141,6 @@ export const searchResponseSchema = z.object({ content: z.string().optional(), })), repositoryInfo: z.array(repositoryInfoSchema), - isBranchFilteringEnabled: z.boolean(), isSearchExhaustive: z.boolean(), });