obsidian-mcp-context
Parses an Obsidian vault and exposes structured context (notes, blocks, tasks, headings) through MCP tools, enabling AI clients to query and reason over local markdown notes.
README
obsidian-mcp-context
Turn textual Obsidian vault notes into AI-ready context exposed through MCP.
This project does not run an AI model itself. It parses an Obsidian vault and exposes structured context to an MCP-aware AI client. The AI client provides the model; this server provides the vault tools.
Features
- Obsidian Markdown files (
.md) by default. - Optional plain
.txtparsing as generic text blocks only. - Synthetic demo vault under
examples/synthetic-vault. - Deterministic parsing of headings, heading paths, blocks, tasks, wikilinks, tags, and semantic lines.
- File, block, heading, and line-level provenance.
- CLI and MCP tools for listing notes, searching blocks, listing tasks, and fetching note context.
How The Pipeline Works
The intended workflow is:
- You have an Obsidian vault on disk.
- You install this package locally.
- You run the MCP server from this repo.
- Your MCP client connects to that server.
- The AI client calls tools such as
search_vault_blocksandlist_vault_tasks. - Each tool call includes a
vault_path, so the server knows which vault to parse. - The server returns structured JSON with source paths, headings, line numbers, blocks, links, tags, and tasks.
- The AI client uses that returned context to answer questions or help you work with the vault.
The model can be OpenAI, Anthropic, a local model, or anything else supported by your MCP client. This repo does not currently ask for an API key, configure a model, create embeddings, or talk to a local LLM directly.
Install For Local Development
Clone the repo and install it into a virtual environment:
git clone https://github.com/gavinsomers/obsidian-mcp-context.git
cd obsidian-mcp-context
python3 -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
After installation, the local commands are available at:
.venv/bin/obsidian-mcp-context
.venv/bin/obsidian-mcp-context-mcp
Try The Synthetic Vault
The repo includes a small synthetic Obsidian vault at
examples/synthetic-vault. Use it first to confirm the parser works before
pointing the tools at your own notes.
List notes:
.venv/bin/obsidian-mcp-context --vault examples/synthetic-vault notes
Search parsed blocks:
.venv/bin/obsidian-mcp-context --vault examples/synthetic-vault blocks --text renewal
List unchecked tasks:
.venv/bin/obsidian-mcp-context --vault examples/synthetic-vault tasks --unchecked
The output is JSON. It is intentionally verbose enough for an AI client to cite where each piece of context came from.
Use Your Own Obsidian Vault
Find the absolute path to your vault. For example:
/Users/gavin/Documents/Obsidian/Main Vault
or:
/home/gavman/notes/main-vault
Then run the same CLI commands with your vault path:
.venv/bin/obsidian-mcp-context --vault "/absolute/path/to/your/vault" notes
.venv/bin/obsidian-mcp-context --vault "/absolute/path/to/your/vault" blocks --text "renewal"
.venv/bin/obsidian-mcp-context --vault "/absolute/path/to/your/vault" tasks --unchecked
MCP Server
Start the MCP server manually with:
.venv/bin/obsidian-mcp-context-mcp
Available tools:
list_vault_notessearch_vault_blockslist_vault_tasksget_vault_note_context
Each MCP tool accepts a vault_path argument. That means you do not hard-code a
single vault into the server. Your client asks the tool to operate on a specific
vault path.
Configure An MCP Client
Add this server to your MCP client configuration. Use absolute paths for both
command and cwd.
{
"command": "/absolute/path/to/obsidian-mcp-context/.venv/bin/obsidian-mcp-context-mcp",
"args": [],
"cwd": "/absolute/path/to/obsidian-mcp-context"
}
For this repo checked out at /home/gavman/code/obsidian-mcp-context, the
configuration would be:
{
"command": "/home/gavman/code/obsidian-mcp-context/.venv/bin/obsidian-mcp-context-mcp",
"args": [],
"cwd": "/home/gavman/code/obsidian-mcp-context"
}
Once the client is connected, ask it to use the tools with your vault path. For example:
Use the Obsidian MCP context tools with vault_path "/home/gavman/notes/main-vault".
List my unchecked tasks related to renewal.
or:
Use vault_path "/home/gavman/notes/main-vault".
Search my vault for blocks about Project Atlas and return the source note and line numbers.
Tool Inputs
list_vault_notes
vault_path: path to the Obsidian vault.limit: maximum notes to return. Defaults to100.
search_vault_blocks
vault_path: path to the Obsidian vault.text: optional case-insensitive search text.source_path: optional filter for vault-relative source paths.heading: optional filter for heading paths.limit: maximum blocks to return. Defaults to25.
list_vault_tasks
vault_path: path to the Obsidian vault.checked: optional completion filter. Usefalsefor open tasks.text: optional case-insensitive search text.source_path: optional filter for vault-relative source paths.limit: maximum tasks to return. Defaults to50.
get_vault_note_context
vault_path: path to the Obsidian vault.source_path: vault-relative note path, such asProjects/Atlas.md.
Current AI Boundary
This repo is deliberately model-agnostic right now.
It does:
- Parse local Markdown notes.
- Preserve provenance.
- Return structured context through CLI and MCP tools.
- Let an MCP client decide how to use that context.
It does not:
- Ask for an OpenAI API key.
- Ask for an Anthropic API key.
- Connect to Ollama or another local model.
- Generate embeddings.
- Store vectors.
- Chat with your notes by itself.
If you want OpenAI, Anthropic, or local LLM support, configure that in your MCP client. The client supplies the model; this package supplies the Obsidian vault context.
Development
.venv/bin/python -m pytest
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.