Skip to main content
Glama
shaack

mcp-for-spotlight

by shaack

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: @codesift/mcp

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.

  • locate kennt 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

spotlight_search

Dateien per mdfind finden: Freitext, Dateiname oder rohe Spotlight-Abfrage

spotlight_metadata

Spotlight-Metadaten einer Datei per mdls lesen

spotlight_search erwartet genau eine Suchart:

  • text — Freitext (Volltext + Metadaten), z. B. "Quartalsbericht"

  • name — Teilstring im Dateinamen

  • query — rohe Spotlight-Abfrage, z. B. kMDItemContentType == "com.adobe.pdf" && kMDItemFSName == "*Rechnung*"c

Optional onlyIn (auf ein Verzeichnis begrenzen) und limit (Vorgabe 50).

Installation

npm install

Kein 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 inspect

Registrieren

Claude Code:

claude mcp add spotlight -- node /absolute/path/to/mcp-for-spotlight/src/index.js

Claude 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 tools
spotlight_metadataDatei-MetadatenA

Liest die von Spotlight indexierten Metadaten einer Datei (mdls). Ohne attributes alle, sonst nur die genannten (z. B. kMDItemContentType, kMDItemContentCreationDate).

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsoluter Dateipfad
attributesNoAttributnamen, z. B. ["kMDItemContentType", "kMDItemPixelHeight"]

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description reveals that it uses mdls under the hood and that omitting attributes returns everything, which is useful behavioral context beyond the schema. It notes the read-only nature ('liest') implicitly. However, no annotations are present, and it doesn't disclose error behavior for nonexistent files, non-indexed locations, or what happens when attributes are unavailable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences with zero waste. Front-loaded with the tool's purpose and efficiency. The example attribute names embedded in the description are helpful and concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with 2 well-described parameters and no output schema, the description adequately covers what's needed: what it reads, how attribute filtering works, and the default behavior. The behavior is fully specified given the schema coverage, though it could mention that results depend on Spotlight indexing availability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with both parameters well-documented in the schema itself (path as absolute file path, attributes as array of attribute names with examples). The description adds a small clarification that omitting attributes returns all metadata, slightly augmenting the schema meaning but not substantially beyond it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (reads/Liest), the resource (Spotlight-indexed file metadata via mdls), and the behavior (all attributes by default, named subset otherwise). It's specific and distinguishable from spotlight_search, the sibling that performs searches rather than reading metadata for a given path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the attribute filtering behavior (all vs. specific named attributes) which informs usage, but it doesn't explicitly state when to prefer this over spotlight_search or what kind of use cases it serves. The tool itself is self-evident for reading metadata, but no exclusions or alternative-navigation guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedspotlight_metadata
    • First observedspotlight_search

TDQS

A3.8/5.0

Scored across 2 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness3/5

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

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shaack/mcp-for-spotlight'

If you have feedback or need assistance with the MCP directory API, please join our Discord server