Skip to main content
Glama

Obsidian MCP Server

by pmmvr
MIT License
3

Obsidian MCP サーバー

AI エージェントがローカル REST API プラグインを通じて Obsidian Vault 全体で高度な知識の検出と分析を実行できるようにする MCP (モデル コンテキスト プロトコル) サーバー。

これがなぜ重要なのか

このサーバーは、Obsidian Vault を AI エージェントの強力な知識ベースに変換し、次のような複雑な複数ステップのワークフローを可能にします。

  • 「4月1日以降に作成された、タイトルに「ロードマップ」または「タイムライン」を含む「プロジェクト/計画」フォルダからメモを取得し、ブロックや依存関係を分析し、ソースメモへの参照を含む統合リスク評価を提示します。」
  • 「先月の「調査」または「分析」のタグが付けられたすべてのメモを検索し、その内容を調べて未完了のセクションや未解決の質問を探し、「チーム/専門知識」のメモと相互参照して、各ギャップの解決に役立つ同僚を提案してください。」
  • 「『リーダーシップ/四半期』から『予算』や『人員』を含む会議メモの完全な内容を取得し、自分の部門に割り当てられたアクション項目を分析し、ソースメモの参照を含む時系列タイムラインを作成します。」

サーバーの高度なフィルタリング、正規表現のサポート、完全なコンテンツ取得機能により、エージェントは手動では何時間もかかる微妙な知識作業を実行できます。

前提条件

  1. Obsidian VaultにObsidian Local REST APIプラグインをインストールします
  2. Obsidianの設定でプラグインを設定して有効化する
  3. API URL(デフォルト: https://localhost:27124 )とAPIキー(設定している場合)をメモします。

インストール

PyPIから(推奨)

# Install from PyPI pip install obsidian-api-mcp-server # Or with uv uv pip install obsidian-api-mcp-server

MCP構成に追加

MCP クライアント構成 (例: Claude Desktop) に追加します。

{ "mcpServers": { "obsidian-api-mcp-server": { "command": "uvx", "args": [ "--from", "obsidian-api-mcp-server>=1.0.1", "obsidian-api-mcp" ], "env": { "OBSIDIAN_API_URL": "https://localhost:27124", "OBSIDIAN_API_KEY": "your-api-key-here" } } } }

ソースから(開発)

# Clone the repository git clone https://github.com/pmmvr/obsidian-api-mcp-server cd obsidian-api-mcp-server # Install with uv uv pip install -e . # Or with pip pip install -e .

構成

Obsidian API の環境変数を設定します。

# Required: Obsidian API URL (HTTPS by default) export OBSIDIAN_API_URL="https://localhost:27124" # Default # Optional: API key if you've configured authentication export OBSIDIAN_API_KEY="your-api-key-here"

重要なセキュリティ上の注意OBSIDIAN_API_KEYをスクリプトに直接ハードコードしたり、バージョン管理にコミットしたりすることは避けてください。API キーの管理には、 .envファイル(このプロジェクトの.gitignoreに含まれています)とpython-dotenvなどのライブラリを使用するか、オペレーティングシステムまたはシェルで管理されている環境変数を使用することを検討してください。

:サーバーはデフォルトでHTTPSを使用し、ローカルObsidianインスタンスで一般的に使用される自己署名証明書のSSL証明書検証を無効にします。HTTP接続の場合は、 OBSIDIAN_API_URL="http://localhost:27123"を設定してください。

使用法

MCP サーバーを実行します。

obsidian-mcp

利用可能なツール

サーバーは 3 つの強力なツールを提供します。

  1. search_vault - 柔軟なフィルターと完全なコンテンツ取得を備えた高度な検索:
    • query - ノートの内容全体にわたるテキストまたは正規表現の検索(オプション)
    • query_type - 検索タイプ:「テキスト」(デフォルト) または「正規表現」
    • search_in_path - 特定のフォルダパスに検索を制限する
    • title_contains - ノートタイトルのテキストでフィルタリングします(文字列、配列、または JSON 文字列)
    • title_match_mode - 複数の用語を一致させる方法:「いずれか」(OR) または「すべて」(AND)
    • tag - タグでフィルタリング(文字列、配列、または JSON 文字列 - フロントマターとインライン #tags を検索)
    • tag_match_mode - 複数のタグを一致させる方法:「いずれか」(OR) または「すべて」(AND)
    • context_length - 返されるコンテンツの量(完全なコンテンツの場合は高く設定)
    • include_content - 一致するすべてのノートの完全なコンテンツを取得するためのブール値
    • created_since/until - 作成日でフィルタリング
    • modified_since/until - 変更日でフィルタリング
    • page_size - ページあたりの結果数
    • max_matches_per_file - ノートごとの一致数を制限する

    主な特徴:

    • queryが指定されていない場合は、フィルターのみの検索で完全なコンテンツを自動的に返します。
    • include_content=Trueすべての検索で完全なコンテンツ取得を強制します。
    • 複雑なテキスト マッチングのための正規表現パターンをサポートします (OR 条件、大文字と小文字を区別しない検索など)
  2. get_note_content - パスで特定のノートの完全なコンテンツとメタデータを取得します
  3. browse_vault_structure - ボールトのディレクトリ構造を効率的にナビゲートします。
    • path - 参照するディレクトリ(デフォルトは Vault ルート)
    • include_files - ファイルを含めるかどうかのブール値(デフォルト: False、速度のためにフォルダーのみ)
    • recursive - ネストされたすべてのディレクトリを参照するためのブール値

使用例

基本検索

  1. 特定のフォルダー内のタイトルでノートを検索します。
    search_vault( search_in_path="Work/Projects/", title_contains="meeting" )
  2. 複数のタイトル用語を含むノートを検索します (OR ロジック):
    search_vault( title_contains=["foo", "bar", "fizz", "buzz"], title_match_mode="any" # Default )
  3. すべてのタイトル用語を含むノートを検索します (AND ロジック):
    search_vault( title_contains=["project", "2024"], title_match_mode="all" )
  4. 完全な内容を含む最近のメモをすべて取得します。
    search_vault( modified_since="2025-05-20", include_content=True )
  5. コンテキストによるテキスト検索:
    search_vault( query="API documentation", search_in_path="Engineering/", context_length=500 )
  6. タグで検索:
    search_vault( tag="project" )
  7. OR条件の正規表現検索:
    search_vault( query="foo|bar", query_type="regex", search_in_path="Projects/" )
  8. 特定の人に割り当てられたタスクの正規表現検索:
    search_vault( query="(TODO|FIXME|ACTION).*@(alice|bob)", query_type="regex", search_in_path="Work/Meetings/" )

高度なマルチステップワークフロー

これらの例は、エージェントが高度な知識発見タスクを連鎖させる方法を示しています。

  1. 戦略プロジェクト分析:
    # Step 1: Get all project documentation search_vault( search_in_path="Projects/Infrastructure/", title_contains=["planning", "requirements", "architecture"], title_match_mode="any", include_content=True ) # Step 2: Find related technical discussions search_vault( tag=["infrastructure", "technical-debt"], tag_match_mode="any", modified_since="2025-04-01", include_content=True )
    エージェントは依存関係を分析し、リスクを特定し、リソースの割り当てを推奨することができます。
  2. 会議のアクションアイテムマイニング:
# Get all recent meeting notes with full content search_vault( search_in_path="Meetings/", title_contains=["standup", "planning", "retrospective"], title_match_mode="any", created_since="2025-05-01", include_content=True )

エージェントはコンテンツをスキャンしてアクション項目を探し、割り当てを抽出し、時系列の追跡を作成します。

  1. 研究ギャップ分析:
# Find research notes with questions or gaps search_vault( query="(TODO|QUESTION|INVESTIGATE|UNCLEAR)", query_type="regex", tag=["research", "analysis"], tag_match_mode="any", include_content=True ) # Cross-reference with team expertise search_vault( search_in_path="Team/", tag=["expertise", "skills"], tag_match_mode="any", include_content=True )

エージェントは知識のギャップを特定し、支援できるチームメンバーを提案します

  1. 金庫構造の探索:
# Quick organizational overview browse_vault_structure(recursive=True) # Deep dive into specific areas browse_vault_structure( path="Projects/CurrentSprint/", include_files=True, recursive=True )
  1. タグベースの知識マッピング:
# Find notes with multiple tags (AND logic) search_vault( tag=["project", "urgent"], tag_match_mode="all", include_content=True ) # Find notes with any relevant tags (OR logic) search_vault( tag=["architecture", "design", "implementation"], tag_match_mode="any", modified_since="2025-04-15" )

発達

# Install with test dependencies uv pip install -e ".[test]" # Run the server python -m obsidian_mcp.server # Run tests uv run behave features/blackbox_tests.feature # Or use the test runner python run_tests.py

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

AI エージェントがローカル REST API プラグインを通じて Obsidian Vault 全体で高度な知識の検出と分析を実行できるようにするサーバー。高度なフィルタリングと完全なコンテンツ取得を備えた複雑なマルチステップ ワークフローをサポートします。

  1. これがなぜ重要なのか
    1. 前提条件
      1. インストール
        1. PyPIから(推奨)
        2. MCP構成に追加
        3. ソースから(開発)
      2. 構成
        1. 使用法
          1. 利用可能なツール
            1. 使用例
              1. 基本検索
              2. 高度なマルチステップワークフロー
            2. 発達
              1. ライセンス

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables AI assistants to interact with Obsidian vaults, providing tools for reading, creating, editing and managing notes and tags.
                  Last updated -
                  598
                  149
                  TypeScript
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  Provides programmatic search functionality for Obsidian vaults through a REST API interface, allowing external applications to search through notes and retrieve absolute paths to matching documents.
                  Last updated -
                  10
                  Python
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  Provides a standardized interface for AI assistants to interact with Obsidian vaults through a local REST API, enabling reading, writing, searching, and managing notes.
                  Last updated -
                  37
                  TypeScript
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A lightweight server that enables AI assistants like Cursor & Claude to read from and write to Obsidian vaults, allowing actions like creating notes, checking existing content, and managing todos through natural language.
                  Last updated -
                  192
                  8
                  TypeScript

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/pmmvr/obsidian-api-mcp-server'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server