Bitcoinのロゴ

Bitcoin

コミュニティ
AbdelStark

Bitcoin & Lightning Network MCP Server.

公開者AbdelStark
リポジトリbitcoin-mcp
言語TypeScript
フォーク
22
スター
77
利用可能なツール
7
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

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

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

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

  • コピーして使える設定

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

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

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

MseeP.ai Security Assessment Badge

₿itcoin & Lightning Network MCP Server

Overview

A Model Context Protocol (MCP) server that enables AI models to interact with Bitcoin and Lightning Network, allowing them to generate keys, validate addresses, decode transactions, query the blockchain, and more.

🎮 Demo

Claude Demo VideoGoose Demo Video

💼 Table of Contents

🔧 Features

  • Key Generation: Create new Bitcoin key pairs — including address, public key, and private key (WIF).
  • Address Validation: Validate the correctness of a Bitcoin address.
  • Transaction Decoding: Parse a raw Bitcoin transaction and display its details in a human-readable format.
  • Blockchain Queries:
    • Latest Block: Retrieve details about the most recent block (hash, height, timestamp, transaction count, etc.).
    • Transaction Details: Fetch detailed information about a transaction using its TXID.
  • Lightning Network:
    • Invoice Decoding: Parse a BOLT11 Lightning invoice and display human-readable information.
    • Payment: Pay a Lightning invoice directly from your LNBits wallet.

🔑 Claude Desktop Integration

To use the Bitcoin MCP server with Claude Desktop (Anthropic's desktop app for Claude), follow these steps:

  1. Download and Install Claude Desktop: Visit the official Claude Desktop downloads page and get the app for your operating system (macOS or Windows) (Installing Claude for Desktop | Anthropic Help Center). Install the app and ensure you're using the latest version (you can check for updates in the app menu).

  2. Configure Claude Desktop to use the Bitcoin MCP Server: Open the Claude Desktop configuration file (it's created when you first edit settings in Claude Desktop):

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
      Add an entry for the Bitcoin MCP server in this JSON config under the "mcpServers" section. For example:
    json
    {
      "mcpServers": {
        "bitcoin-mcp": {
          "command": "npx",
          "args": ["-y", "bitcoin-mcp@latest"]
        }
      }
    }

    In the snippet above, "bitcoin-mcp" is an identifier for the server (you can name it whatever you want). The command is set to run the npx command, and args points to the path of your Bitcoin MCP server script or the command to run the server.

  3. Restart Claude Desktop: Save the claude_desktop_config.json file and then close and reopen Claude Desktop. On the next launch, Claude will automatically start the Bitcoin MCP server as configured. If Claude Desktop was running, you need to restart it for the changes to take effect.

Testing the Claude Desktop Integration

Once Claude Desktop is restarted, you can test whether the Bitcoin MCP server is working correctly:

  • Ask Claude a sample question related to Bitcoin. For example, try asking: "What's the latest block on the Bitcoin network?" If the integration is successful, Claude's response should include the latest block fetched via the MCP server, rather than an "I don't know" or a generic answer. You can also try other queries like "Give me information about the transaction with TXID abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890." Claude should use the MCP server's tools to retrieve the data and answer your query.

  • Verify the response: Claude should return a detailed answer (e.g. the latest block on the Bitcoin network) without errors. If you get an error message or no useful response, the MCP server might not be connected properly.

  • Check Claude's logs (if needed): Claude Desktop provides log files that can help debug MCP integrations. If the tool isn't responding, check the log files in:

    • macOS: ~/Library/Logs/Claude/
    • Windows: %APPDATA%\Claude\logs\
      Look for mcp.log for general MCP connection messages, and a file named mcp-server-bitcoin-mcp.log (or with whatever name you used) for the MCP server's output/errors. These logs will show if the server started up or if there were any errors (such as a wrong path or exceptions in the server). If you see errors, fix the configuration or environment as needed, then restart Claude Desktop and test again.

🦆 Goose Integration

Goose is an open-source AI agent framework by Block that supports extensions via the Model Context Protocol. You can integrate the Bitcoin MCP server as a Goose extension to allow Goose to interact with the Bitcoin blockchain. Goose supports two modes of integration for MCP servers: running the server as a local process (STDIO) or connecting to it as a remote service via Server-Sent Events (SSE). Below are instructions for both methods:

Using STDIO (Local Extension)

This method runs the Bitcoin MCP server locally as a subprocess of Goose, communicating through standard input/output.

  1. Add a new extension in Goose: Open Goose's configuration interface. You can do this via the command line by running goose configure, or in the Goose Desktop app by going to Settings > Extensions. From the menu, choose "Add Extension." (Using Extensions | goose)

  2. Choose the extension type – Command-Line Extension: When prompted for the type of extension, select Command-Line Extension (in the CLI menu or UI) so that Goose knows it should launch a local command (Using Extensions | goose) (as opposed to a built-in or remote extension).

  3. Enter the extension details: Provide a name and command for the Bitcoin MCP server:

    • Name: You can call it "bitcoin", or any identifier (this will be how you refer to the extension).

    • Command: Specify how to run the MCP server. For example, if you have the Python script, enter the command to run it. In the CLI configurator, it might ask "What command should be run?" – you would enter:

      bash
      npx -y bitcoin-mcp@latest

      This tells Goose to launch the Bitcoin MCP server (GitHub - AbdelStark/bitcoin-mcp: Bitcoin MCP Server). (Make sure to use the correct path to your server script or the correct command to run the server, just like in the Claude config.)

    • You typically do not need to add any arguments beyond the script path (unless your server requires special flags). The above command uses the default STDIO transport, which Goose expects for a command-line extension. (In the Goose config file, this would correspond to an entry with cmd: "npx" and args: ["-y", "bitcoin-mcp@latest"], with type: stdio indicating standard I/O mode (Using Extensions | goose).)

  4. Finalize and enable: Complete the extension addition. Goose will add this new extension to its configuration (usually ~/.config/goose/config.yaml). Ensure the extension is enabled (if using the CLI wizard, it should be enabled by default once added; in the Goose Desktop app, you can check the Extensions list and toggle it on if it isn't already (Using Extensions | goose) (Using Extensions | goose)).

  5. Start a Goose session with the new extension: You can now use the extension in Goose. If you're running Goose via CLI, start a session that includes the extension by running:

    bash
    goose session --with-extension "bitcoin"

replacing "bitcoin" with whatever name you gave the extension (Using Extensions | goose). (This ensures the session loads the extension. Alternatively, if the extension is enabled globally, Goose Desktop or CLI will automatically have it available in all sessions.)

Using SSE (Remote Extension)

This method connects Goose to an already-running MCP server via an HTTP SSE stream. Use this if you want to run the Bitcoin MCP server as a standalone service (possibly on another machine or just independently of Goose).

  1. Launch the MCP server as a standalone service: Run the Bitcoin MCP server so that it listens for connections. In practice, this means the server needs to be started in a mode that serves an HTTP endpoint for MCP. For example, you might run the server with a specific command or option to listen on a port (such as using an MCP library's built-in web server capabilities or running under a web framework). Ensure the server is reachable at a known URL (e.g., http://localhost:9000) and supports the MCP protocol over SSE.

  2. Add a new extension in Goose (Remote): As before, run goose configure or use the Goose UI to Add Extension (Using Extensions | goose). This time, choose Remote Extension when asked for the type of extension (Using Extensions | goose). This tells Goose that it will connect to an external server via SSE.

  3. Enter the remote extension details: Give the extension a name (e.g., "bitcoin") and provide the server's URL. For the URL, enter the base address where the MCP server is running. For instance, if your server is listening on port 9000 on your local machine, you might enter http://localhost:9000. Goose will attempt to connect to the MCP server's SSE endpoint at that address. (Goose uses the standard MCP SSE path, which by convention is under the /mcp/sse route on the server, you usually just need to supply the host and port, and Goose handles the rest.)

  4. Enable the extension: After adding the remote extension, ensure it's enabled in Goose's settings (just like in the STDIO case). Only one of the STDIO or SSE extension (with the same tools) needs to be enabled – if you accidentally enable both a local and remote version of the same server, you may want to disable one to avoid confusion.

Using the Bitcoin MCP extension in Goose: Once the extension is set up (via either method above) and enabled, you can interact with Goose and query Bitcoin data through it. In a new Goose chat or session, simply ask questions as you normally would. Goose will recognize when to use the Bitcoin MCP tools to fulfill your request. For example:

  • "What's the latest Bitcoin block?"
  • "Give me information about the transaction with TXID abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890."

When you ask these questions, Goose will invoke the MCP server's tools and return the answer (e.g., the latest Bitcoin block information). You should see Goose responding with up-to-date information pulled from the Bitcoin blockchain via the MCP server.

If Goose does not seem to use the extension (for instance, if it responds that it cannot find the information), make sure the extension is enabled and that the server is running (in SSE mode for remote). You can also run Goose's CLI with verbose logging to see if it attempted to call the extension. Generally, if configured correctly, Goose will automatically discover the MCP server's capabilities and use them when relevant.

Further Resources: For more details on Goose extensions and the MCP, refer to the official Goose documentation (Using Extensions | goose). The docs include a list of built-in and community extensions and explain how MCP servers integrate into Goose. You can also find a directory of available MCP servers and additional configuration tips in the Goose docs and the Model Context Protocol documentation. This can help if you want to explore more extensions or develop your own.

📦 Development Setup

Find the setup instructions in the Development Setup guide.

Lightning Network Configuration (Optional)

To use Lightning Network features, you'll need to configure LNBits connection details. These are optional and only required if you plan to use the Lightning Network tools.

json
{
  "lnbitsUrl": "https://demo.lnbits.com",  
  "lnbitsAdminKey": "your_admin_key",      // Required for making payments
  "lnbitsReadKey": "your_read_key"         // Required for wallet information
}

You can obtain these values by:

  1. Creating an account at LNBits
  2. Creating a new wallet
  3. Going to API info to find your API keys

📦 Available Tools

Find the available tools in the API Reference guide.

🚨 Error Handling

The server employs custom error types to handle Bitcoin operations and blockchain queries. Detailed error messages are logged using Pino and included in client responses for easier debugging.

🤝 Contributing

Contributions and feature requests are welcome! Feel free to submit pull requests or open issues on GitHub.

📝 License

This project is licensed under the MIT License.

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "bitcoin-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "bitcoin-mcp@latest"
      ]
    }
  }
}

利用可能なツール

  • generate_key

    Generate a new Bitcoin key pair and address

  • validate_address

    Validate a Bitcoin address

  • decode_tx

    Decode a Bitcoin transaction

  • get_latest_block

    Get the latest block

  • get_transaction

    Get transaction details

  • decode_invoice

    Decode a Lightning invoice

  • pay_invoice

    Pay a Lightning invoice

BitcoinのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Bitcoinに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

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

Bitcoinをサーバーとして追加

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

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

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

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

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

よくある質問

Bitcoin MCPサーバーは何に使いますか?

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

TypingMindでBitcoin MCPを複数のAIモデルと併用できますか?

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

TypingMindでBitcoin MCPを使うメリットは何ですか?

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

Bitcoin MCPをTypingMindに接続するにはどうすればよいですか?

BitcoinはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでBitcoin MCPのどのようなツールを利用できますか?

Bitcoinは7個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

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

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

関連するMCPサーバー

すべて見る

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

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