MCP Catalogs
首页

alpaca-mcp-server

by alpacahq·736·综合分 53

Alpaca 官方 MCP 服务器允许通过 AI 助手自然语言交易股票、ETF、加密货币和期权。

financedeveloper-toolsai-llm
225
Forks
22
活跃 Issue
1 个月前
最近提交
2 天前
收录于

概述

Alpaca MCP Server v2 是使用 FastMCP 和 OpenAPI 构建的 Model Context Protocol 的全面实现,通过自然语言界面提供对 Alpaca Trading API 的访问。它支持交易操作、市场数据访问、投资组合管理和策略开发,可直接通过 Claude、Cursor 和 VS Code 等 LLM 工具使用。该服务器支持多种资产类别,包括股票、期权和加密货币交易,并提供实时市场数据和各种订单类型。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:通过 AI 助手中的自然语言命令自动化股票和加密货币交易
:使用由 LLM 提供支持的构建和测试投资策略
:直接在开发环境中访问实时市场数据和投资组合信息
:与 v1 版本向后兼容吗?
:如何限制可用的交易工具?

什么时候选它

当您需要通过 LLM 工具直接进行 AI 驱动的交易,并获取股票、加密货币和期权的全面市场数据时选择此方案。

什么时候不要选它

不适合需要多经纪商支持或要求比基本订单类型更复杂算法交易工具的用户。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • get_account_info

    Get account information, balances, and buying power

  • get_positions

    View current positions in the account

  • place_order

    Place market, limit, stop, or stop-limit orders

  • cancel_order

    Cancel one or more open orders

  • liquidate_position

    Close or liquidate positions

  • get_crypto_quotes

    Get current quotes for cryptocurrencies

  • get_option_chain

    Get available option contracts for a symbol

  • get_option_quote

    Get latest quote for a specific option contract

  • place_option_order

    Place orders for option contracts

  • get_market_status

    Check market status and trading hours

  • get_watchlists

    Retrieve and manage watchlists

  • get_stock_data

    Get historical bars, quotes, and trades for stocks

可对比工具

polygon-mcpbinance-mcptraditional-trading-api

安装

安装

先决条件

  • Python 3.10+
  • uv
  • Alpaca Trading API 密钥
  • MCP 客户端(Claude Desktop、Cursor、VS Code 等)

设置(Claude Desktop)

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": ["alpaca-mcp-server"],
      "env": {
        "ALPACA_API_KEY": "your_alpaca_api_key",
        "ALPACA_SECRET_KEY": "your_alpaca_secret_key"
      }
    }
  }
}

设置(Cursor)

添加到 ~/.cursor/mcp.json

{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": ["alpaca-mcp-server"],
      "env": {
        "ALPACA_API_KEY": "your_alpaca_api_key",
        "ALPACA_SECRET_KEY": "your_alpaca_secret_key"
      }
    }
  }
}

FAQ

与 v1 版本向后兼容吗?
不兼容,v2 是完全重写的,具有不同的工具名称、参数和配置方法。请参阅升级指南获取迁移说明。
如何限制可用的交易工具?
使用 ALPACA_TOOLSETS 环境变量指定要启用的工具集(例如,'stock-data,crypto-data')。

Hacker News 讨论

开发者社区最近的相关讨论。

alpaca-mcp-server 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。