Skip to main content
Glama
MCP server for Obsidian

MCP server for Obsidian

Obsidian の MCP サーバー

ローカル REST API コミュニティ プラグインを介して Obsidian と対話するための MCP サーバー。

コンポーネント

ツール

サーバーは Obsidian と対話するための複数のツールを実装しています。

  • list_files_in_vault: Obsidian の金庫のルートディレクトリにあるすべてのファイルとディレクトリを一覧表示します

  • list_files_in_dir: 特定のObsidianディレクトリ内のすべてのファイルとディレクトリを一覧表示します

  • get_file_contents: ボールト内の 1 つのファイルの内容を返します。

  • 検索: 指定されたテキストクエリに一致する文書を保管庫内のすべてのファイルから検索します。

  • patch_content: 見出し、ブロック参照、または frontmatter フィールドを基準にして、既存のノートにコンテンツを挿入します。

  • append_content: ボールト内の新規ファイルまたは既存のファイルにコンテンツを追加します。

  • delete_file: 保管庫からファイルまたはディレクトリを削除します。

プロンプトの例

まずクロードにObsidianを使うように指示すると良いでしょう。そうすれば、常にそのツールが呼び出されます。

使用プロンプトは次のようになります:

  • 最後のアーキテクチャコールノートの内容を取得して要約する

  • Azure CosmosDb が言及されているすべてのファイルを検索し、それが言及されているコンテキストを簡単に説明してください

  • 前回の会議の議事録を要約し、「summary meeting.md」という新しいメモを作成してください。メールで送れるように、紹介文を追加してください。

Related MCP server: mcp-obsidian-ek

構成

Obsidian REST API キー

Obsidian REST API キーを使用して環境を構成する方法は 2 つあります。

  1. サーバー設定に追加(推奨)

{
  "mcp-obsidian": {
    "command": "uvx",
    "args": [
      "mcp-obsidian"
    ],
    "env": {
      "OBSIDIAN_API_KEY": "<your_api_key_here>",
      "OBSIDIAN_HOST": "<your_obsidian_host>"
    }
  }
}
  1. 次の必須変数を含む.envファイルを作業ディレクトリに作成します。

OBSIDIAN_API_KEY=your_api_key_here
OBSIDIAN_HOST=your_obsidian_host

注: キーは Obsidian プラグイン設定で見つかります。

クイックスタート

インストール

オブシディアン REST API

Obsidian REST API コミュニティ プラグインを実行する必要があります: https://github.com/coddingtonbear/obsidian-local-rest-api

設定でインストールして有効にし、API キーをコピーします。

クロードデスクトップ

MacOSの場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uv",
      "args": [
        "--directory",
        "<dir_to>/mcp-obsidian",
        "run",
        "mcp-obsidian"
      ]
    }
  }
}
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uvx",
      "args": [
        "mcp-obsidian"
      ],
      "env": {
        "OBSIDIAN_API_KEY" : "<YOUR_OBSIDIAN_API_KEY>"
      }
    }
  }
}

発達

建物

配布用のパッケージを準備するには:

  1. 依存関係を同期し、ロックファイルを更新します。

uv sync

デバッグ

MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。

次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。

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

起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。

次のコマンドでサーバー ログを監視することもできます。

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

Available Tools

13 tools
obsidian_append_contentC

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

Inputs: filepath (required), content (required).

obsidian_batch_get_file_contentsA

Return the contents of multiple files in your vault, concatenated with headers.

Inputs: filepaths (required).

obsidian_delete_fileC

Delete a file or directory from the vault.

Inputs: filepath (required), confirm (required).

obsidian_get_file_contentsC

Return the content of a single file in your vault.

Inputs: filepath (required).

obsidian_get_periodic_noteB

Get current periodic note for the specified period.

Inputs: period (required), type.

obsidian_get_recent_changesB

Get recently modified files in the vault.

Inputs: limit, days.

obsidian_get_recent_periodic_notesC

Get most recent periodic notes for the specified period type.

Inputs: period (required), limit, include_content.

obsidian_list_files_in_dirA

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

Inputs: dirpath (required).

obsidian_list_files_in_vaultA

Lists all files and directories in the root directory of your Obsidian vault.

Inputs: no named parameters.

obsidian_patch_contentA

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

Inputs: filepath (required), operation (required), target_type (required), target (required), +1 more.

obsidian_put_contentC

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

Inputs: filepath (required), content (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific operations like reading, writing, searching, or listing files. However, obsidian_simple_search and obsidian_complex_search could cause confusion as both handle search functionality, though their descriptions clarify different use cases (simple text vs. complex JsonLogic queries).

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with the 'obsidian_' prefix and descriptive verb_noun combinations (e.g., obsidian_get_file_contents, obsidian_list_files_in_dir). This uniformity makes the tool set predictable and easy to navigate.

    Tool Count5/5

    With 13 tools, the count is well-suited for an Obsidian vault management server. It covers a comprehensive range of operations without being overwhelming, including file CRUD, content manipulation, searching, and listing, which aligns with the domain's scope.

    Completeness5/5

    The tool set provides complete coverage for Obsidian vault operations, including CRUD (create/read/update/delete via tools like obsidian_put_content, obsidian_get_file_contents, obsidian_patch_content, obsidian_delete_file), searching (simple and complex), listing files, and handling periodic notes. No obvious gaps are present for typical agent workflows.

    Maintenance

    ActivityInactive
    ResponsivenessMostly unanswered

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server providing tools to interact with Obsidian via the Local REST API community plugin.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for interacting with Obsidian via the Local REST API, enabling file operations, search, and content editing in your vault.
      MIT