# ============================================================================== # Apple Doc MCP Server - Environment Configuration # ============================================================================== # ───────────────────────────────────────────────────────────────────────────── # Pick ONE embedding mode. All are optional — no key means fast lexical search. # # 1. Offline, no key : download the GGUF, set APPLE_DOCS_EMBEDDING_MODEL_PATH # 2. Cloud, best ranking : set GEMINI_API_KEY (https://aistudio.google.com/) # 3. Neither : skip this file entirely; lexical search still works # # Then, for modes 1-2, run `npm run embed-index` once (mode 3: skip it — # lexical search needs no vectors). `npm run doctor` verifies either way. # ───────────────────────────────────────────────────────────────────────────── # Cloud mode embeds with models/gemini-embedding-2 (768-d default, matching the # shipped index; MRL-width configurable at the end of this file) and includes # DocC visual layout/diagram preview vectors. GEMINI_API_KEY= # Authentication Option 2: Application Default Credentials (ADC) # If GEMINI_API_KEY is not set, the server automatically looks for Google ADC: # - Service Account JSON via GOOGLE_APPLICATION_CREDENTIALS path # - gcloud user credentials via `gcloud auth application-default login` # - Workload Identity / GCE / GKE / Cloud Run metadata servers # NOTE: under Hermes (via bridges/hermes), ADC is intentionally IGNORED — the # bridge sets APPLE_DOCS_DISABLE_ADC=1 and only a secret_scope GEMINI_API_KEY # authenticates. ADC is a standalone (npm / direct MCP) mode only. # GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json # Optional: Custom SQLite database file (defaults to data/apple-docs.db) # APPLE_DOCS_DB_PATH=./data/apple-docs.db # ============================================================================== # Local Embedding Model (100% Offline via node-llama-cpp) # ============================================================================== # Embedding Option 1: In-process local GGUF model (Google DeepMind EmbeddingGemma 2) # Generates 768-dimensional embeddings locally with Apple Silicon Metal acceleration. # When the model file exists, it is automatically selected as the default provider. # APPLE_DOCS_EMBEDDING_MODEL_PATH=/path/to/embeddinggemma-2-Q8_0.gguf # Force provider selection: 'local' (force local GGUF) or 'gemini' (force Gemini API) # APPLE_DOCS_EMBEDDING_PROVIDER=local # Dimensions: 768-d is the default and already matches the shipped index, so a # normal install needs nothing here. Uncomment only to re-embed at another MRL # width (128|256|512|768|1024|1536|2048|3072): the width must match the stored # vectors, so after changing it run `npm run embed-index -- --force`, otherwise # the doctor's dimension_consistency check fails and hybrid scoring is invalid. # APPLE_DOCS_EMBEDDING_DIMENSIONS=3072