yama66260721 downloadsEnables AI agents to use MCP tools for semantic vault search and editor actions via the companion MCP server.
A hybrid Model Context Protocol (MCP) ecosystem for Obsidian, providing vault-wide semantic intelligence and real-time editor context awareness.
intfloat/multilingual-e5-small, allowing high-precision search across Japanese, English, and 100+ other languages.The public MCP surface is organized around the actual agent workflow:
list_notessearch_notessemantic_search_notesget_semantic_index_statusrefresh_semantic_indexread_noteread_active_contextedit_notecreate_notepatch_note_metadatamove_notedelete_noteread_note and read_active_context both return machine-readable edit handoff payloads so agents can move from read to edit without reconstructing anchors manually.
For long persisted notes, prefer read_note with anchor.type = "line" and follow readMoreHint to walk the document in stable line windows. For active editor buffers, rerun read_active_context with the same or a larger maxChars instead of relying on continuation hints, because the unsaved buffer can change between reads.
To use Obsidian Companion MCP, you need to set up both the Obsidian plugin and the MCP server.
dist/plugin-release (after running just build) to your vault's .obsidian/plugins/companion-mcp/ directory.The MCP server acts as a bridge between AI agents and Obsidian.
.env For DevelopmentFor local development and just commands, create a root .env file and set:
OBSIDIAN_VAULT_PATH="/absolute/path/to/your/obsidian/vault"
This repository's justfile loads .env automatically, so commands such as just plugin-install can use the configured vault without extra shell prefixes.
For the best performance and fastest startup, we recommend installing the package globally:
npm install -g @yama662607/obsidian-companion-mcp
Then, use the obsidian-companion command in your MCP configuration.
Add the following to your claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonUsing Global Install (Recommended):
{
"mcpServers": {
"obsidian-companion": {
"command": "obsidian-companion",
"args": [],
"env": {
"OBSIDIAN_VAULT_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
Using npx (Quick start, but slower):
{
"mcpServers": {
"obsidian-companion": {
"command": "npx",
"args": ["-y", "@yama662607/obsidian-companion-mcp"],
"env": {
"OBSIDIAN_VAULT_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
Create a .mcp.json file in your project root or home directory:
{
"mcpServers": {
"obsidian-companion": {
"command": "obsidian-companion",
"args": [],
"env": {
"OBSIDIAN_VAULT_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
~/.codex/config.toml)[mcpServers.obsidian-companion]
command = "obsidian-companion"
args = []
[mcpServers.obsidian-companion.env]
OBSIDIAN_VAULT_PATH = "/absolute/path/to/your/obsidian/vault"
.gemini/settings.json){
"mcpServers": {
"obsidian-companion": {
"command": "obsidian-companion",
"args": [],
"env": {
"OBSIDIAN_VAULT_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
The OBSIDIAN_VAULT_PATH environment variable is required.
.obsidian/plugins/companion-mcp/. This ensures your index is portable and specific to each vault.Obsidian Companion MCP is part of a growing ecosystem designed to give AI agents full access to your knowledge base.
While this project focuses on text-based notes and semantic intelligence, we highly recommend using it alongside:
Why use them together? AI agents perform best when they have a holistic view of your work. By enabling both MCPs, your agent can:
This project consists of two main components:
/plugin): An Obsidian plugin that handles background indexing, semantic embedding generation, and exposes a local API for real-time editor context./mcp): A lightweight Node.js CLI that acts as an MCP server. It proxies requests from AI Agents to the Obsidian Plugin.@yama662607/obsidian-companion-mcp@yama662607/obsidian-companion-pluginintfloat/multilingual-e5-small (Transformers.js)