Obsidian MCP Wrapper
Provides controlled retrieval and human-gated write access to an Obsidian vault's Markdown notes, including search, section reading, entity context, and append operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Obsidian MCP Wrapperfind notes about the Q3 roadmap"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Obsidian MCP Wrapper
Obsidian MCP Wrapper is a session-stateless MCP retrieval system for an agency Obsidian vault. It gives Claude Desktop users controlled access to indexed Markdown knowledge without giving the model direct, unbounded filesystem access or unsupervised write privileges.
The runtime has two layers:
pf-mcp: a lightweight STDIO MCP shim that runs on each Claude Desktop workstation.pf-index: a shared LAN/VPN retrieval service that owns the vault index, signed handles, bearer-token authentication, rate limits, write locking, and the audit log.
The design goal is progressive disclosure: search returns compact snippets and signed section handles first, then Claude expands only the context it needs.
Highlights
Standard-library core runtime for the default HTTP server path.
Optional FastAPI/uvicorn ASGI boundary.
SQLite FTS5 lexical search over immutable vault index epochs.
HMAC-signed section handles that resolve against retained snapshots.
Manifest-only filesystem access for indexed Markdown paths.
Human-gated append writes into client, provider, carrier, and operational notes.
Autonomous AI notes routed to a rotated capture inbox by default.
File locking and SQLite audit records for write operations.
Sanitized error envelopes that avoid leaking paths, tokens, URLs, or tracebacks into Claude.
Quick-start, deployment, teardown, and nightly-refresh scripts.
Related MCP server: Obsidian Index MCP Server
Runtime Topology
Claude Desktop
-> STDIO MCP JSON-RPC
-> pf-mcp workstation shim
-> HTTP POST /tools/<tool_name>
-> pf-index LAN/VPN service
-> Obsidian_Vault Markdown snapshots and .pf_index artifactspf-index consumes Markdown and derived index artifacts. It does not need the
source DuckDB database at runtime.
Repository Layout
.
|-- Docs/
| |-- ARCHITECTURE.md
| |-- DEPLOYMENT.md
| |-- QUICKSTART.md
| `-- MCP_WRAPPER_MASTER_PROMPT.md
|-- config/
| |-- claude_desktop_config.example.json
| |-- deployment_manifest.example.json
| |-- pf-index.example.toml
| `-- pf-mcp.env.example
|-- pf_index/
| |-- api/ HTTP boundaries
| |-- core/ indexing, retrieval, crypto, paths, writes
| `-- config.py TOML and environment configuration
|-- pf_mcp/
| `-- main.py STDIO MCP shim
|-- scripts/
| |-- build_index.py
| |-- run_pf_index.py
| |-- quickstart.sh
| |-- quickstart_teardown.sh
| |-- nightly_refresh.sh
| |-- deploy_interactive.sh
| `-- deploy_teardown.sh
|-- tests/
|-- pyproject.toml
`-- requirements.lockMCP Tools
The shim exposes these tools to Claude:
Tool | Purpose |
| Search indexed vault sections and return snippets with signed handles. |
| Search strategy, advisory, sales, renewal, and operating-system material. |
| Find likely note paths by query. |
| Return a bounded summary/outline for one note path. |
| Entity-oriented search wrapper. |
| Search indexed table-like content. |
| Resolve one signed handle into a larger section excerpt. |
| Resolve several signed handles within a token budget. |
| Retrieve full materialized context for one known client or provider. |
| Combine profile evidence with strategy context for planning questions. |
| Return index and vault statistics. |
| Append a factual note through the gated write pipeline. |
| Remove a specific generated note entry by note id. |
Security Model
Important boundaries:
The MCP shim validates argument shapes and hard limits before forwarding to the LAN service.
The LAN service requires
Authorization: Bearer <token>.Tokens map to user ids for audit and idempotency.
Runtime reads are limited to paths listed in the active index manifest.
Path validation rejects absolute paths, traversal, null bytes, URL schemes, Windows drive paths, and backslash paths.
Section handles contain path, line range, content hash, file hash, vault id, and index epoch, then are signed with HMAC-SHA256.
Old handles resolve against retained immutable snapshots, not changed live vault files.
Autonomous writes are redirected to the configured capture inbox unless the human explicitly directs a write to a specific note.
Write operations are append-only/gated, locked, audited, and bounded by configured note length limits.
Requirements
Python 3.11 or newer
Markdown Obsidian vault directory
HMAC secret for handle signing
One or more bearer tokens for users
The default pf_index.api.server HTTP boundary uses only the Python standard
library. Optional FastAPI dependencies are listed in requirements.lock:
python -m pip install -r requirements.lockQuick Start
For a complete local smoke test, use the maintained guide:
sed -n '1,240p' Docs/QUICKSTART.mdThe short version:
export PF_APP_DIR="$PWD"
export PF_DEMO_ROOT=/tmp/pf-mcp-demo
export PF_VAULT_ROOT="$PF_DEMO_ROOT/Obsidian_Vault"
export PF_INDEX_ROOT="$PF_DEMO_ROOT/.pf_index"
export PF_AUDIT_DB="$PF_INDEX_ROOT/write_audit.sqlite"
export PF_INDEX_HMAC_SECRET="local-demo-secret-change-me"
export PF_INDEX_TOKEN="local-demo-token"
export PF_INDEX_CONFIG="$PF_DEMO_ROOT/pf-index.toml"Create a small test vault and config as shown in Docs/QUICKSTART.md, then
build an index:
PYTHONPATH="$PF_APP_DIR" python -m scripts.build_index \
--config "$PF_INDEX_CONFIG" \
--epoch 2026-06-08T120000ZRun the stdlib HTTP server:
PYTHONPATH="$PF_APP_DIR" \
PF_INDEX_HMAC_SECRET="$PF_INDEX_HMAC_SECRET" \
python -m pf_index.api.server \
--host 127.0.0.1 \
--port 8765 \
--config "$PF_INDEX_CONFIG"Search through the API:
curl -s \
-H "Authorization: Bearer $PF_INDEX_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"Coverage","max_results":3,"max_tokens":1000}' \
http://127.0.0.1:8765/tools/vault_search \
| python -m json.toolList MCP tools through the shim:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| PYTHONPATH="$PF_APP_DIR" \
PF_INDEX_URL="http://127.0.0.1:8765" \
PF_INDEX_TOKEN="$PF_INDEX_TOKEN" \
python -m pf_mcp.main \
| python -m json.toolOr run the automated path:
bash scripts/quickstart.shTear down demo artifacts:
bash scripts/quickstart_teardown.shConfiguration
Server-side config lives in TOML. Start from:
cp config/pf-index.example.toml pf-index.tomlKey sections:
[paths]:vault_root,index_root, andaudit_db[limits]: result, token, note length, lock timeout, and concurrency limits[security]:vault_idand HMAC secret source[tokens]: bearer token to user id map[inbox]: rotated inbox path for autonomous captures[retention]: retained immutable index epochs
Workstation shim config is environment-based. Start from:
cp config/pf-mcp.env.example pf-mcp.envClaude Desktop config example:
cat config/claude_desktop_config.example.jsonIndexing
Build an immutable index epoch:
PYTHONPATH="$PWD" python -m scripts.build_index --config /path/to/pf-index.tomlEach epoch contains:
.pf_index/builds/<epoch>/
|-- manifest.json
|-- lexical.sqlite
`-- content/<sha256-of-relative-path>.mdThe active epoch is selected through .pf_index/ACTIVE. Rolling back is a
controlled edit of that pointer to a retained epoch.
Running The Service
Default stdlib server:
PYTHONPATH="$PWD" python -m pf_index.api.server \
--host 127.0.0.1 \
--port 8765 \
--config /path/to/pf-index.tomlOptional FastAPI boundary:
python -m pip install -r requirements.lock
PYTHONPATH="$PWD" uvicorn pf_index.api.fastapi_app:create_app --factory \
--host 127.0.0.1 \
--port 8765Testing
Run acceptance and structure tests:
PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -s tests -vThe tests focus on safety contracts such as path validation, signed handles, indexing behavior, write routing, and repository structure.
Deployment
Use Docs/DEPLOYMENT.md for the production runbook. It covers:
Dedicated service user and filesystem permissions
Code and vault placement
HMAC secret generation
User token generation
Index build and startup checks
systemdservice setupLAN/VPN binding and firewall posture
Runtime egress denial
Token rotation
Audit recovery
Rollback
scripts/deploy_interactive.sh and scripts/deploy_teardown.sh support guided
deployment and cleanup flows.
Nightly Refresh
scripts/nightly_refresh.sh supports a scheduled flow:
sync or refresh source data
-> optionally rebuild Markdown vault from DuckDB
-> build a new immutable index epoch
-> atomically update ACTIVEIf DuckDB-to-Markdown generation happens elsewhere, omit PF_SOURCE_DATABASE
and rebuild the index from the current vault.
Data Boundary
Do not commit or deploy local data artifacts:
agency_core.duckdbGenerated
Obsidian_Vault/.pf_index/builds.obsidian/.vault_saltReal
.envfilesAudit databases
Exported CSVs, spreadsheets, or reports
The repository is meant to contain application code, tests, docs, and placeholder configuration only.
Further Reading
Docs/ARCHITECTURE.mdfor the full design and safety modelDocs/QUICKSTART.mdfor local smoke testingDocs/DEPLOYMENT.mdfor production operationsDocs/MCP_WRAPPER_MASTER_PROMPT.mdfor operator-facing MCP usage guidance
Available Tools
13 toolsadvisory_contextD
advisory_context
Inputs: path, query, max_tokens, strategy_query.
append_human_noteD
append_human_note
Inputs: path (required), evidence (required), note_text (required), is_human_directed (required), +1 more.
expand_contextD
expand_context
Inputs: handles (required), max_tokens.
find_noteD
find_note
Inputs: query (required), max_results.
get_entity_contextD
get_entity_context
Inputs: query (required), max_tokens, max_results.
get_full_profileD
get_full_profile
Inputs: path, query, max_tokens.
get_note_summaryD
get_note_summary
Inputs: path (required).
read_sectionD
read_section
Inputs: handle (required), max_tokens.
remove_noteD
remove_note
Inputs: path (required), note_id (required), reason, heading.
search_tablesD
search_tables
Inputs: query, max_results.
strategy_searchD
strategy_search
Inputs: query (required), max_tokens, max_results.
vault_searchD
vault_search
Inputs: query (required), max_tokens, max_results.
vault_statsD
vault_stats
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 13 tools
Multiple tools overlap in purpose: vault_search, strategy_search, find_note, and search_tables all appear to perform search-like operations with unclear distinctions. Similarly, get_entity_context, get_full_profile, and advisory_context all seem to provide contextual or profile information, making it difficult for an agent to choose the right tool.
Most tools follow a verb_noun pattern (find_note, get_note_summary, read_section), but vault_search and advisory_context break this convention, and search_tables mixes the order. The inconsistency is moderate, not chaotic, but noticeable.
13 tools is well within the typical 3-15 range and seems appropriately scoped for an Obsidian wrapper covering search, retrieval, and basic note management. The number does not feel excessive or thin.
The tool set covers search and read operations comprehensively, but lacks an explicit update or edit tool. append_human_note may create or append, but there is no clear mechanism to modify existing notes, which leaves a notable gap for a note management server.
Maintenance
Related MCP Connectors
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceObsidian vault connector for Claude Desktop - enables reading and writing Markdown notes using Model Context Protocol (MCP)17 npm5-
- FlicenseNot gradedqualityDmaintenanceProvides semantic search capability over Obsidian vaults and exposes recent notes as resources to Claude through the MCP protocol.9-
- AlicenseAqualityCmaintenanceGive Claude (and any MCP client) real agent access to your Obsidian vault — graph traversal, Dataview queries, daily-note awareness, and more.2525 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides Claude with read, search, and write access to an Obsidian vault through MCP tools.5,325 npmApache 2.0