Obsidian Brain
Obsidian MCP server: semantic search, knowledge graph, and vault editing. No plugin required.
Documentation & Preview
{ "mcpServers": { "mcp-obsidian-brain": { "command": "npx", "args": [ "-y", "--package", "obsidian-brain@1.7.24", "obsidian-brain", "server" ], "env": { "VAULT_PATH": "${ENV_VAULT_PATH}", "DATA_DIR": "${ENV_DATA_DIR}", "EMBEDDING_PRESET": "${ENV_EMBEDDING_PRESET}", "EMBEDDING_MODEL": "${ENV_EMBEDDING_MODEL}", "EMBEDDING_PROVIDER": "${ENV_EMBEDDING_PROVIDER}", "OLLAMA_BASE_URL": "${ENV_OLLAMA_BASE_URL}", "OLLAMA_EMBEDDING_DIM": "${ENV_OLLAMA_EMBEDDING_DIM}", "OLLAMA_NUM_CTX": "${ENV_OLLAMA_NUM_CTX}", "OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL": "${ENV_OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL}", "OBSIDIAN_BRAIN_OLLAMA_BYOM_AUTO_PULL": "${ENV_OBSIDIAN_BRAIN_OLLAMA_BYOM_AUTO_PULL}", "OBSIDIAN_BRAIN_NO_WATCH": "${ENV_OBSIDIAN_BRAIN_NO_WATCH}", "OBSIDIAN_BRAIN_NO_CATCHUP": "${ENV_OBSIDIAN_BRAIN_NO_CATCHUP}", "OBSIDIAN_BRAIN_WATCH_DEBOUNCE_MS": "${ENV_OBSIDIAN_BRAIN_WATCH_DEBOUNCE_MS}", "OBSIDIAN_BRAIN_COMMUNITY_DEBOUNCE_MS": "${ENV_OBSIDIAN_BRAIN_COMMUNITY_DEBOUNCE_MS}", "OBSIDIAN_BRAIN_TOOL_TIMEOUT_MS": "${ENV_OBSIDIAN_BRAIN_TOOL_TIMEOUT_MS}", "OBSIDIAN_BRAIN_MAX_CHUNK_TOKENS": "${ENV_OBSIDIAN_BRAIN_MAX_CHUNK_TOKENS}", "OBSIDIAN_BRAIN_CONFIG_DIR": "${ENV_OBSIDIAN_BRAIN_CONFIG_DIR}", "OBSIDIAN_BRAIN_DEBUG": "${ENV_OBSIDIAN_BRAIN_DEBUG}", "OBSIDIAN_BRAIN_LOG_FORMAT": "${ENV_OBSIDIAN_BRAIN_LOG_FORMAT}" } } }, "setup": { "fields": [ { "id": "ENV_VAULT_PATH", "label": "VAULT_PATH", "description": "Absolute path to your Obsidian vault (or any folder of .md files).", "required": true, "secret": false, "default": "" }, { "id": "ENV_DATA_DIR", "label": "DATA_DIR", "description": "Where to store the SQLite index + embedding cache. Defaults to $XDG_DATA_HOME/obsidian-brain or ~/.local/share/obsidian-brain.", "required": false, "secret": false, "default": "" }, { "id": "ENV_EMBEDDING_PRESET", "label": "EMBEDDING_PRESET", "description": "Preset name: english (default, bge-small-en-v1.5), english-fast, english-quality, multilingual, multilingual-quality, multilingual-ollama. Ignored when EMBEDDING_MODEL is set.", "required": false, "secret": false, "default": "english" }, { "id": "ENV_EMBEDDING_MODEL", "label": "EMBEDDING_MODEL", "description": "Power-user override: any transformers.js checkpoint or Ollama model id. Takes precedence over EMBEDDING_PRESET. Switching auto-reindexes.", "required": false, "secret": false, "default": "" }, { "id": "ENV_EMBEDDING_PROVIDER", "label": "EMBEDDING_PROVIDER", "description": "Embedding backend. 'transformers' (local, default) or 'ollama' (requires a running Ollama server).", "required": false, "secret": false, "default": "transformers" }, { "id": "ENV_OLLAMA_BASE_URL", "label": "OLLAMA_BASE_URL", "description": "Base URL of a local Ollama server. Only used when EMBEDDING_PROVIDER=ollama.", "required": false, "secret": false, "default": "http://localhost:11434" }, { "id": "ENV_OLLAMA_EMBEDDING_DIM", "label": "OLLAMA_EMBEDDING_DIM", "description": "Override the embedding dimensionality when EMBEDDING_PROVIDER=ollama. If unset, the server probes the model on startup.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OLLAMA_NUM_CTX", "label": "OLLAMA_NUM_CTX", "description": "Override Ollama's num_ctx for embed requests. Leave UNSET to let obsidian-brain auto-detect via /api/show's context_length (e.g. nomic-embed-text=2048, bge-m3=8192, qwen3-embedding:0.6b=32 768). Setting this manually imposes a hard cap and may silently truncate longer inputs — see https://github.com/ollama/ollama/issues/14259. Ollama's own default is 2048 which truncates for any model trained on a larger context. See also https://github.com/ollama/ollama/issues/7008. Fallback when both env is unset AND /api/show is unreachable: 8192.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL", "label": "OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL", "description": "Auto-pull the configured Ollama model when /api/show returns 404 (model not present). Default ON — choosing an Ollama-backed preset is implicit consent to download its model. Streams /api/pull progress to stderr. Set to '0' to disable auto-pull entirely (master kill-switch) and fall back to the actionable error path (HTTP 404 — try: ollama pull <model>).", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_OLLAMA_BYOM_AUTO_PULL", "label": "OBSIDIAN_BRAIN_OLLAMA_BYOM_AUTO_PULL", "description": "Opt-in to auto-pull for BYOM (custom EMBEDDING_MODEL) Ollama models OUTSIDE Ollama's official library/ namespace. Default OFF — third-party models (e.g. user/custom-fork, myregistry.com/team/model) require this env var to be set to 1 before they will auto-pull, to prevent silent downloads of arbitrary user-named artifacts. Preset-known models (via EMBEDDING_PRESET) and bare model ids in the official library (e.g. qwen3-embedding:0.6b, library/llama3:8b) continue to auto-pull by default per the existing OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL behavior.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_NO_WATCH", "label": "OBSIDIAN_BRAIN_NO_WATCH", "description": "Set to '1' to disable the live chokidar file watcher. Useful on SMB/NFS vaults where FSEvents/inotify don't fire reliably — fall back to running obsidian-brain index on a schedule (launchd/systemd).", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_NO_CATCHUP", "label": "OBSIDIAN_BRAIN_NO_CATCHUP", "description": "Set to '1' to skip the startup catchup reindex pass that picks up edits made while the server was down. The live file watcher still starts (via OBSIDIAN_BRAIN_NO_WATCH=1 to disable that separately), and first-time indexing on an empty DB is unaffected — this knob only governs the post-restart enqueueBackgroundReindex walk.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_WATCH_DEBOUNCE_MS", "label": "OBSIDIAN_BRAIN_WATCH_DEBOUNCE_MS", "description": "Per-file reindex debounce for the live watcher, in milliseconds.", "required": false, "secret": false, "default": "3000" }, { "id": "ENV_OBSIDIAN_BRAIN_COMMUNITY_DEBOUNCE_MS", "label": "OBSIDIAN_BRAIN_COMMUNITY_DEBOUNCE_MS", "description": "Graph-wide community-detection (Louvain) debounce for the live watcher, in milliseconds. Louvain is the only expensive op — batching it prevents per-edit CPU spikes.", "required": false, "secret": false, "default": "60000" }, { "id": "ENV_OBSIDIAN_BRAIN_TOOL_TIMEOUT_MS", "label": "OBSIDIAN_BRAIN_TOOL_TIMEOUT_MS", "description": "Per-tool-call timeout in milliseconds. Tools exceeding this return an MCP error instead of hanging.", "required": false, "secret": false, "default": "30000" }, { "id": "ENV_OBSIDIAN_BRAIN_MAX_CHUNK_TOKENS", "label": "OBSIDIAN_BRAIN_MAX_CHUNK_TOKENS", "description": "Override the adaptive chunk-size budget (in tokens). When set, this beats the capacity probed from the model's tokenizer or Ollama /api/show. Use for debugging or for models with stale tokenizer configs.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_CONFIG_DIR", "label": "OBSIDIAN_BRAIN_CONFIG_DIR", "description": "Override the per-user config directory where obsidian-brain stores model overrides (model-overrides.json) and the user-fetched seed (seed-models.json). Default is $XDG_CONFIG_HOME/obsidian-brain on macOS/Linux (or ~/.config/obsidian-brain) and %APPDATA%/obsidian-brain on Windows. Both files survive npm update obsidian-brain because they live outside the package.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_DEBUG", "label": "OBSIDIAN_BRAIN_DEBUG", "description": "Set to \"1\" to print a verbose synchronous startup trace to stderr — every preflight, createContext, server.connect, and shutdown step is logged with a monotonic timestamp. The LAST line before any silent failure tells you exactly which step the server reached. No-op when unset (no overhead). Use to diagnose silent-crash failure modes.", "required": false, "secret": false, "default": "" }, { "id": "ENV_OBSIDIAN_BRAIN_LOG_FORMAT", "label": "OBSIDIAN_BRAIN_LOG_FORMAT", "description": "Set to 'ndjson' for one-JSON-object-per-line stderr output (timestamp + level + message + structured fields). Default is human-readable plain text (obsidian-brain: <message>). Useful for piping logs into aggregators (Datadog, Loki, Vector, journald) that index structured fields.", "required": false, "secret": false, "default": "" } ], "requirements": [ "安装 Node.js / npm" ] }, "provenance": { "registryServer": "io.github.sweir1/obsidian-brain", "registryVersion": "1.7.24", "registryUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.sweir1%2Fobsidian-brain/versions/1.7.24", "repository": "sweir1/obsidian-brain", "sourceCommit": "bcc97e2406232cb552e55f5432e8b8610a811ba7", "namespaceRepositoryOwnerMatched": true, "package": { "registry": "npm", "identifier": "obsidian-brain", "version": "1.7.24", "integrity": "sha512-WjwhaD4WAhtIetaOPXXrdqwkzd7qz25LcFiFf0lCCir5MPuzRtpm46JlFHZnKIvkWWY84wmoHR/DfGxSZI0e1A==", "packageRepositoryMatched": true, "checkedAt": "2026-10-21T01:16:02.500Z" }, "scope": "Install configuration verified; dependency implementation and remote behavior have not been audited" } }