mcp-for-spotlight
Provides tools for searching files via macOS Spotlight (mdfind) by full-text, filename, or raw Spotlight queries, and reading file metadata with mdls.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-for-spotlight find all PDFs in my Downloads folder containing "invoice""
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-for-spotlight
Ein kleiner MCP-Server (Model Context Protocol), der die macOS-Spotlight-Suche
als Tools bereitstellt. Er kapselt mdfind (Volltext- und Metadaten-Suche über
den Spotlight-Index) und mdls (Metadaten einer Datei). Systemweite
Dateisuche, nicht auf eine App beschränkt.
Was ist ein MCP-Server?
MCP (Model Context Protocol) ist ein offener Standard, über den KI-Anwendungen (der Host, etwa Claude Desktop oder Claude Code) mit externen Werkzeugen und Daten sprechen. Ein Server stellt Fähigkeiten (Tools) bereit und weiß selbst nichts von KI. Kommunikation über JSON-RPC 2.0, hier per stdio.
Related MCP server: @atef_andrus/mcp-ripgrep
Warum Spotlight statt locate oder AppleScript
Spotlight (
mdfind) indexiert Datei-Inhalt und Metadaten (Betreff, Autor, Typ, Datum) und wird live aktualisiert. Der richtige Index für Inhaltssuche.locatekennt nur Datei-Pfade/-Namen, keinen Inhalt, und ist oft veraltet oder inaktiv.AppleScript-
whose(etwa in Mail) ist ein linearer Scan ohne Index.
Tools
Tool | Zweck |
| Dateien per |
| Spotlight-Metadaten einer Datei per |
spotlight_search erwartet genau eine Suchart:
text— Freitext (Volltext + Metadaten), z. B."Quartalsbericht"name— Teilstring im Dateinamenquery— rohe Spotlight-Abfrage, z. B.kMDItemContentType == "com.adobe.pdf" && kMDItemFSName == "*Rechnung*"c
Optional onlyIn (auf ein Verzeichnis begrenzen) und limit (Vorgabe 50).
Installation
npm installKein Build-Schritt: reines ESM-JavaScript, läuft direkt mit Node (>= 18).
Full Disk Access
Geschützte Orte (z. B. ~/Library/Mail, ~/Library/Messages) liefern nur
Treffer, wenn der ausführende Prozess Full Disk Access hat
(Systemeinstellungen → Datenschutz & Sicherheit → Festplattenvollzugriff, dort
das Terminal bzw. den Node-Host freigeben). Ohne FDA sind normale
Nutzerdateien trotzdem durchsuchbar.
Lokal testen
npm run inspectRegistrieren
Claude Code:
claude mcp add spotlight -- node /absolute/path/to/mcp-for-spotlight/src/index.jsClaude Desktop, in ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"spotlight": {
"command": "node",
"args": ["/absolute/path/to/mcp-for-spotlight/src/index.js"]
}
}
}Beispiele
spotlight_search name="Rechnung" onlyIn="/Users/me/Documents"
spotlight_search query='kMDItemContentType == "com.adobe.pdf"' onlyIn="/Users/me/Downloads"
spotlight_metadata path="/Users/me/Downloads/x.pdf" attributes=["kMDItemContentCreationDate"]Lizenz
MIT
Available Tools
2 toolsspotlight_metadataDatei-MetadatenA
Liest die von Spotlight indexierten Metadaten einer Datei (mdls). Ohne attributes alle, sonst nur die genannten (z. B. kMDItemContentType, kMDItemContentCreationDate).
Inputs: path (required), attributes.
spotlight_searchSpotlight-SucheA
Durchsucht den macOS-Spotlight-Index (mdfind) nach Dateien: Volltext und Metadaten. Genau eine Suchart angeben: text (Freitext), name (Dateiname) oder query (rohe Spotlight-Abfrage). Liefert Dateipfade. Hinweis: geschützte Orte wie ~/Library/Mail liefern nur mit Full Disk Access Treffer.
Inputs: name, text, limit, query, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one searches the Spotlight index, the other reads metadata for a specific file. No meaningful overlap exists between search and metadata retrieval.
Both tools follow the consistent 'spotlight_<operation>' convention: spotlight_search and spotlight_metadata. The naming pattern is clear and predictable for a server scoped to Spotlight functionality.
With only 2 tools, the surface feels thin for a domain that could reasonably include other operations (e.g., file info, indexed-item lifecycle ops). However, the two tools cover the core search+metadata workflow reasonably for a Spotlight-focused server.
The pair covers the two primary Spotlight operations (search and metadata retrieval), which is the obvious core workflow. However, there are minor gaps—e.g., no tool for getting indexed status, no way to count results, or handling common variations like filtering by path—though agents can usually compose around these with the search tool.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
An MCP server for search and retrieval over a local LanceDB database
Web search API and MCP server for developers building AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA minimal and extensible local MCP server that provides core utilities like ping and echo alongside a file search tool integrated with the Everything CLI. It enables fast local file searching and service testing through a standardized stdio transport layer.-
- AlicenseAqualityCmaintenanceAn MCP server that wraps ripgrep to provide powerful text search, search-and-replace, file listing, and file type listing capabilities within a defined scope.629 npmMIT
- AlicenseAqualityDmaintenanceA local MCP server that exposes macOS automation actions (AppleScript + CLIs) as tools, enabling MCP clients on your Mac to control apps, system settings, and more.39MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for searching files on macOS by name or content using semantic and lexical search, providing file paths and line numbers for agents to read from.MIT