mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-15 05:37:37 +00:00
fix(ast_query): skip dependency dirs (node_modules/vendor) by default
ast_query walked every language-matching file under the search root, including node_modules, vendor and bower_components — parsing third-party code and flooding results with irrelevant matches (large token cost on every call, worst for JS/TS node_modules). Skip these by name during the walk, alongside the existing hidden-dir skip. The walk root is now exempt from both skips, so targeting a dependency dir explicitly (paths:["vendor/foo"]) still works — previously naming a hidden or dependency dir as the root would have skipped everything. Documents the scope in the tool description and help resource. Adds a regression test covering default-skip and explicit-target inclusion.
This commit is contained in:
@@ -226,6 +226,7 @@ func (s *Server) registerTools() {
|
||||
mcp.NewTool("ast_query",
|
||||
mcp.WithDescription("Search for AST patterns in code files. Use code patterns with $VAR placeholders to match and capture code structures like functions, classes, and types. "+
|
||||
"Matching is keyword/kind-based, not fully structural: argument and return-type constraints in the pattern are not enforced — use name_exact/name_matches/kind_in to filter precisely. "+
|
||||
"Hidden dirs and dependency dirs (node_modules, vendor, bower_components) are skipped unless targeted explicitly via paths. "+
|
||||
"See resource filepuff://help/ast_query for flags and examples."),
|
||||
mcp.WithReadOnlyHintAnnotation(true),
|
||||
mcp.WithString("pattern",
|
||||
|
||||
Reference in New Issue
Block a user