Building an MCP Server for Obsidian: AI-Powered Note Search
If you use Obsidian as your second brain, you already have a rich knowledge base sitting on your local filesystem. Design docs, meeting notes, architecture decisions, project specs -- all of it written in markdown, all of it potentially useful when you are working in Claude Code. MCP makes it possible to bridge the two.
Why connect Obsidian to Claude Code?
The core idea is simple: give Claude Code access to your notes so it can pull in relevant context while you work. This complements Claude Code's built-in memory features by adding your full knowledge base to the mix. Instead of manually copying from Obsidian into a prompt, you search your vault directly from the coding session.
This is useful when you:
- Need to reference a design doc while implementing a feature
- Want to pull in meeting notes that contain requirements or decisions
- Have an internal knowledge base with API docs, conventions, or onboarding material
- Keep a personal log of past debugging sessions and want to search them
The key benefit over manual copy-paste is speed and completeness. Claude Code can search across your entire vault, surface relevant sections, and incorporate them into its working context without you switching windows.
Two approaches
Filesystem MCP server pointed at your vault
The simplest approach. Obsidian vaults are just directories of markdown files. The official @modelcontextprotocol/server-filesystem package can read them directly.
In your Claude Code MCP config (~/.claude/settings.json or your project's .mcp.json), using the same pattern as a Postgres MCP server or any other MCP connection:
{
"mcpServers": {
"obsidian-vault": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/Documents/MyVault"
]
}
}
}
This gives Claude Code read access to every file in your vault. It can list directories, read files, and search file contents. It is straightforward and requires no additional tooling.
Limitations: no awareness of Obsidian-specific features like backlinks, tags, or graph relationships. It treats your vault as a flat collection of markdown files.
Dedicated Obsidian MCP servers
Community-built MCP servers exist that understand Obsidian's data model more deeply. These typically connect to Obsidian's Local REST API plugin or parse vault metadata directly.
Look for servers that support:
- Tag-based search
- Backlink traversal
- Full-text search with ranking
- Dataview query integration
The tradeoff is more setup (you need the REST API plugin running in Obsidian) but richer query capabilities. For most coding workflows, the filesystem approach is sufficient. If you rely heavily on Obsidian's linking and tagging, a dedicated server is worth the extra configuration.
Example workflows
Pulling design docs into implementation context
You are building a new API endpoint. Your vault has a design doc at Projects/api-redesign/auth-endpoints.md. During your Claude Code session:
"Read my design doc at Projects/api-redesign/auth-endpoints.md from my Obsidian vault and implement the token refresh endpoint according to that spec."
Claude Code reads the doc via MCP and uses it as the specification for code generation. No copying, no context switching.
Searching notes while debugging
Your vault contains past debugging notes. You hit a similar issue:
"Search my Obsidian vault for notes mentioning 'connection pool exhaustion' and summarize what I found last time."
Claude Code searches across your vault, finds the relevant note, and gives you the summary alongside your current debugging session.
Using meeting notes as requirements
After a planning meeting, you drop your notes into Obsidian. Later in Claude Code:
"Read this week's sprint planning notes from my vault under Meetings/ and create tickets based on the action items we discussed."
The meeting notes become direct input to the task at hand.
Organizing your vault for MCP
A few structural choices make your vault work better with MCP search:
Use descriptive filenames. MCP file listing returns names, not content. 2026-03-auth-redesign-spec.md is more useful than meeting-notes-3.md when Claude Code is deciding which files to read.
Keep a consistent folder structure. Group by project or topic. Projects/, Meetings/, References/, Debugging/ -- whatever fits your workflow. This lets you direct Claude Code to search specific subdirectories instead of the entire vault.
Front-load context in documents. Put the summary, purpose, or key decisions at the top of each note. When Claude Code reads a file, the opening lines help it decide if the document is relevant without reading the entire thing.
Use clear headings. Markdown headings are natural section boundaries. They help Claude Code extract specific sections rather than pulling in entire long documents.
Tag consistently. If you use a dedicated Obsidian MCP server that supports tag search, consistent tagging pays off. Tags like #architecture-decision, #api-spec, or #postmortem make targeted searches much faster.
Privacy considerations
This is worth emphasizing: your notes stay local. MCP servers run on your machine. When Claude Code reads a file from your vault via MCP, it goes from your filesystem into the Claude Code process on your machine, then to the API as part of your conversation context.
There is no separate sync, no third-party service involved beyond the Claude API itself. Your vault is not indexed externally. Nothing is uploaded in bulk. Only the specific files or search results that Claude Code requests get sent as part of your conversation.
If your vault contains sensitive material, you can scope the filesystem MCP server to specific subdirectories rather than the entire vault. Point it at MyVault/Work/ instead of MyVault/ to exclude personal notes.
You can also use .mcpignore or similar mechanisms (depending on the server) to exclude specific files or patterns -- journals, private notes, credentials.
Getting started
The minimum viable setup takes about two minutes:
- Install the filesystem MCP server in your Claude Code config as shown above.
- Point it at your Obsidian vault path.
- Restart Claude Code.
- Ask Claude Code to list files in your vault to confirm the connection works.
MCP servers are just one way to extend Claude Code — you can also explore skills, plugins, and subagents for other types of integrations. From there, start using it naturally. Reference specific files when you need context. Ask Claude Code to search for topics. Over time, you will develop a sense for which parts of your knowledge base are most useful to pull into coding sessions, and you can organize accordingly.