USP
Unlike generic file search tools, this server integrates deeply with platform-specific, highly optimized search utilities, offering superior performance and advanced syntax support tailored to each OS.
Use cases
- 01Quickly find project files by name or content
- 02Locate specific code snippets across the filesystem
- 03Identify recently modified files for review
- 04Search for configuration files in a complex environment
Detected files (1)
CLAUDE.mdclaude_mdShow content (4386 bytes)
# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview This is an MCP (Model Context Protocol) server that provides cross-platform file search capabilities: - **Windows**: Uses the Everything SDK for fast indexed search - **macOS**: Uses `mdfind` (Spotlight) for native search - **Linux**: Uses `locate`/`plocate` for filesystem search The server exposes a single `search` tool with platform-specific parameter schemas and syntax support. ## Development Commands ### Testing and Running ```bash # Run the server with MCP inspector for testing npx @modelcontextprotocol/inspector uv run mcp-server-everything-search # Run directly with uv uv run mcp-server-everything-search # Run as Python module (after pip install) python -m mcp_server_everything_search ``` ### Code Quality ```bash # Type checking uv run pyright # Linting uv run ruff check # Formatting uv run ruff format # Run tests uv run pytest ``` ### Building ```bash # Build the package uv build ``` ## Architecture ### Core Components 1. **server.py** - Main MCP server implementation - Defines the `search` tool with platform-specific schemas - Handles parameter parsing and validation using Pydantic - Routes search requests to appropriate platform provider - Returns formatted search results as TextContent 2. **search_interface.py** - Abstract search provider interface - `SearchProvider`: Abstract base class defining the search contract - `WindowsSearchProvider`: Everything SDK wrapper - `MacSearchProvider`: mdfind command wrapper - `LinuxSearchProvider`: locate/plocate command wrapper - `SearchResult`: Universal dataclass for all platforms 3. **platform_search.py** - Platform-specific parameter models - `BaseSearchQuery`: Common search parameters (query, max_results) - `WindowsSpecificParams`: Everything SDK options (match_path, match_case, etc.) - `MacSpecificParams`: mdfind options (live_updates, search_directory, etc.) - `LinuxSpecificParams`: locate options (ignore_case, regex_search, etc.) - `UnifiedSearchQuery`: Combines all parameter models with platform-aware schema generation - `build_search_command()`: Builds platform-specific command arrays 4. **everything_sdk.py** - Windows Everything SDK wrapper - `EverythingSDK`: ctypes wrapper for Everything64.dll - Comprehensive constant definitions for request flags and sort options - Windows filetime to Python datetime conversion - Full error handling with custom EverythingError exception ### Key Design Patterns - **Strategy Pattern**: Platform-specific search providers implementing common SearchProvider interface - **Factory Pattern**: `SearchProvider.get_provider()` returns the correct provider based on platform.system() - **Adapter Pattern**: Each provider adapts platform-specific tools to unified SearchResult format ### Platform-Specific Notes **Windows**: - Requires `EVERYTHING_SDK_PATH` environment variable pointing to Everything64.dll - Uses ctypes to call SDK functions directly (no subprocess calls) - Supports full Everything search syntax with advanced filters and sorting **macOS**: - Uses subprocess to call `mdfind` command - No additional dependencies required (built-in) **Linux**: - Checks for `plocate` first, falls back to `locate` - Provides detailed error messages if database not initialized - Uses subprocess to call locate commands ### Parameter Flow 1. Client sends search request with platform-specific parameters 2. `server.py` parses `base` and platform-specific params (e.g., `windows_params`) 3. Creates `UnifiedSearchQuery` from combined parameters 4. Routes to appropriate `SearchProvider` based on `platform.system()` 5. Provider executes search and returns list of `SearchResult` objects 6. Server formats results as TextContent with file details ## Environment Variables - `EVERYTHING_SDK_PATH` (Windows only): Path to Everything64.dll (default: `D:\dev\tools\Everything-SDK\dll\Everything64.dll`) ## Installation Methods The server supports three installation methods: 1. **Smithery CLI**: `npx -y @smithery/cli install mcp-server-everything-search --client claude` 2. **uv (recommended)**: Use `uvx mcp-server-everything-search` 3. **pip**: `pip install mcp-server-everything-search` then `python -m mcp_server_everything_search`
README
Everything Search MCP Server
An MCP server that provides fast file searching capabilities across Windows, macOS, and Linux. On Windows, it uses the Everything SDK. On macOS, it uses the built-in mdfind command. On Linux, it uses the locate/plocate command.
Tools
search
Search for files and folders across your system. The search capabilities and syntax support vary by platform:
- Windows: Full Everything SDK features (see syntax guide below)
- macOS: Basic filename and content search using Spotlight database
- Linux: Basic filename search using locate database
Parameters:
query(required): Search query string. See platform-specific notes below.max_results(optional): Maximum number of results to return (default: 100, max: 1000)match_path(optional): Match against full path instead of filename only (default: false)match_case(optional): Enable case-sensitive search (default: false)match_whole_word(optional): Match whole words only (default: false)match_regex(optional): Enable regex search (default: false)sort_by(optional): Sort order for results (default: 1). Available options:
- 1: Sort by filename (A to Z)
- 2: Sort by filename (Z to A)
- 3: Sort by path (A to Z)
- 4: Sort by path (Z to A)
- 5: Sort by size (smallest first)
- 6: Sort by size (largest first)
- 7: Sort by extension (A to Z)
- 8: Sort by extension (Z to A)
- 11: Sort by creation date (oldest first)
- 12: Sort by creation date (newest first)
- 13: Sort by modification date (oldest first)
- 14: Sort by modification date (newest first)
Examples:
{
"query": "*.py",
"max_results": 50,
"sort_by": 6
}
{
"query": "ext:py datemodified:today",
"max_results": 10
}
Response includes:
- File/folder path
- File size in bytes
- Last modified date
Search Syntax Guide
For detailed information about the search syntax supported on each platform (Windows, macOS, and Linux), please see SEARCH_SYNTAX.md.
Prerequisites
Windows
- Everything search utility:
- Download and install from https://www.voidtools.com/
- Make sure the Everything service is running
- Everything SDK:
- Download from https://www.voidtools.com/support/everything/sdk/
- Extract the SDK files to a location on your system
Linux
- Install and initialize the
locateorplocatecommand:- Ubuntu/Debian:
sudo apt-get install plocateorsudo apt-get install mlocate - Fedora:
sudo dnf install mlocate
- Ubuntu/Debian:
- After installation, update the database:
- For plocate:
sudo updatedb - For mlocate:
sudo /etc/cron.daily/mlocate
- For plocate:
macOS
No additional setup required. The server uses the built-in mdfind command.
Installation
Installing via Smithery
To install Everything Search for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-server-everything-search --client claude
Using uv (recommended)
When using uv no specific installation is needed. We will
use uvx to directly run mcp-server-everything-search.
Using PIP
Alternatively you can install mcp-server-everything-search via pip:
pip install mcp-server-everything-search
After installation, you can run it as a script using:
python -m mcp_server_everything_search
Configuration
Windows
The server requires the Everything SDK DLL to be available:
Environment variable:
EVERYTHING_SDK_PATH=path\to\Everything-SDK\dll\Everything64.dll
Linux and macOS
No additional configuration required.
Usage with Claude Desktop
Add one of these configurations to your claude_desktop_config.json based on your platform:
Windows (using uvx)
"mcpServers": {
"everything-search": {
"command": "uvx",
"args": ["mcp-server-everything-search"],
"env": {
"EVERYTHING_SDK_PATH": "path/to/Everything-SDK/dll/Everything64.dll"
}
}
}
Windows (using pip installation)
"mcpServers": {
"everything-search": {
"command": "python",
"args": ["-m", "mcp_server_everything_search"],
"env": {
"EVERYTHING_SDK_PATH": "path/to/Everything-SDK/dll/Everything64.dll"
}
}
}
Linux and macOS
"mcpServers": {
"everything-search": {
"command": "uvx",
"args": ["mcp-server-everything-search"]
}
}
Or if using pip installation:
"mcpServers": {
"everything-search": {
"command": "python",
"args": ["-m", "mcp_server_everything_search"]
}
}
Debugging
You can use the MCP inspector to debug the server. For uvx installations:
npx @modelcontextprotocol/inspector uvx mcp-server-everything-search
Or if you've installed the package in a specific directory or are developing on it:
git clone https://github.com/mamertofabian/mcp-everything-search.git
cd mcp-everything-search/src/mcp_server_everything_search
npx @modelcontextprotocol/inspector uv run mcp-server-everything-search
To view server logs:
Linux/macOS:
tail -f ~/.config/Claude/logs/mcp*.log
Windows (PowerShell):
Get-Content -Path "$env:APPDATA\Claude\logs\mcp*.log" -Tail 20 -Wait
Development
If you are doing local development, there are two ways to test your changes:
-
Run the MCP inspector to test your changes. See Debugging for run instructions.
-
Test using the Claude desktop app. Add the following to your
claude_desktop_config.json:
"everything-search": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-everything-search/src/mcp_server_everything_search",
"run",
"mcp-server-everything-search"
],
"env": {
"EVERYTHING_SDK_PATH": "path/to/Everything-SDK/dll/Everything64.dll"
}
}
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Disclaimer
This project is not affiliated with, endorsed by, or sponsored by voidtools (the creators of Everything search utility). This is an independent project that utilizes the publicly available Everything SDK.