Skip to main content
Glama

XTBApiServer

by sharplygroup

XTBApiサーバー

これは@sharplygroup/xtb-api-jsライブラリを使用してXTB APIを公開するMCPサーバーです。これにより、モデルコンテキストプロトコルを介してXTB取引アカウントとやり取りできるようになります。

前提条件

  • Node.js (バージョン 16 以上)
  • npm
  • XTB取引口座

インストール

  1. このリポジトリをクローンします: git clone [repository_url]
  2. プロジェクトディレクトリに移動します: cd xtb-mcp-server
  3. 依存関係をインストール: npm install

構成

  1. プロジェクト ディレクトリに.envファイルを作成し、XTB API 資格情報を追加します。
DEMO_ACCOUNT=true USER_ID=your_user_id PASSWORD=your_password

注: your_user_idyour_passwordを実際の XTB API 認証情報に置き換えてください。ライブアカウントを使用している場合は、 DEMO_ACCOUNT falseに設定してください。

サーバーの実行

  1. TypeScriptコードをビルドします: npm run build
  2. サーバーを実行します: node build/index.js

MCPクライアントとの接続

MCP Inspector などの任意の MCP クライアントを使用してこのサーバーに接続できます。

  1. MCP インスペクターをグローバルにインストールします: npm install -g @modelcontextprotocol/inspector
  2. サーバーで MCP インスペクターを実行します: npx @modelcontextprotocol/inspector node build/index.js
  3. MCP Inspector UI で、トランスポート タイプとして「stdio」を選択し、「接続」をクリックします。

利用可能なツール

この MCP サーバーでは次のツールが公開されます。

アカウント操作

  • getCurrentUserData : アカウント通貨とアカウントレバレッジに関する情報を返します。
  • getMarginLevel : さまざまなアカウントインジケーターを返します。

計算操作

  • getCommissionDef : 手数料と為替レートの計算を返します。
    • パラメータ: symbol (文字列)、 volume (数値)
  • getMarginTrade : 指定された銘柄と数量の予想マージンを返します。
    • パラメータ: symbol (文字列)、 volume (数値)
  • getProfitCalculation : 指定された取引データの推定利益を計算します。
    • パラメータ: closePrice (数値)、 cmd (数値)、 openPrice (数値)、 symbol (文字列)、 volume (数値)

市場データ運用

  • getCalendar : 市場イベントを含むカレンダーを返します。
  • getChartLastRequest : 開始日から現在の時刻までのチャート情報を返します。
    • パラメータ: info (任意)
  • getChartRangeRequest : 指定された開始日と終了日の間のデータを含むチャート情報を返します。
    • パラメータ: info (任意)
  • getTickPrices : 指定されたシンボルの現在の相場の配列を返します。指定されたタイムスタンプから変更された相場のみが返されます。
    • パラメータ: level (数値)、 symbols (文字列[])、 timestamp (数値)
  • getTradingHours : 相場と取引時間を返します。
    • パラメータ: symbols (文字列[])

ニュースオペレーション

  • getNews : 指定された期間内に送信された取引サーバーからのニュースを返します。
    • パラメータ: end (数値)、 start (数値)

サーバー操作

  • getServerTime : 取引サーバーの現在の時刻を返します。
  • getVersion : 現在の API バージョンを返します。
  • ping : この関数を定期的に呼び出すだけで、システム内のすべてのコンポーネントの内部状態を更新できます。

シンボル操作

  • getAllSymbols : ユーザーが使用できるすべてのシンボルの配列を返します。
  • getSymbol : ユーザーが使用できるシンボルに関する情報を返します。
    • パラメータ: symbol (文字列)

貿易業務

  • getTrades : ユーザーの取引の配列を返します。
    • パラメータ: openedOnly (ブール値)
  • getTradeRecords : orders引数にリストされている取引の配列を返します。
    • パラメータ: orders数(number[])
  • getTradesHistory : 指定された期間内に終了したユーザーの取引の配列を返します。
    • パラメータ: end (数値)、 start (数値)
  • getTradeStatus : 現在のトランザクションステータスを返します。
    • パラメータ: order (数値)

取引業務

  • tradeTransaction : 取引トランザクションを開始します。
    • パラメータ: tradeTransInfo (任意)
  • tradeTransactionStatus : 現在のトランザクションのステータスを返します。
    • パラメータ: order (数値)

コマンド実行

  • executeCommand : サーバー上でコマンドを実行します。
    • パラメータ: command (文字列)

プロンプト

次のプロンプトが利用可能です:

  • getAccountDataPrompt : 現在のアカウントデータを取得します。
  • getSymbolInfoPrompt : 特定のシンボルに関する情報を取得します。
    • パラメータ: symbol (文字列)

免責事項

このMCPサーバーはサンプルとして提供されており、自己責任でご利用ください。ライブ取引口座でこのサーバーをご利用になる前に、XTB APIとそれに伴う潜在的なリスクについて十分にご理解ください。

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

XTB 取引 API を公開する MCP サーバー。ユーザーはモデル コンテキスト プロトコルを通じて XTB 取引アカウントと対話し、アカウント管理、市場データの取得、取引の実行などの操作を実行できます。

  1. 前提条件
    1. インストール
      1. 構成
        1. サーバーの実行
          1. MCPクライアントとの接続
            1. 利用可能なツール
              1. アカウント操作
              2. 計算操作
              3. 市場データ運用
              4. ニュースオペレーション
              5. サーバー操作
              6. シンボル操作
              7. 貿易業務
              8. 取引業務
              9. コマンド実行
            2. プロンプト
              1. 免責事項

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol (MCP) server that provides real-time access to financial market data through the free Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes and company information.
                  Last updated -
                  5
                  30
                  Python
                  MIT License
                  • Apple
                • A
                  security
                  F
                  license
                  A
                  quality
                  An MCP server that allows users to interact with YNAB data, enabling access to account balances, transactions, and the creation of new transactions through the Model Context Protocol.
                  Last updated -
                  10
                  1
                  Python
                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server that integrates the XTQuant quantitative trading platform with AI assistants, allowing AI to directly access and operate on trading data and functionality.
                  Last updated -
                  8
                  30
                  Python
                  MIT License
                  • Apple
                • A
                  security
                  F
                  license
                  A
                  quality
                  An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
                  Last updated -
                  39
                  28
                  • Apple

                View all related MCP servers

                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/sharplygroup/xtb-mcp-server'

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