modelcontextprotocol / modelcontextprotocol/servers

"search_files" tool of Filesystem example MCP server does not work as expected

Open
#735 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug server-filesystem
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:

  1. Start Filesystem MCP and connect client
  2. Try use search_files tool providing pattern argument with glob/regex style wildcard pattern e.g. "*.py"
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.