Suggested for securely managing API keys and environment variables without hardcoding them into scripts or committing them to version control.
Enables AI agents to perform knowledge discovery and analysis across an Obsidian vault, offering powerful search capabilities with filtering by path, title, tags, dates, and regex patterns, as well as the ability to retrieve full note content and browse vault structure.
Obsidian MCP Server
An MCP (Model Context Protocol) server that enables AI agents to perform sophisticated knowledge discovery and analysis across your Obsidian vault through the Local REST API plugin.
Why This Matters
This server transforms your Obsidian vault into a powerful knowledge base for AI agents, enabling complex multi-step workflows like:
- "Retrieve notes from my 'Projects/Planning' folder containing 'roadmap' or 'timeline' in titles, created after April 1st, then analyze them for any blockers or dependencies and present a consolidated risk assessment with references to the source notes"
- "Find all notes tagged with 'research' or 'analysis' from the last month, scan their content for incomplete sections or open questions, then cross-reference with my 'Team/Expertise' notes to suggest which colleagues could help address each gap"
- "Get the complete content of meeting notes from 'Leadership/Quarterly' containing 'budget' or 'headcount', analyze them for action items assigned to my department, and create a chronological timeline with source note references"
The server's advanced filtering, regex support, and full content retrieval capabilities allow agents to perform nuanced knowledge work that would take hours manually.
Prerequisites
- Install the Obsidian Local REST API plugin in your Obsidian vault
- Configure and enable the plugin in Obsidian settings
- Note the API URL (default:
https://localhost:27124
) and API key if you've set one
Installation
From PyPI (Recommended)
Add to MCP Configuration
Add to your MCP client configuration (e.g., Claude Desktop):
From Source (Development)
Configuration
Set environment variables for the Obsidian API:
Important Security Note: Avoid hardcoding your OBSIDIAN_API_KEY
directly into scripts or committing it to version control. Consider using a .env
file (which is included in the .gitignore
of this project) and a library like python-dotenv
to manage your API key, or use environment variables managed by your operating system or shell.
Note: The server defaults to HTTPS and disables SSL certificate verification for self-signed certificates commonly used with local Obsidian instances. For HTTP connections, set OBSIDIAN_API_URL="http://localhost:27123"
.
Usage
Run the MCP server:
Available Tools
The server provides three powerful tools:
search_vault
- Advanced search with flexible filters and full content retrieval:query
- Text or regex search across note content (optional)query_type
- Search type: "text" (default) or "regex"search_in_path
- Limit search to specific folder pathtitle_contains
- Filter by text in note titles (string, array, or JSON string)title_match_mode
- How to match multiple terms: "any" (OR) or "all" (AND)tag
- Filter by tag (string, array, or JSON string - searches frontmatter and inline #tags)tag_match_mode
- How to match multiple tags: "any" (OR) or "all" (AND)context_length
- Amount of content to return (set high for full content)include_content
- Boolean to retrieve complete content of all matching notescreated_since/until
- Filter by creation datemodified_since/until
- Filter by modification datepage_size
- Results per pagemax_matches_per_file
- Limit matches per note
Key Features:
- When no
query
is provided, automatically returns full content for filter-only searches include_content=True
forces full content retrieval for any search- Supports regex patterns for complex text matching (OR conditions, case-insensitive search, etc.)
get_note_content
- Retrieve complete content and metadata of a specific note by pathbrowse_vault_structure
- Navigate vault directory structure efficiently:path
- Directory to browse (defaults to vault root)include_files
- Boolean to include files (default: False, folders only for speed)recursive
- Boolean to browse all nested directories
Example Use Cases
Basic Searches
- Find notes by title in a specific folder:
- Find notes with multiple title terms (OR logic):
- Find notes with ALL title terms (AND logic):
- Get all recent notes with full content:
- Text search with context:
- Search by tag:
- Regex search for OR conditions:
- Regex search for tasks assigned to specific people:
Advanced Multi-Step Workflows
These examples demonstrate how agents can chain together sophisticated knowledge discovery tasks:
- Strategic Project Analysis:Agent can then analyze dependencies, identify risks, and recommend resource allocation
- Meeting Action Item Mining:
Agent scans content for action items, extracts assignments, and creates chronological tracking
- Research Gap Analysis:
Agent identifies knowledge gaps and suggests team members who could help
- Vault Structure Exploration:
- Tag-Based Knowledge Mapping:
Development
License
This project is licensed under the MIT License - see the LICENSE file for details.
You must be authenticated.
A server that enables AI agents to perform sophisticated knowledge discovery and analysis across Obsidian vaults through the Local REST API plugin, supporting complex multi-step workflows with advanced filtering and full content retrieval.
- Why This Matters
- Prerequisites
- Installation
- Configuration
- Usage
- Available Tools
- Example Use Cases
- Development
- License
Related Resources
Related MCP Servers
- -securityAlicense-qualityEnables AI assistants to interact with Obsidian vaults, providing tools for reading, creating, editing and managing notes and tags.Last updated -598149TypeScriptMIT License
- -securityAlicense-qualityProvides programmatic search functionality for Obsidian vaults through a REST API interface, allowing external applications to search through notes and retrieve absolute paths to matching documents.Last updated -10PythonMIT License
- -securityAlicense-qualityProvides a standardized interface for AI assistants to interact with Obsidian vaults through a local REST API, enabling reading, writing, searching, and managing notes.Last updated -37TypeScriptMIT License
- -securityFlicense-qualityA lightweight server that enables AI assistants like Cursor & Claude to read from and write to Obsidian vaults, allowing actions like creating notes, checking existing content, and managing todos through natural language.Last updated -1928TypeScript