Antigravity Obsidian MCP: Localized Knowledge Graph Access
High-Performance Model Context Protocol Server for Obsidian Vaults
A high-performance, ultra-secure, and robust Model Context Protocol (MCP) server written in Rust that exposes Obsidian Vault operations to LLM clients (such as Antigravity AI, Claude Desktop, Cursor, and other agentic interfaces).
This server implements the formal MCP specification using high-fidelity JSON-RPC 2.0 framing over standard input/output (stdio), completely isolated from network interfaces to guarantee localized data sovereignty.
🏗️ Core Architecture & Design
The server operates strictly over standard input (stdin) and standard output (stdout), communicating via JSON-RPC 2.0 frames. All system diagnostics, informational heartbeat logs, and runtime warnings are directed exclusively to standard error (stderr) to prevent the corruption of the JSON-RPC communication channel.
🔒 Rigorous Security & Guardrails
Obsidian vaults are local markdown folders, making secure path resolution a top priority. This server implements multi-layered, active security guardrails to completely neutralize path traversal attacks and system manipulation:
std::fs::canonicalize) on startup. All target files are structurally checked against this root path via .starts_with(). - Anti-Traversal Filters: Any incoming note title containing parent directory references (..), drive letters, or absolute paths (e.g. C:\, /etc/passwd) is immediately rejected before filesystem interaction. - Windows Device Protections: Actively blocks creation or reading of Windows reserved device names (e.g., CON, PRN, AUX, NUL, COM1-9, LPT1-9) that can lock up or corrupt Windows operating systems. - Extension Enforcement: Automatically forces the .md extension on all target files, preventing writing to scripts, configuration files, or arbitrary executables.🛠️ Exposed MCP Tools
The server registers four core tools with the LLM client, allowing rich, programmatic manipulation of Obsidian notes:
1. create_note
Creates a brand-new Markdown note in the Obsidian vault, injecting a standardized YAML frontmatter block containing the current creation date and an array of tags.
- Parameters:
title(string, required): The title of the note. Subdirectories are supported (e.g.Work/Projects/Q2-Goals).content(string, required): The core Markdown body of the note.tags(array of strings, optional): Tags to inject into the frontmatter.- Safety Check: Rejects operation if the target note already exists, preventing accidental overrides.
2. append_note
Appends new text content directly to the bottom of an existing note.
- Parameters:
title(string, required): The title of the note to append to.content(string, required): The Markdown text to append.- Visual Design: Automatically prefixes the new section with a clean, timestamped header:
## Update: YYYY-MM-DD HH:MM:SS.
3. read_note
Reads and returns the full text content of an existing note.
- Parameters:
title(string, required): The title of the note.- Search Intelligence: Features a recursive search fallback. If the exact path is not matched immediately, the server searches the entire vault case-insensitively to locate the note.
4. search_vault
Performs a recursive, case-insensitive, high-performance full-text search across all .md files in the vault.
- Parameters:
query(string, required): The case-insensitive query string to look for.- Returns: A list of matching relative file paths (e.g.
["Inbox/Tasks.md", "Archive/OldNotes.md"]).
🤖 AI Agent System Manual & Directives
When interacting with the Obsidian Vault via this MCP server, the AI agent must adhere to the following strict behavioral directives to maintain vault integrity and structure:
- Knowledge Graph Curation: Proactively link notes together using standard
[[WikiLinks]]to build a dense, connected second brain. - YAML Frontmatter: Let the server handle default date/tag frontmatter generation via the
tagsarray parameter instead of manually constructing frontmatter blocks in the content. - Title Resolution: Cache and use exact titles where possible to bypass recursive filesystem scans and minimize search latencies.
- Sandboxing Compliance: Never attempt to traverse outside the vault boundary (the server will immediately reject paths containing
.., absolute roots, or Windows device names).
🖥️ Client Integration & Installation
To configure and run the standalone compiled binary (obsidian_mcp.exe / obsidian_mcp), register it with your preferred AI client:
👾 1. Installing into Antigravity AI (Recommended)
Add the following configuration block to mcp_config.json inside %USERPROFILE%\.gemini\antigravity:
{
"mcpServers": {
"obsidian-mcp": {
"command": "C:\\Antigravity projects\\Rust\\obsidian_mcp\\bin\\obsidian_mcp.exe",
"args": [],
"env": {
"OBSIDIAN_VAULT_PATH": "C:\\Obsidian\\Vault"
}
}
}
}
\\.🛰️ 2. Installing into Cursor IDE
- Open Cursor and navigate to Cursor Settings > Features > MCP.
- Click + Add New MCP Server and input the details:
- Name:
obsidian-mcp - Type:
command - Command:
C:\Antigravity projects\Rust\obsidian_mcp\bin\obsidian_mcp.exe
💬 3. Installing into Claude Desktop
Add the config block to claude_desktop_config.json in %APPDATA%\Claude\:
{
"mcpServers": {
"obsidian-mcp": {
"command": "C:\\Antigravity projects\\Rust\\obsidian_mcp\\bin\\obsidian_mcp.exe",
"args": [],
"env": {
"OBSIDIAN_VAULT_PATH": "C:\\Obsidian\\Vault"
}
}
}
}