modelcontextprotocol / modelcontextprotocol/servers
"search_files" tool of Filesystem example MCP server does not work as expected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Describe the bug
It is expected that the pattern argument of the search_files tool would support glob/regex style wildcard patterns, e.g. "*.py", but it does not.
Looking at the implementation it is easy to see why, for some reason it just does a basic substring inclusion test instead of a proper glob minimatch() like it does for the excludePatterns argument.
To Reproduce
Steps to reproduce the behavior:
- Start Filesystem MCP and connect client
- Try use
search_filestool providingpatternargument with glob/regex style wildcard pattern e.g. "*.py" - get "No matches found" even when there are files that match
Expected behavior
search_files tool pattern argument should support glob/regex style wildcard patterns
I'm planning on creating a fix for this soon!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/filesystem/index.ts#L217 and compare how the search_files pattern is handled with the excludePatterns argument. Reproduce the issue by searching for a pattern such as "*.py" against files that should match. Done means search_files supports the expected glob or regex-style wildcard patterns and no longer reports false "No matches found" results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100