Skip to main content
Glama
BartK1990

obsidian-mcp-server

by BartK1990

obsidian-mcp-server

Obsidian自体の中でMCP(Model Context Protocol)サーバーを実行するミニマルなObsidianプラグインで、Streamable HTTPトランスポートを使用します。4つのツールを公開します:list_notesread_notewrite_notesearch_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.tsbuildMcpServer()にツールを追加します — 例: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にのみバインドするため、主な脅威モデルは「マシン上の他のローカルプロセス」であり、トークンはそれに対処します。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • 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.

  • Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.

View all MCP Connectors

Latest Blog Posts

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/BartK1990/obsidian-mcp-and-rest'

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