Semlink

approved

by Ouzhongyuan

Semantic search for Obsidian Vault via MCP - This plugin has not been manually reviewed by Obsidian staff.

1 stars119 downloadsUpdated 22d agoMIT

Semlink

中文

An Obsidian plugin that vectorizes your Vault notes and exposes semantic search via MCP (Model Context Protocol).

Let Claude Desktop, Claude Code, Cursor and other AI tools directly search and read your Obsidian notes.

Features

  • Semantic Search: Query your Vault notes in natural language, return the most relevant results based on vector similarity
  • Real-time Indexing: Automatically detect file changes and update the vector index
  • MCP Server: Expose search capabilities via HTTP protocol for AI clients

MCP Tools

ToolDescription
search_notesSemantic search notes using natural language queries, returns the most relevant note chunks
get_noteGet the full content of a note
get_similar_notesFind notes semantically similar to a specified note
get_sectionGet the content under a specific heading in a note
list_indexedList all indexed notes
index_statusGet current indexing status and progress
reindexTrigger re-indexing (single file or full)

How It Works

Obsidian Vault Notes
        │
        ▼
   Text Chunking
        │
        ▼
  SiliconFlow API (BGE-M3)  ──→  Vector Embedding
        │
        ▼
  Local Storage (SQLite + Binary)
        │
        ▼
  MCP HTTP Server (:3001)
        │
        ▼
  Claude / Cursor / Other AI Clients

Installation

Option 1: Build from Source (Developers)

# Clone the repo
git clone https://github.com/ouou365/Semlink.git
cd semlink

# Install dependencies
npm install

# Build
npm run build

# Copy the entire directory to your Obsidian Vault plugins folder
# e.g. MyVault/.obsidian/plugins/semlink/

Option 2: Direct Download

Download main.js, manifest.json, styles.css, sql-wasm.wasm from the Release page and place them in:

YourVault/.obsidian/plugins/semlink/

Enable the Plugin

  1. Open Obsidian → Settings → Community plugins
  2. Find Semlink and enable it

Configuration

After enabling the plugin, go to Settings → Semlink:

SettingDescriptionDefault
SiliconFlow API KeyAPI key from siliconflow.cn(Required)
Embedding ModelModel used for vectorizationBAAI/bge-m3
MCP PortHTTP server listening port3001
MCP Access KeyAuthentication key for MCP clients (leave empty to disable)Empty
Chunk SizeMaximum characters per text chunk800
Chunk OverlapOverlap characters between adjacent chunks100
Batch SizeNumber of texts per API call64
Request DelayDelay between API requests (ms)200
Exclude PathsPaths excluded from indexing (one per line)templates/ etc.
Auto IndexAutomatically update on file changesOn

Getting an API Key

  1. Register at siliconflow.cn
  2. Create an API Key in the console
  3. Enter the key in plugin settings

Connect AI Clients

After configuration, client configs are auto-generated at the bottom of the plugin settings page.

Claude Desktop / Cursor

Add the following JSON to your MCP configuration file:

{
  "mcpServers": {
    "semlink": {
      "type": "http",
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}

With MCP access key:

{
  "mcpServers": {
    "semlink": {
      "type": "http",
      "url": "http://127.0.0.1:3001/mcp",
      "headers": {
        "Authorization": "Bearer your-key"
      }
    }
  }
}

Claude Code

Run in terminal:

# Without key
claude mcp add --transport http semlink http://127.0.0.1:3001/mcp

# With key
claude mcp add --transport http semlink http://127.0.0.1:3001/mcp --header "Authorization: Bearer your-key"

Usage

First Indexing

  1. Configure your API Key
  2. Open command palette (Ctrl/Cmd + P), search for "Semlink: Start Index"
  3. Click Semlink in the status bar to view indexing progress

Daily Use

  • The plugin automatically watches for file changes and incrementally updates the index
  • Ask questions in your AI client to search your notes

Commands

CommandDescription
Semlink: Full ReindexRe-scan all files
Semlink: Start IndexStart indexing
Semlink: Pause IndexPause current indexing
Semlink: Start/Stop MCP ServiceToggle MCP server
Semlink: View Index ProgressOpen progress panel

Data Storage

All data is stored locally only:

FileDescription
data/vault.dbSQLite database for chunk metadata
data/vectors.binVector index binary file

These files are located in the plugin directory and are never uploaded to any server.

Embedding Models

ModelFeatureMax Tokens
BAAI/bge-m3Recommended, multilingual8192
Pro/BAAI/bge-m3Enhanced version8192
BAAI/bge-large-zh-v1.5Chinese optimized512
BAAI/bge-large-en-v1.5English optimized512

Tech Stack

  • Embedding: SiliconFlow API (BGE-M3, 1024-dim)
  • Storage: sql.js (SQLite WASM) + binary vector file
  • Search: Brute-force cosine similarity
  • Protocol: MCP over HTTP (JSON-RPC 2.0)

Development

# Dev mode (watch and auto-rebuild)
npm run dev

# Production build
npm run build

Notes

  • Full indexing consumes SiliconFlow API credits; watch your usage for large Vaults
  • Vector search runs in local memory; 100K+ notes may use significant memory
  • MCP server listens on 127.0.0.1 by default, accessible only from localhost

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.