MCP server for fast file search using fd
Project description
fd-mcp
A Model Context Protocol (MCP) server that provides fast file search capabilities using fd, a modern alternative to the traditional find command.
What is fd-mcp?
fd-mcp bridges fd with AI assistants like Claude Code through the Model Context Protocol. It exposes fd's powerful file search capabilities as MCP tools, enabling AI assistants to efficiently navigate and search codebases.
Why fd?
fd offers significant advantages over traditional file search tools:
- Blazing Fast: Written in Rust, fd is often 5-10x faster than
findfor typical searches - User-Friendly Syntax: Simple, intuitive patterns instead of cryptic flags (
fd patternvsfind -name "*pattern*") - Smart Defaults: Automatically respects
.gitignoreand skips hidden files/directories - Colorized Output: Enhanced readability with syntax highlighting
- Parallel Execution: Leverages multiple CPU cores for faster searches
- Regex Support: Built-in regex pattern matching without complex syntax
Use Cases
This MCP server is particularly useful for:
- Codebase Navigation: Quickly locate files by name, extension, or pattern across large projects
- Project Analysis: Find all files of a specific type (e.g., all Python test files, all configuration files)
- Code Exploration: Help AI assistants understand project structure by efficiently listing directories and files
- Pattern Matching: Search for files using regex patterns (e.g., find all migration files, test suites)
- Selective Searches: Filter by file type, depth, or exclude specific patterns
- Performance: Fast searches even in monorepos or large codebases with thousands of files
Prerequisites
Install fd:
# Ubuntu/Debian
sudo apt install fd-find
# macOS
brew install fd
# Arch
pacman -S fd
Installation
cd fd-mcp
pip install -e .
Usage with Claude Code
Add to your Claude Code MCP settings (~/.claude.json):
{
"mcpServers": {
"fd": {
"command": "fd-mcp"
}
}
}
Or run directly:
{
"mcpServers": {
"fd": {
"command": "python",
"args": ["-m", "fd_mcp.server"],
"cwd": "/home/th/dev/os/fd-mcp"
}
}
}
Tools
fd_search
Search for files and directories.
| Parameter | Type | Description |
|---|---|---|
| pattern | string | Regex pattern (optional) |
| path | string | Search directory (default: ".") |
| type | string | f=file, d=dir, l=symlink, x=exec, e=empty |
| extension | string | Filter by extension |
| hidden | bool | Include hidden files |
| no_ignore | bool | Don't respect .gitignore |
| max_depth | int | Max search depth |
| exclude | string | Glob pattern to exclude |
| case_sensitive | bool | Case-sensitive search |
| absolute_path | bool | Return absolute paths |
| max_results | int | Limit results (default: 100) |
fd_count
Count files matching a pattern.
Examples
Find all Python files:
fd_search(extension="py")
Find test files:
fd_search(pattern="test_.*", extension="py")
List directories only:
fd_search(type="d", max_depth=2)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fd_mcp-0.1.0.tar.gz.
File metadata
- Download URL: fd_mcp-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f760e5db212bb366ca675d0c5d498f0835ce01b375d4882a6477071776152c53
|
|
| MD5 |
8f6c29733e64982ba67be4a6cc6debd7
|
|
| BLAKE2b-256 |
e1ee9970db921b00a1d87b35d2be4664d299c5a7bc34bb122bae7b4819f6de3e
|
File details
Details for the file fd_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fd_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1794c8bfc8a31bc1618bd6b9b0898b270b48ad17fccea845693b8ea88ef17dd9
|
|
| MD5 |
ab6565436c63901ef287b45958dce912
|
|
| BLAKE2b-256 |
411fa25aeafe90c64f78b9b9e40788e1db640b348bbc9aae44890599c976ab7d
|