fzf MCP Server
Enables fuzzy file searching, list filtering, and content searching using fzf's blazing-fast fuzzy matching algorithm. Self-contained with automatic fzf binary installation and cross-platform support.
README
fzf MCP Server
Model Context Protocol (MCP) server for fzf, the command-line fuzzy finder. Enables fuzzy file searching, list filtering, and content searching through MCP.
Features
n🎁 Self-Contained: fzf binary automatically downloaded and bundled during installation - no manual setup required!
- Fuzzy File Search: Search for files recursively using fzf's fuzzy matching
- List Filtering: Filter any list of items with fuzzy matching
- Content Search: Search within file contents using fuzzy matching
- Fast & Efficient: Leverages fzf's blazing-fast fuzzy finder
- Auto-Install: fzf binary downloads automatically on
npm install - Cross-Platform: Works on Windows, macOS, and Linux
Prerequisites
None! fzf binary is automatically downloaded and bundled during npm install. The package is completely self-contained.
Installation
Using NPX (Recommended)
No installation required:
npx @danielsimonjr/fzf-mcp
Global Installation
npm install -g @danielsimonjr/fzf-mcp
From Source
git clone https://github.com/danielsimonjr/fzf-mcp.git
cd fzf-mcp
npm install
chmod +x index.js
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
Using NPX
{
"mcpServers": {
"fzf": {
"command": "npx",
"args": ["-y", "@danielsimonjr/fzf-mcp"]
}
}
}
Using Global Install
{
"mcpServers": {
"fzf": {
"command": "fzf-mcp"
}
}
}
Custom fzf Path
If fzf is not in your PATH, set the FZF_PATH environment variable:
{
"mcpServers": {
"fzf": {
"command": "npx",
"args": ["-y", "@danielsimonjr/fzf-mcp"],
"env": {
"FZF_PATH": "C:\\path\\to\\fzf.exe"
}
}
}
}
VS Code
Add to .vscode/mcp.json:
{
"servers": {
"fzf": {
"command": "npx",
"args": ["-y", "@danielsimonjr/fzf-mcp"]
}
}
}
Available Tools
1. fuzzy_search_files
Search for files using fzf's fuzzy matching.
Parameters:
query(required): Fuzzy search query (e.g., "readme", "index.js")directory(optional): Starting directory (default: current directory)maxResults(optional): Maximum number of results (default: 50)caseSensitive(optional): Enable case-sensitive matching (default: false)exact(optional): Enable exact matching instead of fuzzy (default: false)
Example:
{
"query": "readme",
"directory": "C:\\projects",
"maxResults": 10
}
2. fuzzy_filter
Filter a list of items using fzf's fuzzy matching algorithm.
Parameters:
items(required): Array of strings to filterquery(required): Fuzzy search querymaxResults(optional): Maximum number of results (default: 50)caseSensitive(optional): Enable case-sensitive matching (default: false)exact(optional): Enable exact matching (default: false)
Example:
{
"items": ["apple", "banana", "orange", "grape", "pineapple"],
"query": "app",
"maxResults": 5
}
3. fuzzy_search_content
Search within file contents using fuzzy matching.
Parameters:
query(required): Content search querydirectory(optional): Directory to search (default: current directory)filePattern(optional): File pattern to search (default: "*")maxResults(optional): Maximum number of results (default: 50)caseSensitive(optional): Enable case-sensitive matching (default: false)
Example:
{
"query": "function",
"directory": "C:\\projects\\myapp",
"filePattern": "*.js",
"maxResults": 20
}
Usage Examples
Example 1: Find Configuration Files
Tell Claude:
Use fzf to search for all configuration files (config, .env, settings) in my project directory.
Claude will use the fuzzy_search_files tool to find matching files.
Example 2: Filter List of Options
Tell Claude:
I have this list of packages: [express, react, vue, angular, svelte, next, nuxt, remix]
Use fzf to filter for packages containing "re"
Claude will use the fuzzy_filter tool to return: express, react, svelte
Example 3: Search Code
Tell Claude:
Search for all occurrences of "async function" in my TypeScript files.
Claude will use the fuzzy_search_content tool to find matches.
How It Works
fzf-mcp uses fzf's --filter mode to provide non-interactive fuzzy matching:
- File Search: Generates a file list from the directory and pipes it to fzf
- List Filter: Pipes the provided list to fzf for filtering
- Content Search: Uses grep/findstr to find content, then filters with fzf
All matching is done server-side, returning only the filtered results to Claude.
Fuzzy Matching Algorithm
fzf uses a sophisticated fuzzy matching algorithm that:
- Matches characters in order but not necessarily consecutive
- Scores matches based on character positions
- Prioritizes matches at word boundaries
- Supports exact matching with the
exactoption
Examples:
- Query
"abc"matches:"abc","a_b_c","aXbXc","AnyBigCat" - Query
"^music"matches files starting with "music" - Query
"mp3$"matches files ending with "mp3"
Troubleshooting
fzf Not Found
Error: Failed to execute fzf: spawn fzf ENOENT
Solution:
- Ensure fzf is installed:
fzf --version - Add fzf to your PATH, or set
FZF_PATHenvironment variable in MCP config
No Results Found
Causes:
- Query doesn't match any items
- Directory doesn't exist or is empty
- Insufficient permissions to read directory
Solutions:
- Try a less specific query
- Verify directory path
- Check file permissions
Windows-Specific Issues
Issue: File listing commands fail
Solution:
The server tries multiple commands (dir, find, ls) and uses the first that succeeds. Ensure at least one is available in your PATH.
Development
# Clone repository
git clone https://github.com/danielsimonjr/fzf-mcp.git
cd fzf-mcp
# Install dependencies
npm install
# Make executable
chmod +x index.js
# Test locally
node index.js
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
MIT License - see LICENSE file for details.
Acknowledgments
- fzf by Junegunn Choi - The amazing fuzzy finder
- Model Context Protocol by Anthropic
Links
- NPM Package: https://www.npmjs.com/package/@danielsimonjr/fzf-mcp
- GitHub Repository: https://github.com/danielsimonjr/fzf-mcp
- fzf Project: https://github.com/junegunn/fzf
- MCP Documentation: https://modelcontextprotocol.io
Made with ❤️ for the MCP community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。