Logo Obsidian MCP Server

Obsidian MCP Server

Cộng đồng
BoweyLou

This is an enhanced version of the excellent cyanheads/obsidian-mcp-server with additional features specifically tailored for remote Claude.ai integration, advanced task querying, and security via Tailscale.

Nhà phát hànhBoweyLou
Kho mãobsidian-mcp-server-enhanced
Ngôn ngữTypeScript
Bản fork
10
Sao
36
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépApache-2.0
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Obsidian MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    36 sao và 10 bản fork từ kho mã được liên kết.

Obsidian MCP Server - Enhanced

TypeScript Model Context Protocol Version License Status Original

Enhanced Obsidian MCP Server with Claude.ai Remote Integration, Tailscale Support, and Advanced Query Capabilities!

🔥 Enhanced Fork Notice: This is an enhanced version of the excellent cyanheads/obsidian-mcp-server with additional features specifically tailored for remote Claude.ai integration, advanced task querying, and security via Tailscale.

An MCP (Model Context Protocol) server providing comprehensive access to your Obsidian vault. Enables LLMs and AI agents to read, write, search, and manage your notes and files through the Obsidian Local REST API plugin.

Built on the cyanheads/mcp-ts-template, this server follows a modular architecture with robust error handling, logging, and security features.

🚀 Enhanced Features (This Fork)

🏛️ Multi-Vault Support

Simultaneous access to multiple Obsidian vaults through a single MCP server:

  • Multiple Vault Management: Connect to multiple Obsidian instances on different ports simultaneously
  • Vault-Specific Routing: Tools automatically route to the correct vault based on vault parameter
  • Individual Authentication: Separate API keys for each vault with centralized MCP authentication
  • Backwards Compatible: Existing single-vault configurations continue to work unchanged
  • Dynamic Configuration: JSON-based vault configuration with validation and error handling

🌐 Claude.ai Remote Integration

Perfect integration with Claude.ai's Remote MCP feature:

  • Stateless HTTP Mode: Dedicated stateless transport for Claude.ai compatibility (MCP_HTTP_STATELESS=true)
  • Session-Based Mode: Traditional session management for other MCP clients
  • Simplified Authentication: Uses dedicated MCP_AUTH_KEY for server access
  • Zero Configuration: Works out-of-the-box with Claude.ai Remote MCP servers
  • Production Ready: Enterprise-grade stability and error handling

🔒 Tailscale Secure Remote Access

Access your Obsidian vault securely from anywhere:

  • Tailscale Funnel Integration: Secure HTTPS endpoints with automatic certificates
  • End-to-End Encryption: All traffic encrypted through Tailscale network
  • No Port Forwarding: Zero network configuration required
  • Access Control: Built-in Tailscale ACL support for enterprise security

📊 Enhanced Task & Query System

Advanced querying capabilities beyond the original:

  • Tasks Plugin Integration: Deep integration with Obsidian Tasks plugin
  • Advanced Date Parsing: Natural language date recognition
  • Priority Detection: Visual and text-based priority parsing
  • Multiple Output Formats: Table, list, and summary views

🔧 Production Monitoring & Reliability

Enterprise-grade monitoring and auto-restart capabilities:

  • Health Check Script: Comprehensive component validation (scripts/health-check.sh)
  • Intelligent Monitoring: Auto-restart with process lifecycle management (scripts/monitor-mcp.sh)
  • macOS Auto-Start: Launch agent configuration for system startup (scripts/setup-autostart.sh)
  • Dynamic Port Management: Automatic port conflict resolution (3010-3013 range)
  • Enhanced Logging: Detailed connection debugging and API key validation

🚀 Core Capabilities: Obsidian Tools 🛠️

This server equips your AI with specialized tools to interact with your Obsidian vault:

Tool NameDescriptionKey Features
obsidian_read_fileRetrieves the content and metadata of a specified file.- Read in markdown or json format.- Case-insensitive path fallback.- Includes file stats (creation/modification time).
obsidian_update_fileModifies notes using whole-file operations.- append, prepend, or overwrite content.- Can create files if they don't exist.- Targets files by path, active note, or periodic note.
obsidian_search_replacePerforms search-and-replace operations within a target note.- Supports string or regex search.- Options for case sensitivity, whole word, and replacing all occurrences.
obsidian_global_searchPerforms a search across the entire vault.- Text or regex search.- Filter by path and modification date.- Paginated results.
obsidian_list_filesLists files and subdirectories within a specified vault folder.- Filter by file extension or name regex.- Provides a formatted tree view of the directory.
obsidian_manage_frontmatterAtomically manages a note's YAML frontmatter.- get, set, or delete frontmatter keys.- Avoids rewriting the entire file for metadata changes.
obsidian_manage_tagsAdds, removes, or lists tags for a note.- Manages tags in both YAML frontmatter and inline content.
obsidian_delete_filePermanently deletes a specified file from the vault.- Case-insensitive path fallback for safety.
obsidian_dataview_queryExecute Dataview DQL queries against your vault.- Run TABLE, LIST queries using Dataview syntax.- Query notes by tags, frontmatter, dates.- Generate reports and analytics.
obsidian_task_querySearch and analyze tasks across your vault.- Filter by status, date ranges, priorities.- Multiple output formats.- Extract task metadata (due dates, tags).

Table of Contents

| Overview | Features | Installation | | Configuration | Project Structure | Vault Cache Service | | Tools | Resources | Development | License |

Overview

The Obsidian MCP Server acts as a bridge, allowing applications (MCP Clients) that understand the Model Context Protocol (MCP) – like advanced AI assistants (LLMs), IDE extensions, or custom scripts – to interact directly and safely with your Obsidian vault.

Instead of complex scripting or manual interaction, your tools can leverage this server to:

  • Automate vault management: Read notes, update content, manage frontmatter and tags, search across files, list directories, and delete files programmatically.
  • Integrate Obsidian into AI workflows: Enable LLMs to access and modify your knowledge base as part of their research, writing, or coding tasks.
  • Build custom Obsidian tools: Create external applications that interact with your vault data in novel ways.

Built on the robust mcp-ts-template, this server provides a standardized, secure, and efficient way to expose Obsidian functionality via the MCP standard. It achieves this by communicating with the powerful Obsidian Local REST API plugin running inside your vault.

Developer Note: This repository includes a .clinerules file that serves as a developer cheat sheet for your LLM coding agent with quick reference for the codebase patterns, file locations, and code snippets.

Features

Core Utilities

Leverages the robust utilities provided by the mcp-ts-template:

  • Logging: Structured, configurable logging (file rotation, console, MCP notifications) with sensitive data redaction.
  • Error Handling: Centralized error processing, standardized error types (McpError), and automatic logging.
  • Configuration: Environment variable loading (dotenv) with comprehensive validation.
  • Input Validation/Sanitization: Uses zod for schema validation and custom sanitization logic.
  • Request Context: Tracking and correlation of operations via unique request IDs.
  • Type Safety: Strong typing enforced by TypeScript and Zod schemas.
  • HTTP Transport Option: Native Node.js HTTP server with session management, CORS support, and API key authentication.

Obsidian Integration

  • Obsidian Local REST API Integration: Communicates directly with the Obsidian Local REST API plugin via HTTP requests managed by the ObsidianRestApiService.
  • Comprehensive Command Coverage: Exposes key vault operations as MCP tools (see Tools section).
  • Vault Interaction: Supports reading, updating (append, prepend, overwrite), searching (global text/regex, search/replace), listing, deleting, and managing frontmatter and tags.
  • Targeting Flexibility: Tools can target files by path, the currently active file in Obsidian, or periodic notes (daily, weekly, etc.).
  • Vault Cache Service: An intelligent in-memory cache that improves performance and resilience. It caches vault content, provides a fallback for the global search tool if the live API fails, and periodically refreshes to stay in sync.
  • Safety Features: Case-insensitive path fallbacks for file operations, clear distinction between modification types (append, overwrite, etc.).

Installation

Prerequisites

  1. Obsidian: You need Obsidian installed.
  2. Obsidian Local REST API Plugin: Install and enable the Obsidian Local REST API plugin within your Obsidian vault.
  3. API Key: Configure an API key within the Local REST API plugin settings in Obsidian. You will need this key to configure the server.
  4. Node.js & npm: Ensure you have Node.js (v18 or later recommended) and npm installed.
  5. Tailscale (for remote access): Install Tailscale and enable Tailscale Funnel for secure remote Claude.ai integration.

💡 Quick Setup: For automatic startup on boot, see the Auto-Start Setup Guide after installation.

Installation

  1. Clone this enhanced repository:
    bash
    git clone https://github.com/BoweyLou/obsidian-mcp-server-enhanced.git
    cd obsidian-mcp-server-enhanced
  2. Install dependencies:
    bash
    npm install
  3. Build the project:
    bash
    npm run build
    This compiles the TypeScript code to JavaScript in the dist/ directory and makes the entry point executable.

Configuration

Environment Variables

Configure the server using environment variables.

These variables must be set in the MCP client configuration (e.g., cline_mcp_settings.json) or in your environment before starting the server (if running directly).

If running directly, they can be set in a .env file in the project root or directly in your environment.

VariableDescriptionRequiredDefault
MCP_AUTH_KEYAuthentication key for Claude.ai Remote MCP access. Generate with openssl rand -hex 32Yes (Remote)undefined
OBSIDIAN_VAULTSJSON array of vault configurations for multi-vault mode.Yes (Multi)undefined
OBSIDIAN_API_KEYAPI Key from Obsidian plugin (single-vault mode only).Yes (Single)undefined
OBSIDIAN_BASE_URLBase URL of Obsidian API (single-vault mode only).Yes (Single)http://127.0.0.1:27123
MCP_TRANSPORT_TYPEServer transport: stdio or http.Nohttp
MCP_HTTP_PORTPort for the HTTP server.No3010
MCP_HTTP_HOSTHost for the HTTP server.No127.0.0.1
MCP_HTTP_STATELESSEnable stateless mode for Claude.ai compatibility.Nofalse
MCP_ALLOWED_ORIGINSComma-separated origins for CORS. Set for production.No(none)
CHATGPT_LAYER_ENABLEDSet to true to serve the ChatGPT manifest plus JSON action endpoint.Nofalse
CHATGPT_MANIFEST_PATHHTTP path that exposes the ChatGPT manifest JSON.No/.well-known/obsidian-chatgpt-manifest.json
CHATGPT_ACTIONS_PATHHTTP path for ChatGPT JSON actions (POST).No/chatgpt/actions
CHATGPT_FACADE_TOKEN_TTL_SECONDSChatGPT facade access-token lifetime.No3600
CHATGPT_FACADE_REFRESH_TOKEN_TTL_SECONDSChatGPT facade refresh-token lifetime.No2592000
CHATGPT_FACADE_SCOPESComma-separated ChatGPT facade scopes. Add write scopes only for explicitly trusted clients.Noobsidian:read
MCP_LOG_LEVELLogging level (debug, info, error, etc.).Noinfo
OBSIDIAN_VERIFY_SSLSet to false to disable SSL verification.Notrue
OBSIDIAN_ENABLE_CACHESet to true to enable the in-memory vault cache.Notrue
OBSIDIAN_CACHE_REFRESH_INTERVAL_MINRefresh interval for the vault cache in minutes.No10

Multi-Vault Configuration

The server supports both single-vault (backwards compatible) and multi-vault modes:

Single-Vault Mode (Legacy)

bash
# .env file
MCP_AUTH_KEY=your-generated-mcp-auth-key
OBSIDIAN_API_KEY=your-obsidian-plugin-api-key
OBSIDIAN_BASE_URL=http://127.0.0.1:27123
MCP_TRANSPORT_TYPE=http
MCP_HTTP_STATELESS=true

Multi-Vault Mode (Recommended)

bash
# .env file
MCP_AUTH_KEY=your-generated-mcp-auth-key
OBSIDIAN_VAULTS='[
  {
    "id": "work",
    "name": "Work Vault", 
    "apiKey": "work-vault-api-key",
    "baseUrl": "http://127.0.0.1:27123",
    "verifySsl": false
  },
  {
    "id": "personal",
    "name": "Personal Vault",
    "apiKey": "personal-vault-api-key", 
    "baseUrl": "http://127.0.0.1:27122",
    "verifySsl": false
  }
]'
MCP_TRANSPORT_TYPE=http
MCP_HTTP_STATELESS=true

Setup Process

  1. Generate MCP Auth Key: openssl rand -hex 32
  2. Configure Multiple Obsidian Instances: Install Local REST API plugin on different ports
  3. Get API Keys: Extract API keys from each Obsidian instance's plugin settings
  4. Configure Vaults: Update .env with OBSIDIAN_VAULTS JSON configuration
  5. Start Server: npm run start:http
  6. Access via Claude.ai: Use your Tailscale URL with MCP_AUTH_KEY

Connecting to the Obsidian API

Single-Vault Mode

To connect in single-vault mode, configure the base URL (OBSIDIAN_BASE_URL) and API key (OBSIDIAN_API_KEY). The Obsidian Local REST API plugin offers two connection types:

  1. Encrypted (HTTPS):

    • Uses secure https:// endpoint (e.g., https://127.0.0.1:27124)
    • Requires OBSIDIAN_VERIFY_SSL=false for self-signed certificates
  2. Non-encrypted (HTTP) - Recommended:

    • Uses http:// endpoint (e.g., http://127.0.0.1:27123)
    • Simpler setup, no SSL verification needed

Multi-Vault Mode

For multi-vault mode, configure each vault individually in the OBSIDIAN_VAULTS JSON array with its own API key and base URL. Each vault can use either HTTP or HTTPS as needed.

Example configurations:

Single-vault with HTTP:

json
"env": {
  "MCP_AUTH_KEY": "your-generated-mcp-auth-key",
  "OBSIDIAN_API_KEY": "your-obsidian-api-key",
  "OBSIDIAN_BASE_URL": "http://127.0.0.1:27123"
}

Multi-vault configuration:

json
"env": {
  "MCP_AUTH_KEY": "your-generated-mcp-auth-key",
  "OBSIDIAN_VAULTS": "[{\"id\":\"work\",\"name\":\"Work\",\"apiKey\":\"work-key\",\"baseUrl\":\"http://127.0.0.1:27123\"},{\"id\":\"personal\",\"name\":\"Personal\",\"apiKey\":\"personal-key\",\"baseUrl\":\"http://127.0.0.1:27122\"}]"
}

Local MCP Client Settings (Optional)

Note: For Claude.ai Remote MCP integration, skip this section and use the Tailscale Remote Access Setup instead.

For local MCP clients (e.g., Cline), add to your settings (e.g., cline_mcp_settings.json):

Single-vault configuration:

json
{
  "mcpServers": {
    "obsidian-mcp-server": {
      "command": "node",
      "args": ["/path/to/your/obsidian-mcp-server-enhanced/dist/index.js"],
      "env": {
        "MCP_AUTH_KEY": "your-generated-mcp-auth-key",
        "OBSIDIAN_API_KEY": "your-obsidian-api-key",
        "OBSIDIAN_BASE_URL": "http://127.0.0.1:27123",
        "OBSIDIAN_ENABLE_CACHE": "true"
      }
    }
  }
}

Multi-vault configuration:

json
{
  "mcpServers": {
    "obsidian-mcp-server": {
      "command": "node",
      "args": ["/path/to/your/obsidian-mcp-server-enhanced/dist/index.js"],
      "env": {
        "MCP_AUTH_KEY": "your-generated-mcp-auth-key",
        "OBSIDIAN_VAULTS": "[{\"id\":\"work\",\"name\":\"Work Vault\",\"apiKey\":\"work-api-key\",\"baseUrl\":\"http://127.0.0.1:27123\"},{\"id\":\"personal\",\"name\":\"Personal Vault\",\"apiKey\":\"personal-api-key\",\"baseUrl\":\"http://127.0.0.1:27122\"}]",
        "OBSIDIAN_ENABLE_CACHE": "true"
      }
    }
  }
}

🌐 Remote Access Setup (Tailscale)

For remote access to your Obsidian vault from anywhere, you can use Tailscale to securely expose your MCP server over the internet.

Prerequisites

  1. Tailscale Account: Sign up at tailscale.com
  2. Tailscale Installed: Install Tailscale on your machine running the MCP server
  3. Tailscale Funnel Enabled: Enable Tailscale Funnel for your account

Setup Steps

  1. Generate MCP Auth Key:

    bash
    openssl rand -hex 32
  2. Configure Environment: Set up your .env file with the generated key:

    bash
    MCP_AUTH_KEY=your-generated-auth-key
    MCP_TRANSPORT_TYPE=http
    MCP_HTTP_PORT=3010
    MCP_HTTP_STATELESS=true
  3. Configure Vaults: Set up single or multi-vault configuration (see Multi-Vault Configuration)

  4. Start the MCP Server:

    bash
    npm run build && npm run start:http
  5. Enable Tailscale Funnel:

    bash
    tailscale funnel 3010
  6. Get Your Public URL: Check your Tailscale device URL:

    bash
    tailscale status --self | grep "Funnel on"

Claude.ai Remote MCP Configuration

Add to your Claude.ai Remote MCP servers using your MCP authentication key:

Single-vault setup:

json
{
  "url": "https://your-device.your-tailnet.ts.net/mcp?api_key=your-mcp-auth-key",
  "name": "Obsidian Vault"
}

Multi-vault setup:

json
{
  "url": "https://your-device.your-tailnet.ts.net/mcp?api_key=your-mcp-auth-key",
  "name": "Obsidian Multi-Vault"
}

Authentication Note: Claude.ai Remote MCP uses the MCP_AUTH_KEY for server authentication. Individual vault operations use the vault-specific API keys configured in your environment.

Security Considerations

  • Dual Authentication: MCP server authentication via MCP_AUTH_KEY, vault authentication via individual API keys
  • Tailscale Encryption: All traffic is encrypted end-to-end by Tailscale
  • Private Network: Only you can access the server through your Tailscale network
  • Automatic SSL: Tailscale Funnel provides automatic HTTPS certificates
  • Vault Isolation: Each vault uses its own API key for secure access control

Example Usage

Once set up, you can use tools remotely from Claude.ai:

Single-vault commands (uses default vault):

Use obsidian_task_query to show me tasks due today with format="table"

Multi-vault commands (specify vault):

Use obsidian_task_query with vault="work" to show me work tasks due today
Use obsidian_read_file with filePath="daily-note.md" and vault="personal" 
Use obsidian_dataview_query with vault="work" to run: TABLE file.name FROM #meeting WHERE file.cday = date(today)

🚀 Pro Tip: For production use, set up automatic startup on boot so your server and Tailscale Funnel start automatically without manual intervention.

ChatGPT Connector Facade

Claude and local MCP clients can connect directly to /mcp. Hosted ChatGPT connectors should use the separate obsidian-chatgpt facade instead. The facade reuses the existing vault, search, and task logic internally, but it has its own process, port, OAuth/PKCE authorization flow, scoped capabilities, and write audit log.

Use the facade for public HTTPS or Tailscale Funnel routes. Keep the full MCP server on localhost or private tailnet-only routes unless you are doing an explicit local/dev test.

Starting the Facade

Configure a public resource URL and admin approval secret, then start the facade:

bash
export CHATGPT_FACADE_PUBLIC_URL="https://your-device.your-tailnet.ts.net"
export CHATGPT_FACADE_ADMIN_SECRET="$(openssl rand -hex 24)"
npm run build
npm run start:chatgpt

If the same Funnel hostname also exposes another ChatGPT connector, give this facade a path-scoped resource URL such as https://your-device.your-tailnet.ts.net/obsidian and route the /obsidian prefix to the facade port. The facade serves both root and path-qualified well-known metadata paths for that setup. In that shared-host setup, create the connector with https://your-device.your-tailnet.ts.net/obsidian/mcp.

Check health:

bash
curl "http://127.0.0.1:3020/health"

For facade HTTP-surface tests without a live Obsidian API, set CHATGPT_FACADE_SKIP_OBSIDIAN_CHECK=true. Leave it unset for normal operation.

Expose only the facade through Funnel:

bash
make tailscale-funnel-chatgpt

OAuth and Scopes

The facade publishes OAuth discovery metadata:

  • /.well-known/oauth-protected-resource
  • /.well-known/oauth-authorization-server
  • /.well-known/openid-configuration

It stores authorization-code, access-token, and refresh-token hashes locally under CHATGPT_FACADE_STORE_PATH, not raw tokens. It requires PKCE S256 for initial token exchange, supports refresh-token rotation, and validates bearer tokens by resource, expiry, and scope before executing actions.

Scopes:

  • obsidian:read: search, fetch, task_query, latest_note
  • obsidian:write: create_task, update_task, append_note, create_note, create_daily_note
  • obsidian:dangerous-write: overwrite_note

Read-only connector setup is the default and is supported by granting only obsidian:read. overwrite_note is not available unless obsidian:dangerous-write is explicitly granted.

Facade Actions

All actions use POST /chatgpt/actions with Authorization: Bearer <token>. They accept an optional vault field. The default public surface is intentionally smaller than the full local MCP tool set.

ActionScopeDescription
searchobsidian:readBounded global search with snippets.
fetchobsidian:readFetch bounded note content by vault path.
task_queryobsidian:readTasks-plugin-aware task query.
latest_noteobsidian:readFetch the latest modified note, optionally scoped by path.
create_taskobsidian:writeCreate a Tasks-plugin-compatible task.
update_taskobsidian:writeUpdate an existing task.
append_noteobsidian:writeAppend or prepend note content.
create_noteobsidian:writeCreate a note without overwriting existing content.
create_daily_noteobsidian:writeCreate today's or a specified daily note from the daily-note template.
overwrite_noteobsidian:dangerous-writeWhole-note overwrite for explicitly trusted clients.

Successful action responses use the same envelope for HTTP actions and facade MCP tool calls:

json
{
  "success": true,
  "action": "create_daily_note",
  "vault": "default",
  "resultPath": "Daily/2026-07-03.md",
  "data": {
    "filePath": "Daily/2026-07-03.md"
  }
}

Write actions include resultPath when the affected vault path is known. Task-creation and task-update actions also include taskLineNumber when the line number is available.

Writes are appended to the local JSONL audit log at CHATGPT_FACADE_AUDIT_PATH. The audit entry records action, client id, scopes, target path, mode, result path, status, and a capped input summary; it does not store raw ChatGPT transcripts or full note bodies. Operators can inspect recent entries with:

bash
curl "http://127.0.0.1:3020/audit/recent?admin_secret=$CHATGPT_FACADE_ADMIN_SECRET"

Legacy In-Process Layer

CHATGPT_LAYER_ENABLED=true still enables the older in-process manifest/actions layer on the main HTTP transport for local/dev compatibility. That layer uses MCP_AUTH_KEY query-string auth and exposes broader actions including page overwrite. Do not use it as the recommended hosted ChatGPT connector path.

Project Structure

The codebase follows a modular structure within the src/ directory:

src/
├── index.ts           # Entry point: Initializes and starts the server
├── config/            # Configuration loading (env vars, package info)
│   └── index.ts
├── mcp-server/        # Core MCP server logic and capability registration
│   ├── server.ts      # Server setup, transport handling, tool/resource registration
│   ├── resources/     # MCP Resource implementations (currently none)
│   ├── tools/         # MCP Tool implementations (subdirs per tool)
│   └── transports/    # Stdio and HTTP transport logic, auth middleware
├── services/          # Abstractions for external APIs or internal caching
│   ├── obsidianRestAPI/ # Typed client for Obsidian Local REST API
│   └── vaultManager/    # Multi-vault configuration and service management
├── types-global/      # Shared TypeScript type definitions (errors, etc.)
└── utils/             # Common utility functions (logger, error handler, security, etc.)

For a detailed file tree, run npm run tree or see docs/tree.md.

Vault Cache Service

This server includes an intelligent in-memory cache designed to enhance performance and resilience when interacting with your vault.

Purpose and Benefits

  • Performance: By caching file content and metadata, the server can perform search operations much faster, especially in large vaults. This reduces the number of direct requests to the Obsidian Local REST API, resulting in a snappier experience.
  • Resilience: The cache acts as a fallback for the obsidian_global_search tool. If the live API search fails or times out, the server seamlessly uses the cache to provide results, ensuring that search functionality remains available even if the Obsidian API is temporarily unresponsive.
  • Efficiency: The cache is designed to be efficient. It performs an initial build on startup and then periodically refreshes in the background by checking for file modifications, ensuring it stays reasonably up-to-date without constant, heavy API polling.

How It Works

  1. Initialization: When enabled, the VaultCacheService builds an in-memory map of all .md files in your vault, storing their content and modification times.
  2. Periodic Refresh: The cache automatically refreshes at a configurable interval (defaulting to 10 minutes). During a refresh, it only fetches content for files that are new or have been modified since the last check.
  3. Proactive Updates: After a file is modified through a tool like obsidian_update_file, the service proactively updates the cache for that specific file, ensuring immediate consistency.
  4. Search Fallback: The obsidian_global_search tool first attempts a live API search. If this fails, it automatically falls back to searching the in-memory cache.

Configuration

The cache is enabled by default but can be configured via environment variables:

  • OBSIDIAN_ENABLE_CACHE: Set to true (default) or false to enable or disable the cache service.
  • OBSIDIAN_CACHE_REFRESH_INTERVAL_MIN: Defines the interval in minutes for the periodic background refresh. Defaults to 10.

Tools

The Obsidian MCP Server provides a suite of tools for interacting with your vault(s), callable via the Model Context Protocol.

Multi-Vault Support

All tools support an optional vault parameter to specify which vault to operate on:

  • Default Behavior: Without vault parameter, tools use the first configured vault
  • Specific Vault: Add vault: "vault-id" to target a specific vault
  • Example: obsidian_read_file(filePath="note.md", vault="work")
Tool NameDescriptionKey Arguments
obsidian_read_fileRetrieves the content and metadata of a file.filePath, vault?, format?, includeStat?
obsidian_update_fileModifies a file by appending, prepending, or overwriting.targetType, content, vault?, targetIdentifier?, wholeFileMode
obsidian_search_replacePerforms search-and-replace operations in a note.targetType, replacements, vault?, useRegex?, replaceAll?
obsidian_global_searchSearches the entire vault for content.query, vault?, searchInPath?, useRegex?, page?, pageSize?
obsidian_list_filesLists files and subdirectories in a folder.dirPath, vault?, fileExtensionFilter?, nameRegexFilter?
obsidian_manage_frontmatterGets, sets, or deletes keys in a note's frontmatter.filePath, operation, key, vault?, value?
obsidian_manage_tagsAdds, removes, or lists tags in a note.filePath, operation, tags, vault?
obsidian_delete_filePermanently deletes a file from the vault.filePath, vault?
obsidian_dataview_queryExecute Dataview DQL queries against your vault.query, vault?, format?
obsidian_task_querySearch and analyze tasks across your vault.vault?, status?, dateRange?, folder?, priority?, format?
obsidian_periodic_notesCreate and manage daily, weekly, monthly, yearly notes.operation, periodType, vault?, date?, content?, append?
obsidian_block_referenceWork with block references and heading operations.operation, filePath, vault?, heading?, content?, blockId?
obsidian_graph_analysisAnalyze note connections and vault relationships.operation, vault?, filePath?, minConnections?, maxDepth?
obsidian_template_systemCreate files from templates with variable substitution.operation, vault?, templatePath?, targetPath?, variables?
obsidian_smart_linkingGet intelligent link suggestions and recommendations.operation, vault?, filePath?, content?, maxSuggestions?

Note: All tools support comprehensive error handling, multi-vault routing, and return structured JSON responses.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Attribution

This enhanced version is based on the excellent work by cyanheads in the original obsidian-mcp-server project. All core functionality and architecture credit goes to the original author.

Enhancements in this fork:

  • Multi-Vault Support: Simultaneous access to multiple Obsidian vaults with vault-specific routing
  • Claude.ai Remote MCP integration and compatibility fixes
  • Tailscale Funnel integration for secure remote access
  • Enhanced HTTP transport layer with authentication separation (MCP_AUTH_KEY)
  • Advanced task querying with Tasks plugin integration
  • 5 New Advanced Tools: Periodic notes, block references, graph analysis, template system, and smart linking
  • Production-ready configuration for enterprise use

Cài đặt

TypingMind
{
  "mcpServers": {
    "obsidian-mcp-server-enhanced": {
      "command": "node",
      "args": [
        "dist/index.js"
      ]
    }
  }
}

Dùng MCP Obsidian MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Obsidian MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Obsidian MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Obsidian MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "obsidian-mcp-server-enhanced": {
      "command": "npx",
      "args": [
        "-y",
        "obsidian-mcp-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Obsidian MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Obsidian MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Obsidian MCP Server giúp tôi làm việc này không?
Obsidian MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Obsidian MCP Server.

Câu hỏi thường gặp

Máy chủ MCP Obsidian MCP Server dùng để làm gì?

Obsidian MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Obsidian MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Obsidian MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Obsidian MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Obsidian MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Obsidian MCP Server với TypingMind?

Obsidian MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Obsidian MCP Server cung cấp những công cụ nào trong TypingMind?

Obsidian MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Obsidian MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Obsidian MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇