Skip to main content

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 watchdog to 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 vss extension 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:

  1. Start an interactive session: copilot (or gh copilot chat).
  2. Run the /mcp add command 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_duckvault-0.2.1.tar.gz (122.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_duckvault-0.2.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_duckvault-0.2.1.tar.gz.

File metadata

  • Download URL: mcp_duckvault-0.2.1.tar.gz
  • Upload date:
  • Size: 122.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_duckvault-0.2.1.tar.gz
Algorithm Hash digest
SHA256 24a2b80d8945e21e44f21d779ca1c77e017a48e262c2dbd2a74759a04c295532
MD5 bf3e3ab88ce1212fa38b3c4f11e2c258
BLAKE2b-256 7e4cc790c5e11e5818af438440be6003506fd089283d4ad06990b44ecb4f0e6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_duckvault-0.2.1.tar.gz:

Publisher: pypi-publish.yml on caron14/mcp-duckvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_duckvault-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_duckvault-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_duckvault-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 abfb52b9a33e3cbee7d324840f2f993ea802613fa391a91a69ea0e9eefa88449
MD5 7ebdcd23783e292ce2bfc807d48e8a61
BLAKE2b-256 468321052957713454ba6e6c671c56ff94a1533a52afceeda61ca045bc0fd5eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_duckvault-0.2.1-py3-none-any.whl:

Publisher: pypi-publish.yml on caron14/mcp-duckvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page