Skip to main content
Glama

Alpaca Trading MCP Server

by laukikk
MIT License
22
  • Apple

アルパカトレーディングMCPサーバー

Alpaca 取引 API へのインターフェイスを提供するモデル コンテキスト プロトコル (MCP) サーバー。これにより、株式および暗号通貨ポートフォリオの管理、取引の実行、市場データへのアクセスが可能になります。

特徴

  • アカウント管理: アカウントの詳細、残高、ポートフォリオのステータスを表示します
  • 取引:成行注文、指値注文、逆指値注文、ストップリミット注文を出す
  • ポートフォリオ管理: ポジションの表示、パフォーマンスの計算、ポジションのクローズ
  • 市場データ: リアルタイムの相場情報と過去の価格データにアクセス
  • 資産情報: 取引可能な資産の詳細を取得します

インストール

  1. このリポジトリをクローンする
  2. 依存関係をインストールします:
pip install -e .

またはuvを使用します:

uv pip install -e .

構成

  1. .env.exampleファイルを.envにコピーします。
cp .env.example .env
  1. Alpaca Paper Trading API の資格情報を.envファイルに追加します。
ALPACA_PAPER_API_KEY = "your-api-key" ALPACA_PAPER_API_SECRET = "your-api-secret"

Alpacaでアカウントを作成すると、これらの資格情報を取得できます。

使用法

MCP サーバーを実行します。

python src/server.py

サーバーが起動し、MCP クライアントが接続できるようになります。

利用可能なリソース

サーバーは次のリソースを提供します。

  • account://info - 現在のアカウント情報を取得する
  • positions://all - 現在のポジションをすべて取得する
  • positions://{symbol} - 特定のシンボルのポジション詳細を取得します
  • orders://recent/{limit} - 指定された制限内で最新の注文を取得します
  • market://{symbol}/quote - 特定のシンボルの現在の市場相場を取得します
  • market://{symbol}/bars/{timeframe} - 指定した時間枠のシンボルの過去の価格バーを取得します。
  • assets://list - Alpaca で取引可能な資産をリストします
  • assets://{symbol} - シンボルで詳細な資産情報を取得します

利用可能なツール

サーバーは次のツールを提供します。

  • get_account_info_tool - 現在のアカウント情報を取得する
  • place_market_order - 株式の売買の成行注文を出す
  • place_limit_order - 指定した価格で株式を売買するための指値注文を出す
  • place_stop_order - 指定された価格に達したときに株を買ったり売ったりするストップ注文を出す
  • place_stop_limit_order - ストップ注文とリミット注文の機能を組み合わせたストップリミット注文を出す
  • cancel_order - ID でオープン注文をキャンセルする
  • close_position - 特定のシンボルのオープンポジションをクローズする
  • get_portfolio_summary - ポートフォリオの包括的な概要を取得します
-
security - not tested
A
license - permissive license
-
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.

Alpaca 取引 API とインターフェイスするモデル コンテキスト プロトコル サーバー。これにより、ユーザーは自然言語による対話を通じてポートフォリオを管理し、取引を行い、市場データにアクセスできるようになります。

  1. 特徴
    1. インストール
      1. 構成
        1. 使用法
          1. 利用可能なリソース
            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
                64
                Python
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server enabling LLMs like Claude to interact with the Alpaca trading API through natural language for stock trading, checking positions, fetching market data, and managing your account.
                Last updated -
                23
                Python
                MIT License
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables interaction with the Tradovate API for managing trading contracts, positions, orders, and accounts.
                Last updated -
                1
                JavaScript
                MIT License
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables LLMs like Claude to interact with the Alpaca trading API, allowing for trading stocks, checking positions, fetching market data, and managing accounts through natural language.
                Last updated -
                3
                Python
                MIT License

              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/laukikk/alpaca-mcp'

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