feat(search): bound default result count and add include_hidden

Two file_search gaps:
- max_results defaulted to 0 (unbounded), so a broad pattern returned every match — unbounded memory + token blowup. The configured MaxSearchResults (default 1000) existed but was dead; wire it as the builtIn default. Explicit max_results still wins, and the cursor footer pages the rest.
- search.Request.IncludeHidden was a dead field with no tool param. Add an include_hidden bool (default false) so dotfiles (.github/, etc.) are searchable.
This commit is contained in:
2026-06-20 00:33:32 +01:00
parent dfd68f08c9
commit debe79e33e
2 changed files with 15 additions and 8 deletions
+3
View File
@@ -129,6 +129,9 @@ func (s *Server) registerTools() {
mcp.WithBoolean("ignore_case",
mcp.Description("Case insensitive search"),
),
mcp.WithBoolean("include_hidden",
mcp.Description("Search hidden files and directories (dotfiles like .github/). Default: false."),
),
mcp.WithBoolean("regex",
mcp.Description("Treat pattern as regex (default: true)"),
),