Mehran Ziadloo160 downloadsExtension for Local REST API to add second brain MCP server
This plugin is an extension (or "meta-plugin") for the Obsidian Local REST API plugin. It transforms your Obsidian vault into a powerful, AI-ready "Second Brain" by exposing a specialized Model Context Protocol (MCP) server endpoint.
The primary goal of this extension is to provide Large Language Models (LLMs) with intelligent, semantically grounded access to your personal knowledge base. Instead of dumping your entire vault into an LLM's context window, this plugin uses a localized semantic search engine to find the most relevant notes.
When an LLM queries your wiki, the plugin performs:
all-MiniLM-L6-v2) to find the best entry points (root nodes) based on the meaning of the query.This ensures the LLM receives highly relevant, interconnected information while remaining extremely token-efficient.
The parent plugin (Obsidian Local REST API) provides the foundational infrastructure:
This Second Brain MCP Extension builds on top of that infrastructure:
/second-brain-mcp/) using the parent plugin's API.query_wiki, get_wiki, wiki_card) tailored for agentic workflows, complete with semantic ranking and graph exploration.When downloading this plugin from the GitHub Releases page, you will notice two different sets of artifacts available for every release version. They are explicitly separated so they do not contaminate each other:
Standard Artifacts (main.js, manifest.json, styles.css)
obsidian-local-rest-api-second-brain-api-extension inside your vault's .obsidian/plugins/ directory, and place these three files inside it.Native Artifact (native.zip)
obsidian-local-rest-api-second-brain-mcp-extension-native) which includes the main.js, manifest.json, and styles.css, but critically includes a pruned node_modules directory containing pre-compiled C++ binaries..obsidian/plugins/ directory. It will automatically create the properly named plugin folder for you.main.ts to advertise your new route(s).npm run build (or npm run dev if you are iterating on some changes)..obsidian/plugins directory. On linux or osx, you can run ln -s /path/to/your/cloned/fork /path/to/your/vault/.obsidian/plugins.Due to strict browser security constraints within Obsidian's Electron environment (specifically the disabling of SharedArrayBuffer), WebAssembly multi-threading is completely blocked. Furthermore, the Hugging Face WebGPU backend is currently unsupported or highly unstable in this context. Consequently, the default build of this plugin is forced to rely on a single CPU core for embedding generation to remain a safe, pure-JavaScript cross-platform plugin suitable for the Community Directory.
While the initial indexing of your vault may take some time in single-core mode, all generated embeddings are cached locally, ensuring that all subsequent queries are lightning fast.
If you are running this plugin locally and want to bypass Obsidian's browser sandbox to unlock full multi-core CPU performance for indexing, this project features a dual-build architecture.
By running the native build command, the plugin will compile using the native onnxruntime-node C++ binary instead of WebAssembly, restoring full multi-threading:
npm run build:native
main.js file, you must copy the local node_modules dependencies into your vault's plugin folder so the plugin can resolve them at runtime:cp -rL node_modules/ /path/to/your/vault/.obsidian/plugins/obsidian-local-rest-api-second-brain-api-extension/
Initializing pipeline in Native Multi-Core mode... in your developer console.Standard Build Commands:
npm run build: Compiles the standard, pure-JS, single-core package for Obsidian community distribution.npm run dev: Watches files and builds the standard package on changes.npm run build:native: Compiles the high-performance, multi-core native package.npm run dev:native: Watches files and builds the native package on changes.