Skip to main content
Glama
tedlikeskix

Alpaca MCP Server

by tedlikeskix

アルパカ MCP サーバー

これはAlpaca用のモデルコンテキストプロトコル(MCP)サーバーであり、ClaudeのようなLLMがAlpaca取引APIを利用できるようにします。これにより、株式取引、ポジションの確認、市場データの取得、アカウント管理など、すべて自然言語で行うことができます。

特徴

  • 📊市場データ- リアルタイムの株価と過去の価格データを入手

  • 💵アカウント情報- 残高、購入力、ステータスを確認します

  • 📈ポジション管理- 現在のポジションとそのパフォーマンスを表示します

  • 🛒注文の配置- 自然言語で成行注文と指値注文を配置

  • 📋注文管理- 注文の一覧表示、追跡、キャンセル

Related MCP server: Alpaca MCP Server

前提条件

  • Python 3.10以上

  • アルパカAPIキー

  • Claude for Desktop または他の MCP クライアント

インストール

  1. このリポジトリをクローンします:

    git clone https://github.com/YOUR_USERNAME/alpaca-mcp.git
    cd alpaca-mcp
  2. 必要なパッケージをインストールします。

    pip install mcp alpaca-py python-dotenv
  3. Alpaca API 資格情報を使用して.envファイルを作成します。

    API_KEY_ID=your_alpaca_api_key
    API_SECRET_KEY=your_alpaca_secret_key

使用法

サーバーの実行

次のコマンドを実行してサーバーを起動します。

python alpaca_mcp_server.py

デスクトップ版Claudeの設定

  1. デスクトップ版Claudeを開く

  2. 設定に移動

  3. 「開発者」をクリックし、「設定の編集」をクリックします

  4. claude_desktop_config.jsonにサーバー構成を追加します。

{
  "mcpServers": {
    "alpaca": {
      "command": "python",
      "args": [
        "/path/to/alpaca_mcp_server.py"
      ],
      "env": {
        "API_KEY_ID": "your_alpaca_api_key",
        "API_SECRET_KEY": "your_alpaca_secret_key"
      }
    }
  }
}
  1. 保存してClaude for Desktopを再起動します

利用可能なツール

サーバーは次のツールを公開します。

  • get_account_info() - アカウントの残高とステータスを取得する

  • get_positions() - ポートフォリオ内の現在のポジションをすべて一覧表示する

  • get_stock_quote(symbol) - 株式の最新の株価を取得する

  • get_stock_bars(symbol, days) - 株式の過去の価格バーを取得する

  • get_orders(status, limit) - 指定されたステータスの注文を一覧表示する

  • place_market_order(symbol, side, quantity) - 成行注文を出す

  • place_limit_order(symbol, side, quantity, limit_price) - 指値注文を出す

  • cancel_all_orders() - すべてのオープン注文をキャンセルする

  • close_all_positions(cancel_orders) - すべてのオープンポジションをクローズする

クエリの例

サーバーが Claude に接続されると、次のような質問をすることができます。

  • 「現在の口座残高と購買力はいくらですか?」

  • 「現在のポジションを表示」

  • 「AAPLの最新の相場情報を入手する」

  • 「過去10日間のTSLAの価格履歴を表示してください」

  • 「市場価格でMSFT株5株を買う」

  • 「AMZN株10株を130ドルの指値で売る」

  • 「すべてのオープン注文をキャンセルする」

注記

このサーバーはデフォルトでAlpacaのペーパートレードを使用します。リアルマネートレードを使用するには、 TradingClient初期化でpaper=Truepaper=Falseに変更してください。

セキュリティに関するお知らせ

このMCPサーバーはあなたのAlpacaアカウントにアクセスし、実際の取引を行うことができます。取引を承認する前に、必ずClaudeの提案を確認してください。

ライセンス

マサチューセッツ工科大学

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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
    B
    maintenance
    A server that implements the Model Context Protocol for Schwab API, allowing access to account information, positions, stock quotes, and order/transaction history designed for integration with Large Language Models.
    58
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    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.
    3
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that interfaces with Alpaca trading API, allowing users to manage portfolios, place trades, and access market data through natural language interactions.
    8
    36
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server implementation for Alpaca's Trading API that enables LLMs to interact with Alpaca's trading infrastructure using natural language, supporting stock, options, and crypto trading, portfolio management, watchlists, and market data.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

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

  • A Model Context Protocol server for Wix AI tools

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

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