DuckVault-MCP: Obsidian-DuckDB RAG System with MCP Server
Project description
DuckVault-MCP
DuckVault-MCP is an MCP (Model Context Protocol) server that provides a RAG (Retrieval-Augmented Generation) system for your Obsidian Vault using DuckDB and vector search.
Features
- Local Vector Search: Uses
sentence-transformers(intfloat/multilingual-e5-small) for local embeddings. - Obsidian URI Links: Includes direct links to open notes in Obsidian from search results.
- Incremental Indexing: Uses MD5 hashing to only update modified files.
- Real-time Monitoring: Uses
watchdogto index changes as you edit your notes. - Progress Indicators: Displays a progress bar during initial indexing for large vaults.
- Fast Search: Leverages DuckDB with the
vssextension and HNSW indexing for millisecond-level retrieval. - MCP Compatible: Works seamlessly with AI agents like Claude Code or Cursor.
Installation
# Using uv (recommended)
uv tool install mcp-duckvault
# From GitHub directly
uv tool install git+https://github.com/caron14/mcp-obsidian-duckdb.git
# From PyPI (once published)
pip install mcp-duckvault
Usage
Start the MCP server by pointing it to your Obsidian Vault:
duckvault /path/to/your/obsidian/vault
Options
--db-path: Path to the DuckDB file (default:~/.duckvault/vault.db).--sync-only: Perform a full sync of the vault and exit.-v, --verbose: Enable verbose logging.
CLI Examples
Basic usage:
duckvault /path/to/your/obsidian/vault
Custom database path: Specify a custom location for the DuckDB index file.
duckvault /path/to/your/obsidian/vault --db-path ./vault_index.db
Sync only (Headless mode): Index all files and exit without starting the MCP server.
duckvault /path/to/your/obsidian/vault --sync-only
Example Queries for AI Agents
Once connected, you can interact with your vault using natural language through an AI agent:
- Semantic Search: "Find notes about machine learning projects and list the key concepts mentioned."
- Filtered Search: "Search for notes about 'meeting' with the tag #work and summarize the action items."
- Stay Updated: "What are the most important notes I've worked on in the last 3 days?"
- Cross-Note Analysis: "Based on my recent notes about 'React', how has my understanding of Hooks evolved?"
Excluding Files (.vaultignore)
To exclude specific files or directories from being indexed, create a .vaultignore file in the root of your Obsidian Vault. The syntax is similar to .gitignore.
By default, .obsidian and .trash are always excluded.
Example .vaultignore:
# Exclude specific folders
private/
drafts/
# Exclude specific file types
*.tmp
*.log
Registration for AI Agents
This server is MCP (Model Context Protocol) compliant and can be used with the following agents after you have installed it via uv tool install or pip install.
Note: Please specify the vault path as an absolute path (e.g., /Users/username/Documents/MyVault).
Claude Desktop (macOS)
Add the following to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"duckvault": {
"command": "duckvault",
"args": [
"/absolute/path/to/your/obsidian/vault"
]
}
}
}
Claude Code
You can add the server persistently using the CLI command (recommended) or by editing the configuration file.
Using the CLI command:
claude mcp add duckvault -- duckvault /absolute/path/to/your/obsidian/vault
By editing the configuration file:
Add to ~/.claude.json:
{
"mcpServers": {
"duckvault": {
"command": "duckvault",
"args": [
"/absolute/path/to/your/obsidian/vault"
]
}
}
}
Gemini CLI
You can add the server persistently using the CLI command (recommended) or by editing the configuration file.
Using the CLI command:
gemini mcp add duckvault --scope user duckvault /absolute/path/to/your/obsidian/vault
By editing the configuration file:
Add to the mcpServers section of your configuration file (~/.gemini/settings.json).
{
"mcpServers": {
"duckvault": {
"command": "duckvault",
"args": [
"/absolute/path/to/your/obsidian/vault"
]
}
}
}
GitHub Copilot (in the CLI)
GitHub Copilot in the CLI supports MCP servers. You can add the server using the interactive /mcp command or by editing the configuration file.
Using the CLI command:
- Start an interactive session:
copilot(orgh copilot chat). - Run the
/mcp addcommand and follow the prompts.
By editing the configuration file:
Add to ~/.copilot/mcp-config.json:
{
"mcpServers": {
"duckvault": {
"command": "duckvault",
"args": [
"/absolute/path/to/your/obsidian/vault"
]
}
}
}
## MCP Tools
The server exposes the following tools to AI agents:
1. `search_notes(query: str, tag: Optional[str] = None, limit: int = 5)`: Search for relevant notes using natural language.
2. `list_recent_notes(days: int = 7)`: List notes that were recently updated.
## License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_duckvault-0.2.0.tar.gz.
File metadata
- Download URL: mcp_duckvault-0.2.0.tar.gz
- Upload date:
- Size: 121.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf7a6aa9a3a7712015885cd792122891a7b95848bda5bfe52cc10428bdfb6f84
|
|
| MD5 |
2e8e2113d06c05782081acbc47c5ea2c
|
|
| BLAKE2b-256 |
f76a0c91f4a2e2b6e13b1a066f79bbf7ccb38292df06b85806c1b0da274b8fb3
|
Provenance
The following attestation bundles were made for mcp_duckvault-0.2.0.tar.gz:
Publisher:
pypi-publish.yml on caron14/mcp-duckvault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_duckvault-0.2.0.tar.gz -
Subject digest:
cf7a6aa9a3a7712015885cd792122891a7b95848bda5bfe52cc10428bdfb6f84 - Sigstore transparency entry: 1340578864
- Sigstore integration time:
-
Permalink:
caron14/mcp-duckvault@c3204e70e8a17850b67d4ebc655c0d4f929d0b87 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/caron14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@c3204e70e8a17850b67d4ebc655c0d4f929d0b87 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_duckvault-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_duckvault-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e32034f17be8904c8fcc7d484b1b5068d1d2781b6e9871bd2362d98883295f6a
|
|
| MD5 |
f5d45046b76c30fc69404205bc495f2b
|
|
| BLAKE2b-256 |
8afb5834d9d74ea07cdaf52b77154ddcc2de373ebbf5d4613a65ae43b349ac7c
|
Provenance
The following attestation bundles were made for mcp_duckvault-0.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on caron14/mcp-duckvault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_duckvault-0.2.0-py3-none-any.whl -
Subject digest:
e32034f17be8904c8fcc7d484b1b5068d1d2781b6e9871bd2362d98883295f6a - Sigstore transparency entry: 1340578867
- Sigstore integration time:
-
Permalink:
caron14/mcp-duckvault@c3204e70e8a17850b67d4ebc655c0d4f929d0b87 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/caron14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@c3204e70e8a17850b67d4ebc655c0d4f929d0b87 -
Trigger Event:
push
-
Statement type: