Obsidian MCP Second Brain Server

Obsidian MCP Second Brain Server

Enables read-only access to Obsidian vaults with semantic search, tag filtering, and metadata queries. Provides secure, intelligent note retrieval and summarization for LLMs without modifying your vault.

Category
访问服务器

README

Obsidian MCP Second Brain Server

A read-only MCP server for intelligent, secure access to your Obsidian vault—enabling semantic search, metadata filtering, and more for LLMs.

Features

  • Efficient Database Storage: SQLite-based indexing for large vaults with persistent caching
  • Memory Mode Option: Optional in-memory indexing for small vaults or development
  • Semantic Search: Full-text search across all notes with fuzzy matching
  • Tag-Based Filtering: Search by hierarchical tags (e.g., work/puppet, tech/golang)
  • Path-Based Filtering: Filter by directory patterns (e.g., Work/Puppet/**)
  • Temporal Queries: Filter notes by creation/modification dates
  • Metadata Filtering: Filter by type, status, and category
  • Note Retrieval: Get full content of specific notes
  • Smart Summarization: Generate summaries of note collections
  • Recent Notes: Quick access to recently modified notes
  • Archive Control: Optionally include archived notes in searches
  • Security: Path traversal protection, file size limits, input validation

Read-Only Design

This MCP server is intentionally read-only to ensure your vault remains safe during AI interactions. It provides:

  • ✅ Search and retrieve notes
  • ✅ Filter by metadata and paths
  • ✅ Generate summaries and statistics
  • ❌ No note creation or editing
  • ❌ No file modifications

For write operations, consider using dedicated Obsidian plugins with built-in safety checks.

Installation

Configuration & Installation

One-Click Installation

  • VS Code: Install in VS Code
  • VS Code Insiders: Install in VS Code Insiders
  • Cursor: Install in Cursor

Manual Installation

No installation needed! Use directly with npx:

npx -y @comfucios/obsidian-mcp-sb --vault-path "/path/to/your/vault"

Local Development

cd obsidian-mcp-sb
npm install
npm run build
npm link

This makes the server available globally as obsidian-mcp-sb.

Claude Code & Claude Desktop

Claude Code

Add the server using:

claude mcp add obsidian-sb -- npx -y @comfucios/obsidian-mcp-sb --vault-path "/path/to/your/vault"

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "obsidian-sb": {
      "command": "npx",
      "args": [
        "-y",
        "@comfucios/obsidian-mcp-sb",
        "--vault-path",
        "/path/to/your/vault"
      ]
    }
  }
}

See docs/configuration.md for vault structure, CLI arguments, and configuration examples.

See docs/api.md for the full MCP API reference and usage examples.

Usage with Claude Code

Add to your MCP configuration file.

Single Vault Configuration

macOS/Linux: Edit ~/Library/Application Support/Claude/claude_desktop_config.json Windows: Edit %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "obsidian-sb": {
      "command": "npx",
      "args": [
        "-y",
        "@comfucios/obsidian-mcp-sb",
        "--vault-path",
        "/Users/ioanniskarasavvaidis/Documents/Obsidian Vault"
      ]
    }
  }
}

Multiple Vault Configuration

You can configure multiple vault instances:

{
  "mcpServers": {
    "obsidian-personal": {
      "command": "npx",
      "args": [
        "-y",
        "@comfucios/obsidian-mcp-sb",
        "--vault-path",
        "/Users/username/Documents/Personal Vault"
      ]
    },
    "obsidian-work": {
      "command": "npx",
      "args": [
        "-y",
        "@comfucios/obsidian-mcp-sb",
        "--vault-path",
        "/Users/username/Documents/Work Vault"
      ]
    }
  }
}

Local Development Setup

If you're developing locally with npm link:

{
  "mcpServers": {
    "obsidian-sb": {
      "command": "obsidian-mcp-sb",
      "args": ["--vault-path", "/path/to/your/vault"]
    }
  }
}

See docs/examples.md for more example queries.

Documentation

See docs/README.md for:

  • API Reference
  • Configuration & CLI Options
  • Example Queries
  • Development & Storage Architecture
  • Contributing
  • Dependencies
  • Architecture & Database Schema
  • Security & Search
  • Example Queries
  • Development
  • Contributing
  • Dependencies
  • License

Quick Start

Run the server instantly with npx (no install required):

npx -y @comfucios/obsidian-mcp-sb --vault-path "/path/to/your/vault"

Or add to Claude Code/Claude Desktop (see Configuration & Installation below).


Troubleshooting & FAQ

See docs/configuration.md for common issues and solutions.

See docs/search.md for details on search weights and scoring.

See docs/security.md for details on security features and protections.

See docs/development.md for development workflow and storage details.

See docs/contributing.md for contribution guidelines.

Storage Architecture

The server uses SQLite database storage by default for efficient indexing and persistent caching:

  • Database Mode (Default): Stores indexed notes in .obsidian-mcp/notes.db within your vault

    • Persistent indexing (survives server restarts)
    • Efficient for large vaults (1000+ notes)
    • Full-text search with SQLite FTS5
    • Lower memory usage
  • Memory Mode (Optional): Use --use-memory flag for in-memory storage

    • Faster for small vaults (<100 notes)
    • No disk I/O overhead
    • Useful for development and testing
    • Uses Fuse.js for fuzzy search

See docs/architecture.md for the architecture diagram. See docs/database-schema.md for the database schema.

Architecture

  • src/index.ts: MCP server implementation with tool handlers
  • src/vault.ts: Vault indexing orchestration and security controls
  • src/storage.ts: Storage interface abstraction
  • src/database-storage.ts: SQLite-based storage implementation
  • src/memory-storage.ts: In-memory storage implementation with Fuse.js
  • src/storage-factory.ts: Storage factory pattern for mode selection
  • src/config.ts: Configuration management with defaults
  • src/types.ts: TypeScript type definitions and validation utilities
  • src/__tests__/: Unit tests for critical functionality

See docs/dependencies.md for a full list of production and development dependencies.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选