Skip to main content
Glama
sharplygroup

XTBApiServer

by sharplygroup

XTBApiサーバー

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

前提条件

  • Node.js (バージョン 16 以上)

  • npm

  • XTB取引口座

Related MCP server: xrpl-mcp-service

インストール

  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とそれに伴う潜在的なリスクについて十分にご理解ください。

-
license - not tested
Not graded
quality - not tested
Not graded
maintenance - not tested

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.
    11
    3
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server providing comprehensive access to the XRP Ledger (XRPL). This service enables AI models to interact with XRPL through standardized endpoints.
    4
  • A
    license
    B
    quality
    C
    maintenance
    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.
    8
    156
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

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

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