Base Network MCP Server

MIT License
4
1
  • Apple

Integrations

  • Allows interaction with the Base blockchain network (operated by Coinbase) for performing wallet management, balance checking, and transaction execution operations.

  • Provides specific configuration paths for Claude Desktop integration on macOS systems.

ベースネットワークMCPサーバー

これはBaseネットワーク用のMCPサーバーです。LLMは、ウォレット管理、残高確認、トランザクション実行など、自然言語コマンドを通じてBaseネットワーク上でブロックチェーン操作を実行できます。

このサーバーは、Base Mainnet と Base Sepolia テストネットの両方で動作します。

ツール

利用可能なツールは次のとおりです。

プロセスコマンド

ベースネットワーク操作のための自然言語コマンドを処理します。以下の引数を受け入れます。

  • command : 処理する自然言語コマンド(例:「0.5 ETHを0x1234に送信...」)

送信操作のトランザクションの詳細、残高チェックの残高情報、ウォレット作成のウォレットの詳細など、操作の結果を含む構造化された応答を返します。

ウォレットを作成する

ベースネットワーク上に新しいウォレットを作成します。以下の引数を受け入れます。

  • name : (オプション) ウォレットの名前

ウォレットのアドレス、名前、その他の詳細を含むオブジェクトを返します。

残高確認

Baseネットワーク上のウォレットの残高を確認します。以下の引数を受け入れます。

  • wallet : (オプション) 確認するウォレット名またはアドレス (デフォルトはプライマリウォレット)

ウォレットの残高を ETH で返します。

ウォレット一覧

利用可能なすべてのウォレットを一覧表示します。

ウォレット オブジェクトの配列を返します。各オブジェクトにはウォレット アドレス、名前、その他の詳細が含まれます。

使用法

クロード・デスクトップ

Claude Desktopは、モデルコンテキストプロトコル(MCP)をサポートする人気のLLMクライアントです。Base MCPサーバーをClaude Desktopに接続することで、自然言語コマンドでブロックチェーン操作を実行できます。

次の設定ファイルを使用して、Claude Desktop に MCP サーバーを追加できます。

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Base MCP サーバーを Claude Desktop に追加するには、構成ファイルのmcpServersオブジェクトに次の構成を追加します。

{ "mcpServers": { "base": { "command": "npx", "args": [ "-y", "base-network-mcp-server" ], "env": { "BASE_PROVIDER_URL": "https://api.developer.coinbase.com/rpc/v1/base/YOUR_API_KEY", "WALLET_PRIVATE_KEY": "your_private_key_here" }, "disabled": false, "autoApprove": [] } } }

構成

  • BASE_PROVIDER_URL : ベースネットワークプロバイダー(メインネットまたはセポリア)のURL
  • WALLET_PRIVATE_KEY : 認証とトランザクション署名用のウォレット秘密鍵
  • DEFAULT_GAS_PRICE : (オプション) Gweiのデフォルトのガス価格

プログラムで(カスタム MCP クライアント)

独自のMCPクライアントを構築する場合は、お好みのトランスポートを使用してプログラム的にBase MCPサーバーに接続できます。MCP SDKには、組み込みのstdioおよびSSEトランスポートが用意されています。

インストール

npm i base-network-mcp-server # or yarn add base-network-mcp-server # or pnpm add base-network-mcp-server

次の例では、StreamTransport を使用して MCP クライアントとサーバー間を直接接続します。

import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StreamTransport } from '@modelcontextprotocol/sdk/client/stream.js'; import { BaseMcpServer } from 'base-network-mcp-server'; // Create a stream transport for both client and server const clientTransport = new StreamTransport(); const serverTransport = new StreamTransport(); // Connect the streams together clientTransport.readable.pipeTo(serverTransport.writable); serverTransport.readable.pipeTo(clientTransport.writable); const client = new Client( { name: 'MyClient', version: '0.1.0', }, { capabilities: {}, } ); // Create and configure the Base MCP server const server = new BaseMcpServer({ providerUrl: 'https://api.developer.coinbase.com/rpc/v1/base/YOUR_API_KEY', privateKey: 'your_private_key_here', }); // Connect the client and server to their respective transports await server.connect(serverTransport); await client.connect(clientTransport); // Call tools const output = await client.callTool({ name: 'process_command', arguments: { command: 'Check my wallet balance', }, }); console.log(output); // Example output: // { // "success": true, // "message": "Balance of wallet \"default\": 1.5 ETH", // "balance": "1.5", // "wallet": "default" // }

コマンド例

統合されると、次のような自然言語コマンドを使用できるようになります。

  • 「貯蓄用の新しいウォレットを作成する」
  • 「ウォレットの残高を確認してください」
  • 「私の貯金箱の残高はいくらですか?」
  • 「0.1 ETHを0x1234567890123456789012345678901234567890に送信」
  • 「貯蓄ウォレットから 0.5 ETH を 0xABCD に転送します...」

セキュリティに関する考慮事項

この実装は実際のブロックチェーン ネットワークと対話し、秘密鍵を処理するため、

  1. 秘密鍵のセキュリティ: 秘密鍵を安全に保管し、バージョン管理にコミットしないでください。
  2. まずはテストネットを使用する: メインネットに移行する前に、ベースとなる Sepolia テストネットから始める
  3. トランザクション検証: 送信前に必ずトランザクションパラメータを検証します
  4. エラー処理: ネットワークの問題に対する堅牢なエラー処理を実装する
  5. レート制限: 頻繁にリクエストを行う場合は、API レート制限に注意してください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

ウォレット管理、残高チェック、トランザクション実行などの自然言語コマンドを通じて、LLM がベース ネットワーク上でブロックチェーン操作を実行できるようにする MCP サーバー。

  1. Tools
    1. process_command
    2. create_wallet
    3. check_balance
    4. list_wallets
  2. Usage
    1. With Claude Desktop
    2. Configuration
    3. Programmatically (custom MCP client)
  3. Installation
    1. Example
      1. Example Commands
        1. Security Considerations
          ID: xx2sxvy29l