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 つあります。
サーバー設定に追加(推奨)
{
"mcp-obsidian": {
"command": "uvx",
"args": [
"mcp-obsidian"
],
"env": {
"OBSIDIAN_API_KEY": "<your_api_key_here>",
"OBSIDIAN_HOST": "<your_obsidian_host>"
}
}
}次の必須変数を含む
.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>"
}
}
}
}発達
建物
配布用のパッケージを準備するには:
依存関係を同期し、ロックファイルを更新します。
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.logAvailable Tools
13 toolsobsidian_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_complex_searchA
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"}] }
]
}
Inputs: query (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).
obsidian_simple_searchB
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
Inputs: query (required), context_length.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
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).
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.
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.
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
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
An MCP server that provides agents access to the KeldynAI platform
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal-first MCP server for working with an Obsidian vault. No API key required1720MIT
- AlicenseNot gradedqualityDmaintenanceMCP server providing tools to interact with Obsidian via the Local REST API community plugin.5MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes Obsidian vault operations over HTTP via the Obsidian CLI, enabling note management, search, and daily note operations.1-
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with Obsidian via the Local REST API, enabling file operations, search, and content editing in your vault.MIT