SilverBullet MCP 服务器のロゴ

SilverBullet MCP 服务器

コミュニティ
Ahmad-A0

A Model Context Protocol (MCP) server to interact with your SilverBullet notes and data.

公開者Ahmad-A0
リポジトリsilverbullet-mcp
言語TypeScript
フォーク
9
スター
36
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    SilverBullet MCP 服务器は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには36件のスターと9件のフォークがあります。

SilverBullet MCP Server

This project provides a Model Context Protocol (MCP) server that acts as a bridge to your SilverBullet instance. It enables Large Language Models (LLMs) and other MCP-compatible clients to interact with your SilverBullet notes and data by exposing them through standardized MCP tools and resources.

The server is designed to be run via Docker Compose alongside your existing SilverBullet Docker container. It handles authentication and provides a secure way for external applications to access and manipulate your SilverBullet space.

Retirement Prompt Demo

Asking Claude to create a retirement projection, based on my notes.

Prerequisites

  • Docker
  • Docker Compose

Getting Started

  1. Clone the repository:

    bash
    git clone https://github.com/Ahmad-A0/silverbullet-mcp.git
    cd silverbullet-mcp
  2. Create an environment file: Copy the contents of .env.example to a new file named .env.

    bash
    cp .env.example .env

    Update the .env file with your specific values:

    • SB_AUTH_TOKEN: The token this MCP server uses to access SilverBullet. For multi-space servers, use a Dashboard-issued API token with access to the target space.
    • MCP_TOKEN: A secure token for clients (e.g., your AI model) to authenticate with this MCP server.
    • SB_API_BASE_URL: (Optional if running via docker-compose as defined) The base URL for the SilverBullet API. Defaults to http://silverbullet:3000 in the docker-compose.yml.
    • PORT: (Optional if running via docker-compose as defined) The port the MCP server will listen on. Defaults to 4000.
  3. Build and run the services using Docker Compose:

    bash
    docker compose up --build

    This command will:

    • Build the Docker image for the silverbullet-mcp-server if it doesn't exist or if Dockerfile or related files have changed.
    • Pull the tested SilverBullet 2.11.0 slim image (override with SILVERBULLET_IMAGE).
    • Start both the SilverBullet instance and the MCP server.

    The SilverBullet instance will be accessible at http://localhost:3000. The MCP server will be accessible at http://localhost:4000.

Existing SilverBullet and multi-space servers

Set SB_API_BASE_URL to the full address of the target space, including its path binding. Do not append /.fs and do not infer the URL from the space's display name. For example:

dotenv
SB_API_BASE_URL=http://your-silverbullet-host:3000/work
SB_AUTH_TOKEN=your-dashboard-issued-api-token
MCP_TOKEN=your-separate-mcp-client-token

Then start only the MCP service:

sh
docker compose up --build --no-deps silverbullet-mcp-server

The hostname must be reachable from the MCP container; localhost inside that container refers to the MCP container itself. Hostname-bound spaces need their configured hostname. See SilverBullet's Dashboard and authentication documentation.

The bundled two-service Compose example retains legacy single-space mode for existing ./space folders. It is not a multi-space migration tool. For an existing multi-space server, create tokens in its Dashboard rather than setting the SilverBullet server's legacy SB_AUTH_TOKEN environment variable.

A 404 No space here from /.fs usually means the configured URL points at the instance root rather than the space. Compose now respects SB_API_BASE_URL from .env. List/read/create/replace/delete and resource reads have been verified against a disposable SilverBullet 2.11.0 multi-space server.

Discovery and caching

resources/list returns up to 100 notes and a nextCursor for the next page. Pass it as cursor until no next cursor is returned. Direct sb-note:// resource reads and the list-notes tool remain available.

File listings are cached for 30 seconds and concurrent listing requests share one fetch. Successful MCP writes and deletes invalidate listing and content caches. Edits made outside MCP may take up to 30 seconds to appear in listing-backed operations. read-note reads directly; read-multiple-notes accepts enableCaching: false to bypass its content cache (its note discovery still uses the listing cache). Content caching retains at most 256 notes.

search-replace-note always treats replacement text literally, including $1, $&, and $$, even when useRegex enables regex matching of the search pattern.

Editing notes and structured tool results

Use edit-note for precise edits. Example tool arguments:

json
{
  "filename": "Projects/Plan.md",
  "edits": [
    { "oldText": "Status: draft", "newText": "Status: approved", "expectedMatches": 1 }
  ],
  "dryRun": true
}

Matching is literal and case-sensitive, with one expected match per edit by default. Every edit is matched against the original note, so replacements never cascade into subsequent edits. A missing, ambiguous, or overlapping match rejects the entire batch without writing. expectedMatches permits intentional multiple replacements. Empty oldText is rejected; empty newText deletes the matched text.

A dry run returns a unified diff and the note's revision. To apply that preview, repeat the arguments with dryRun: false and expectedRevision set to the returned revision. The tool also uses the revision it reads as an HTTP write precondition, so a concurrent change between its read and write fails rather than being lost. This requires a SilverBullet server implementing ETag/If-Match semantics (tested on 2.11). If no strong ETag is returned, changed edits cannot be applied; previews still work. Unchanged edits make no write. Diffs are capped at 50,000 characters, with diffTruncated indicating omitted output. The diff computation has a one-second budget; exceeding it rejects the edit before writing.

search-replace-note remains available with its existing case-insensitive, replace-all defaults. It does not provide revision protection; use edit-note for that. Invalid regexes now return errors instead of falling back to literal matching. search-notes also accepts useRegex: false for literal searches.

All eight tools advertise an outputSchema and return structuredContent on success alongside the existing readable text. Tool failures return isError: true and an explanation; successful output schemas do not describe error results. Batch reads and searches include per-note errors when only some reads fail.

Returned data is bounded:

  • read-note: offset and limit (default 50,000, maximum 100,000 characters), plus nextOffset, totalCharacters, and the full note's revision. Offsets count JavaScript UTF-16 code units. If the revision changes between pages, restart the read to avoid combining different note versions.
  • list-notes: limit (default 100, maximum 500) and cursor; results contain nextCursor and the filtered total. Keep filters unchanged when advancing.
  • read-multiple-notes: up to 100 notes and contentLimit (default 50,000, maximum 100,000 characters per note). Truncated notes report truncated and totalCharacters; retrieve the remainder with read-note.
  • search-notes: up to 100 results per page and maxMatchesPerNote (default 20, maximum 100). Returned line snippets are capped at 2,000 characters and context at 4,000. Scores count all matches; matchesTruncated flags omitted matching lines. Counts and page numbers must be positive integers; context may be zero.

create-note still defaults to refusing overwrite. It only treats an actual 404 as a missing note and sends If-None-Match: * to prevent a racing creation from being overwritten on servers supporting conditional writes.

Connecting to the MCP Server

This MCP server runs as part of a Docker Compose setup and will be accessible at http://localhost:4000 by default.

You can connect to this server using an MCP client. The method of connection and authentication depends on the client's capabilities.

Using mcp-remote (for stdio-only clients)

If your MCP client only supports stdio connections (e.g., older versions of Claude Desktop, Cursor, Windsurf), you can use mcp-remote to bridge the connection to this HTTP-based MCP server.

mcp-remote acts as a local stdio MCP server that proxies requests to a remote HTTP MCP server, handling authentication in the process.

Client Configuration with Authentication:

This MCP server requires token-based authentication. Configure your MCP client (e.g., in claude_desktop_config.json, ~/.cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json) to use mcp-remote and pass the MCP_TOKEN via a custom header:

jsonc
{
  "mcpServers": {
    "silverbullet-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:4000/mcp", 
        "--transport",
        "http-only",
        "--header",
        "Authorization:Bearer ${MCP_SERVER_TOKEN}" 
      ],
      "env": {
        "MCP_SERVER_TOKEN": "your_actual_mcp_token_from_dotenv"
      }
    }
  }
}

Important:

  • Replace "your_actual_mcp_token_from_dotenv" with the actual value of MCP_TOKEN you have set in your .env file for the silverbullet-mcp-server.
  • Some clients (like Cursor and Claude Desktop on Windows) have issues with spaces in args. The example above (Authorization:Bearer ${MCP_SERVER_TOKEN}) avoids this.
  • Ensure npx can find mcp-remote. You might need to add -y as the first argument to args (e.g., ["-y", "mcp-remote", ...]) or install mcp-remote globally (npm install -g mcp-remote).

Refer to the mcp-remote documentation for more advanced configurations, including OAuth support (not used by this server's default auth), different transport strategies, and troubleshooting.

Direct Connection (for Streamable HTTP clients)

If your MCP client supports Streamable HTTP transport and can send custom headers, you can connect to it directly.

The server supports two methods for token-based authentication:

  1. Authorization Header (Recommended):

    • Header Name: Authorization
    • Header Value: Bearer YOUR_MCP_TOKEN
  2. Query Parameter:

    • Append ?token=YOUR_MCP_TOKEN to the server URL.
    • Example: http://localhost:4000/mcp?token=YOUR_MCP_TOKEN

Replace YOUR_MCP_TOKEN with the actual value of the MCP_TOKEN environment variable set in your .env file.

Endpoint: http://localhost:4000/mcp (or as configured by PORT if not using Docker Compose defaults).

Consult your MCP client's documentation on how to configure connections to remote HTTP MCP servers, including how to send custom headers or append query parameters.

Development and testing

Use Node.js 24 LTS and install the locked dependencies:

sh
npm ci
npm test

npm test builds TypeScript and runs the real HTTP MCP server against an in-memory SilverBullet HTTP fixture. It checks authentication, independent sessions, note reads and writes, resource reads, missing notes, session deletion, and a space URL prefix. The fixture uses disposable notes, random local ports, and test-only tokens; it does not read .env or access your space/ directory. No Docker or live SilverBullet credentials are needed. CI runs this suite on Node.js 22 and 24.

The regression checks for dollar replacements, session recovery, and cache races are included in npm test. To run only those checks:

sh
npm run test:regressions

For a real compatibility check, run:

sh
npm run test:live
# Or with Podman:
CONTAINER_RUNTIME=podman npm run test:live

This pulls the pinned SilverBullet 2.11.0 slim image and creates a temporary local server, accounts, tokens, and spaces. It mounts no host notes and removes its container afterward. Docker or Podman must be available. CI runs both the fixture suite and real-server checks before publishing an image.

インストール

TypingMind
{
  "mcpServers": {
    "silverbullet-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:4000/mcp",
        "--transport",
        "http-only",
        "--header",
        "Authorization:Bearer {{config.MCP_TOKEN}}"
      ],
      "env": {
        "MCP_TOKEN": "<MCP_TOKEN>"
      }
    }
  }
}

SilverBullet MCP 服务器のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度SilverBullet MCP 服务器に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

SilverBullet MCP 服务器をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. SilverBullet MCP 服务器のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "silverbullet-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "silverbullet-mcp-server"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてSilverBullet MCP 服务器のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. SilverBullet MCP 服务器のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
SilverBullet MCP 服务器を使ってこのタスクを手伝ってもらえますか?
SilverBullet MCP 服务器
はい、読みました。
SilverBullet MCP 服务器で調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

SilverBullet MCP 服务器がすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックします。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にhttp://localhost:4000/mcpを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にhttp://localhost:4000/mcpを貼り付けてください。
  2. SilverBullet MCP 服务器の接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックします。
  2. MCPコネクタの一覧に戻ってください。
  3. SilverBullet MCP 服务器の接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でSilverBullet MCP 服务器のツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でSilverBullet MCP 服务器のツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
SilverBullet MCP 服务器を使ってこのタスクを手伝ってもらえますか?
SilverBullet MCP 服务器
はい、読みました。
SilverBullet MCP 服务器で調べた結果をお伝えします。

よくある質問

SilverBullet MCP 服务器 MCPサーバーは何に使いますか?

SilverBullet MCP 服务器は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでSilverBullet MCP 服务器 MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでSilverBullet MCP 服务器を利用できます。

TypingMindでSilverBullet MCP 服务器 MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。SilverBullet MCP 服务器を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

SilverBullet MCP 服务器 MCPをTypingMindに接続するにはどうすればよいですか?

SilverBullet MCP 服务器は、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでSilverBullet MCP 服务器 MCPのどのようなツールを利用できますか?

SilverBullet MCP 服务器はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

SilverBullet MCP 服务器 MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。SilverBullet MCP 服务器で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇