Logo Obsidian Advanced

Obsidian Advanced

Cộng đồng
ToKiDoO

Advanced MCP server for interacting with Obsidian via the Local REST API community plugin. It empowers AI agents (like Claude) to deeply understand your vault's structure, links, and content—beyond basic read/write operations.

Nhà phát hànhToKiDoO
Kho mãmcp-obsidian-advanced
Ngôn ngữPython
Bản fork
5
Sao
18
Công cụ có sẵn
16
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Obsidian Advanced 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.

  • 16 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ở

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

Advanced MCP Tools for Obsidian

Advanced MCP server for interacting with Obsidian via the Local REST API community plugin. It empowers AI agents (like Claude) to deeply understand your vault's structure, links, and content—beyond basic read/write operations.

Key advanced features, powered by the obsidiantools library:

  • Vault tree structure discovery to map your note hierarchy
  • NetworkX graph analysis of note connections for LLM-friendly insights
  • Execution of Obsidian commands directly from AI
  • Batch file reading with metadata and link details
  • Access to your currently active note for real-time context
  • Opening notes/files in new Obsidian leaves for seamless editing

This setup lets AI agents work alongside you, boosting productivity by efficiently navigating and enhancing your knowledge base.

Components

Tools

The server implements multiple tools to interact with Obsidian:

Core File Operations

  • obsidian_list_files_in_dir: Lists all files and directories in a specific Obsidian directory
  • obsidian_batch_get_files: Return the contents and metadata of one or more notes (.md files) in your vault
  • obsidian_put_file: Create a new file in your vault or update the content of an existing one
  • obsidian_append_to_file: Append content to a new or existing file in the vault
  • obsidian_patch_file: Insert content into an existing note relative to a heading, block reference, or frontmatter field
  • obsidian_delete_file: Delete a file or directory from your vault

Search Operations

  • obsidian_simple_search: Simple search for documents matching a specified text query across all files in the vault
  • obsidian_complex_search: Complex search for documents using a JsonLogic query with support for 'glob' and 'regexp' pattern matching

Note Management

  • obsidian_get_active_note: Get the content and metadata of the currently active note in Obsidian
  • obsidian_periodic_notes: Get current periodic note for the specified period (daily, weekly, monthly, quarterly, yearly)
  • obsidian_recent_periodic_notes: Get most recent periodic notes for the specified period type
  • obsidian_recent_changes: Get recently modified files in the vault
    • NOTE: This tool requires the Dataview community plugin to function. Make sure to install the Dataview plugin in your vault.

Vault Analysis

  • obsidian_understand_vault: Get a comprehensive understanding of the vault structure including directory tree and NetworkX graph of note connections
  • obsidian_open_files: Open one or more files in the vault in a new leaf
  • obsidian_list_commands: List all available commands you can run in obsidian interface
  • obsidian_execute_commands: Execute one or more commands in obsidian interface

Example prompts

Its good to first instruct Claude (or any other MCP client) to use Obsidian. Then it will always call the tool. For instance,

The use prompts like this:

  • "Expand on the Marketing section of the report I'm currently working on in obsidian"
    • Claude will use obsidian_get_active_note, read it, then edit the note.
  • "Search for all files where Azure CosmosDb is mentioned and quickly explain to me the context in which it is mentioned"
  • "Summarize the last meeting notes and put them into a new note 'summary meeting.md'. Add an introduction so that I can send it via email."

Configuration

Environment Variables

For this MCP server, there are 2 required environment variables that need to be configured:

  • OBSIDIAN_API_KEY: Obtain this by installing the Obsidian REST API plugin, and go into settings.
  • OBSIDIAN_VAULT_PATH: The absolute path to your vault must be set in order for tools (e.g. obsidian_understand_vault) to function properly.

Additionally, there are 3 optional environment variables that could be altered:

  • OBSIDIAN_HOST: Could be changed in the Obsidian REST API plugin settings. Defaults to 127.0.0.1 as per the plugin's default settings.
  • OBSIDIAN_PORT: Could be changed in the Obsidian REST API plugin settings. Defaults to 27124 as per the plugin's default settings.
  • INCLUDE_TOOLS: This variable controls which tools would be available for use.
    • Write the name of the tool(s) you want to include (name listed above), separated by commas.
    • For instance, if you only want the obsidian_understand_vault and obsidian_simple_search tool, you would set INCLUDE_TOOLS="obsidian_understand_vault,obsidian_simple_search" in the .env or in the server config.

There are two ways to configure the environment with the Obsidian REST API Key.

  1. Add to server config (PREFERRED):
json
{
  "mcp-obsidian-advanced": {
    "command": "uvx",
    "args": [
      "mcp-obsidian-advanced"
    ],
    "env": {
      "OBSIDIAN_API_KEY": "%3Cyour_api_key_here%3E",
      "OBSIDIAN_HOST": "<your_obsidian_host>",
      "OBSIDIAN_PORT": "<your_obsidian_port>",
      "OBSIDIAN_VAULT_PATH": "</path/to/your/vault>",
      "INCLUDE_TOOLS": ""
    }
  }
}

Sometimes Claude has issues detecting the location of uv / uvx. You can use which uvx to find and paste the full path in above config in such cases.

  1. Create a .env file in the working directory with the following variables (only OBSIDIAN_API_KEY and OBSIDIAN_VAULT_PATH are required):
OBSIDIAN_API_KEY=your_api_key_here
OBSIDIAN_HOST=your_obsidian_host
OBSIDIAN_PORT=your_obsidian_port
OBSIDIAN_VAULT_PATH=/path/to/your/vault
INCLUDE_TOOLS=name_of_tool1,name_of_tool2,...

Note: You can find the API key, Host and Port in the Obsidian plugin config Default port is 27124 if not specified Default host is 127.0.0.1 if not specified

Quickstart

Install

Installing via Smithery

To install Advanced Obsidian MCP Server for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @ToKiDoO/mcp-obsidian-advanced --client claude

Obsidian REST API

You need the Obsidian REST API community plugin running: https://github.com/coddingtonbear/obsidian-local-rest-api

  • You can install it by going to "Community Plugins" in Obsidian, search it up.

Install and enable it in the settings and copy the api key.

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

Published Servers Configuration:

json
{
  "mcpServers": {
    "mcp-obsidian-advanced": {
      "command": "uvx",
      "args": [
        "mcp-obsidian-advanced"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>",
        "OBSIDIAN_VAULT_PATH": "/path/to/your/vault/"
      }
    }
  }
}

Development/Unpublished Servers Configuration

json
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uv",
      "args": [
        "--directory",
        "/dir/to/mcp-obsidian-advanced",
        "run",
        "mcp-obsidian"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>",
        "OBSIDIAN_VAULT_PATH": "/path/to/your/vault/"
      }
    }
  }
}

Development

Additional Documentation for obsidiantools Library and Obsidian REST API

Additional documentation for the obsidiantools library and Obsidian REST API can be found in the docs directory.

  • obsidiantools_in_15_minutes_documentation.md is a ipynb file that demonstrates use cases for obsidiantools.
  • obsidian_rest_api_documentation.yaml is a yaml file that demonstrates use cases for the Obsidian REST API.

Building

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
bash
uv sync

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

bash
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-obsidian-advanced run mcp-obsidian-advanced

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

You can also watch the server logs with this command:

bash
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-obsidian-advanced.log

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "mcp-obsidian-advanced": {
      "command": "uvx",
      "args": [
        "mcp-obsidian-advanced"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>",
        "OBSIDIAN_VAULT_PATH": "/path/to/your/vault/"
      }
    }
  }
}

Công cụ có sẵn

  • obsidian_list_commands

    List all available commands you can run in obsidian interface. For commands used on specific notes, make sure to open a note first.

  • obsidian_open_files

    Open one or more files in the vault in a new leaf.

  • obsidian_periodic_notes

    Get current periodic note for the specified period. Returns both comprehensive metadata (tags, links, titles, etc.) and note content using the enhanced API approach.

  • obsidian_recent_periodic_notes

    Get most recent periodic notes for the specified period type. When include_content=True, return notes' comprehensive metadata (tags, links, titles, etc.) and note content using the enhanced API approach.

  • obsidian_append_to_file

    Append content to a new or existing file in the vault.

  • obsidian_list_files_in_dir

    Lists all files and directories that exist in a specific Obsidian directory.

  • obsidian_simple_search

    Simple search for documents matching a specified text query across all files in the vault. Use this tool when you want to do a simple text search

  • obsidian_patch_file

    Insert content into an existing note relative to a heading, block reference, or frontmatter field.

  • obsidian_delete_file

    Delete a file or directory from the vault.

  • obsidian_put_file

    Create a new file in your vault or update the content of an existing one in your vault.

  • obsidian_batch_get_files

    Return the contents and metadata of one or more notes (.md files) in your vault.

  • obsidian_understand_vault

    Get a comprehensive understanding of the vault structure. Returns: 1. directory tree representation and 2. NetworkX graph of note connections used to understand how different notes (.md) and other files (e.g. images, PDFs, referenced/attached) are connected. Combines filesystem directory structure with note relationship graph between notes (.md files).

  • obsidian_recent_changes

    Get recently modified files in the vault.

  • obsidian_get_active_note

    Get the content and metadata of the currently active note in Obsidian. Always returns the note that is most recently edited (edit with user).

  • obsidian_execute_commands

    Execute one or more commands in obsidian interface, in order. For commands used on specific notes, make sure to open a note first.

  • obsidian_complex_search

    Complex search for documents using a JsonLogic query. Supports standard JsonLogic operators plus 'glob' and 'regexp' for pattern matching. Results must be non-falsy.

           Use this tool when you want to do a complex search, e.g. for all documents with certain tags etc.
           ALWAYS follow query syntax in examples.
    
           Examples
            1. Match all markdown files
            {"glob": ["*.md", {"var": "path"}]}
    
            2. Match all markdown files with 1221 substring inside them
            {
              "and": [
                { "glob": ["*.md", {"var": "path"}] },
                { "regexp": [".*1221.*", {"var": "content"}] }
              ]
            }
    
            3. Match all markdown files in Work folder containing name Keaton
            {
              "and": [
                { "glob": ["*.md", {"var": "path"}] },
                { "regexp": [".*Work.*", {"var": "path"}] },
                { "regexp": ["Keaton", {"var": "content"}] }
    

Dùng MCP Obsidian Advanced 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 Advanced, 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 Advanced 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 Advanced.
  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-advanced": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-obsidian-advanced"
      ]
    }
  }
}
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 Advanced, 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 Advanced.
  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 Advanced giúp tôi làm việc này không?
Obsidian Advanced
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Obsidian Advanced.

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

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

Obsidian Advanced 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 Advanced 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 Advanced 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 Advanced 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 Advanced, 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 Advanced với TypingMind?

Obsidian Advanced 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 Advanced cung cấp những công cụ nào trong TypingMind?

Obsidian Advanced cung cấp 16 công cụ 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 Advanced 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 Advanced 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 👇