Skip to main content

MCP server for semantic search over Obsidian notes using local RAG

Project description

License: MIT

obsidian-notes-rag

MCP server for semantic search over your Obsidian vault. Uses OpenAI embeddings by default (or Ollama for local processing) with ChromaDB for vector storage.

What it does

Ask natural language questions about your notes:

  • "What did I write about project planning?"
  • "Find notes similar to my meeting notes from last week"
  • "What's in my daily notes about the API refactor?"

Requirements

  • Python 3.11+
  • OPENAI_API_KEY environment variable (or Ollama for local embeddings)

Quick Start

The easiest way to get started is with uvx (no installation required):

# Run the setup wizard
uvx obsidian-notes-rag setup

Add to Claude Code (CLI)

claude mcp add -s user obsidian-notes-rag -- uvx obsidian-notes-rag serve

Add to Claude Desktop (JSON config)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "obsidian-notes-rag": {
      "command": "uvx",
      "args": ["obsidian-notes-rag", "serve"]
    }
  }
}

Alternative: Clone and install

git clone https://github.com/ernestkoe/obsidian-notes-rag.git
cd obsidian-notes-rag
uv sync

uv run obsidian-notes-rag setup
claude mcp add -s user obsidian-notes-rag -- uv run --directory /path/to/obsidian-notes-rag obsidian-notes-rag serve

The setup wizard will:

  1. Ask for your embedding provider (OpenAI or Ollama)
  2. Configure your API key (for OpenAI)
  3. Set your Obsidian vault path
  4. Choose where to store the search index
  5. Optionally run the initial indexing

Manual Setup (alternative)

# Set your API key and index directly
export OPENAI_API_KEY=sk-...
uv run obsidian-notes-rag index --vault /path/to/your/vault

Using Ollama (local, offline)

# Install Ollama and pull the embedding model
ollama pull nomic-embed-text

# Run setup with Ollama, or index directly:
uv run obsidian-notes-rag --provider ollama index --vault /path/to/your/vault

MCP Tools

Once connected, these tools are available to Claude:

Tool What it does
search_notes Find notes matching a query
get_similar Find notes similar to a given note
get_note_context Get a note with related context
get_stats Show index statistics
reindex Update the index

Keeping the Index Fresh

Option 1: Manual reindex

uv run obsidian-notes-rag index

Option 2: Watch for changes

uv run obsidian-notes-rag watch

Option 3: Auto-start on login (macOS)

uv run obsidian-notes-rag install-service

CLI Reference

obsidian-notes-rag setup                # Interactive setup wizard
obsidian-notes-rag serve                # Start MCP server (for Claude Code)
obsidian-notes-rag index [--clear]      # Index vault (--clear to rebuild)
obsidian-notes-rag search "query"       # Search from command line
obsidian-notes-rag watch                # Watch for file changes
obsidian-notes-rag stats                # Show index stats
obsidian-notes-rag install-service      # Install macOS launchd service
obsidian-notes-rag uninstall-service    # Remove service
obsidian-notes-rag service-status       # Check service status

Configuration

Set your vault path and provider via CLI options or environment variables:

# CLI options
uv run obsidian-notes-rag --vault /path/to/vault index
uv run obsidian-notes-rag --provider ollama index

# Environment variables
export OBSIDIAN_RAG_VAULT=/path/to/vault
export OBSIDIAN_RAG_PROVIDER=ollama  # or "openai" (default)
Variable Description
OPENAI_API_KEY OpenAI API key (required for default provider)
OBSIDIAN_RAG_PROVIDER Embedding provider: openai (default) or ollama
OBSIDIAN_RAG_VAULT Path to Obsidian vault
OBSIDIAN_RAG_DATA Where to store the index (default: ./data)
OBSIDIAN_RAG_OLLAMA_URL Ollama API URL (default: http://localhost:11434)
OBSIDIAN_RAG_MODEL Override embedding model

How it works

  1. Parses your markdown files and splits them by headings
  2. Generates embeddings using OpenAI API (or Ollama for local processing)
  3. Stores vectors in ChromaDB (local, persistent)
  4. MCP server provides semantic search to Claude

Contributing

See CONTRIBUTING.md for development setup.

Support

Buy Me A Coffee

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

obsidian_notes_rag-0.2.2.tar.gz (168.6 kB view details)

Uploaded Source

Built Distribution

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

obsidian_notes_rag-0.2.2-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_notes_rag-0.2.2.tar.gz.

File metadata

  • Download URL: obsidian_notes_rag-0.2.2.tar.gz
  • Upload date:
  • Size: 168.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obsidian_notes_rag-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5d9b43851f5c0d24fdb7e56869dad674fbb1e3a6e55c92da5bce39cdb4b3b15c
MD5 f463d66a1f6942c04917b0ec560961f8
BLAKE2b-256 69f58d02c03b98d5a53fa430ee1b4d4965f2a497a97565145e75e09d90258a7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_notes_rag-0.2.2.tar.gz:

Publisher: release.yml on ernestkoe/obsidian-notes-rag

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

File details

Details for the file obsidian_notes_rag-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_notes_rag-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 610a45880c210fe92830d544665db05e14e70ee4d404c05e34efa4aec73c4180
MD5 cb624ef2dc6458bc7c517a2765cb21ec
BLAKE2b-256 838f07516c259d2f79e82429870cb0fed7be9c9e04ed10e20f57aca6d57f60d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_notes_rag-0.2.2-py3-none-any.whl:

Publisher: release.yml on ernestkoe/obsidian-notes-rag

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