An MCP server that provides fast Spotlight file search capabilities for macOS
A Desktop Extension (DXT) that provides fast file search capabilities for macOS using the native mdfind command (Spotlight search).
⚠️ IMPORTANT: This extension only works on macOS systems. Windows and Linux are not supported.
This server is available in the Model Context Protocol Registry. Install it using your MCP client.
mcp-name: io.github.huoshuiai42/huoshui-file-search
uvx huoshui-file-search
git clone https://github.com/huoshui/huoshui-file-search.git
cd huoshui-file-search
uv sync
search_files tool with various parametersfrom server.main import search_files, FileSearchParams
# Basic search
params = FileSearchParams(query="report.pdf")
result = await search_files(None, params)
# Search with filters
params = FileSearchParams(
query="*.py",
path="/Users/username/Documents",
case_sensitive=True,
sort_by="size",
limit=50
)
result = await search_files(None, params)
query (required): Search query stringpath (optional): Directory to limit search scopecase_sensitive (optional): Enable case-sensitive search (default: false)regex (optional): Regex pattern to filter results by filenamesort_by (optional): Sort results by 'name', 'size', or 'date'limit (optional): Maximum number of results (default: 100, max: 1000)The query parameter uses macOS Spotlight's mdfind syntax:
report - finds files containing "report"kind:pdf, kind:image, kind:moviekMDItemFSName == "*.py" - finds Python filesinvoice AND kind:pdf - finds PDF files containing "invoice"date:today, modified:this weekNote: If your query like '寻找工程车' kind:movie returns no results, it might mean:
寻找工程车 AND kind:movie){
"query": "document.pdf"
}
{
"query": "*.txt",
"path": "/Users/username/Documents"
}
{
"query": "README",
"case_sensitive": true
}
{
"query": "kind:text",
"regex": "log.*2024.*\\.txt$"
}
{
"query": "*.jpg",
"sort_by": "size",
"limit": 20
}
The extension supports user configuration through the DXT manifest:
allowed_directories: List of directories to limit search scopedefault_limit: Default maximum number of search resultsenable_logging: Enable debug logginghuoshui-file-search/
├── manifest.json # DXT manifest file
├── server/ # MCP server implementation
│ ├── __init__.py
│ ├── __main__.py
│ └── main.py
├── pyproject.toml # Python package configuration
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md # This file
Install dependencies:
uv sync
Run the server:
uv run python -m server
Or after publishing to PyPI:
uvx huoshui-file-search
The server will communicate via stdio according to the MCP protocol
Build the package:
uv build
Upload to PyPI:
uv publish
curl -LsSf https://astral.sh/uv/install.sh | sh)This extension only works on macOS. Ensure you're running it on a Mac.
Ensure Spotlight is enabled on your Mac. You can check this in System Preferences > Spotlight.
Large searches may timeout after 30 seconds. Try:
MIT License - see LICENSE file for details
Contributions are welcome! Please:
For issues and feature requests, please visit: https://github.com/huoshui/huoshui-file-search/issues
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx huoshui-file-searchMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-huoshuiai42-huoshui-file-search": {
"command": "uvx",
"args": [
"huoshui-file-search"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.huoshuiai42/huoshui-file-search works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.