obsidian-mcp-server
obsidian-mcp-server
Obsidian自体の中でMCP(Model Context Protocol)サーバーを実行するミニマルなObsidianプラグインで、Streamable HTTPトランスポートを使用します。4つのツールを公開します:list_notes、read_note、write_note、search_notes。
完全にあなたのマシン上で動作します(127.0.0.1にバインド)— リモートクライアントをそこに向けない限り、データがあなたのPCから出ることはありません(向けるべきではありません)。
このアプローチの理由
ObsidianのデスクトップアプリはElectronベースで、プラグインはNode統合を利用できるため、プラグインは実際のhttp.Serverを開いてMCPと直接通信できます — 外部プロセスも、常時起動しておく別のnpxサーバーも不要です。
Related MCP server: obsidian-mcp
ビルド(Windows)
# 1. Put this folder inside your vault's plugin directory, e.g.:
# <vault>\.obsidian\plugins\obsidian-mcp-server\
cd <vault>\.obsidian\plugins\obsidian-mcp-server
npm install
npm run buildこれによりmanifest.jsonの隣にmain.jsが生成されます。次にObsidianで:設定 → コミュニティプラグイン → 「MCP Server」をオンに切り替えます。MCP server listening on http://127.0.0.1:8123/mcpという通知が表示されるはずです。
ポートを変更したりベアラートークンを設定したりするには、プラグインの設定を開きます。
Claude Desktopへの接続
Claude DesktopのローカルmcpServers設定は、生のURLではなくstdioコマンドを想定しているため、mcp-remoteでHTTPエンドポイントにブリッジします(オンデマンドでnpxインストール、Node.jsが必要):
%APPDATA%\Claude\claude_desktop_config.jsonを編集します:
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://127.0.0.1:8123/mcp"]
}
}
}プラグイン設定でベアラートークンを設定した場合は、ヘッダーとして渡します:
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": [
"-y", "mcp-remote", "http://127.0.0.1:8123/mcp",
"--header", "Authorization:Bearer YOUR_TOKEN"
]
}
}
}トレイアイコンからClaude Desktopを終了し、起動し直します。4つのObsidianツールを示すツールアイコンが表示されるはずです。
デバッグ
Claude Desktopを使わずに、MCP Inspectorでサーバーを直接テストします:
npx @modelcontextprotocol/inspectorを実行し、http://127.0.0.1:8123/mcpに接続します。Obsidianの開発者コンソール(Ctrl+Shift+I)には、リクエストエラーを含むプラグインからの
console.error出力が表示されます。
拡張
main.tsのbuildMcpServer()にツールを追加します — 例:frontmatter/タグのクエリ用にapp.metadataCacheをラップする、または現在どのノートが開いているかを知るためにapp.workspaceをラップする。各ツールは、名前、zod入力スキーマ、{ content: [...] }を返す非同期ハンドラーだけです。
注記 / 注意点
マニフェスト内の
isDesktopOnly: true— Obsidianモバイルには生のhttpモジュールがないためです。ここでのステートレスなトランスポートモード(リクエストごとに新しい
StreamableHTTPServerTransportを生成)は最も単純なオプションであり、単一のローカルクライアントには十分です。適切なセッション継続性を持つ複数の同時クライアントが必要な場合は、Mcp-Session-Idをキーとするトランスポートマップを追加することになるでしょう — MCP TypeScript SDKの「with session management」の例を参照してください。ベアラートークンは、共有シークレットによる基本的なチェックであり、実際の認証ではありません。サーバーは127.0.0.1にのみバインドするため、主な脅威モデルは「マシン上の他のローカルプロセス」であり、トークンはそれに対処します。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes Obsidian vault operations over HTTP via the Obsidian CLI, enabling note management, search, and daily note operations.1-
- AlicenseAqualityDmaintenanceEnables MCP-compatible AI hosts to read, search, link, and write notes in a local Obsidian vault with sandboxed file access.11MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes an Obsidian vault (search, read, create, and update notes) via Streamable HTTP.-
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with Obsidian via the Local REST API, enabling file operations, search, and content editing in your vault.MIT