羊驼交易 MCP 服务器
模型上下文协议 (MCP) 服务器提供 Alpaca 交易 API 的接口,允许您管理股票和加密货币投资组合、进行交易和访问市场数据。
特征
账户管理:查看账户详情、余额和投资组合状态
交易:下达市价单、限价单、止损单和止损限价单
投资组合管理:查看仓位、计算业绩、平仓
市场数据:获取实时报价和历史价格数据
资产信息:获取可交易资产的详细信息
安装
克隆此存储库
安装依赖项:
或者使用 uv:
配置
将
.env.example
文件复制到.env
:
将您的 Alpaca Paper Trading API 凭证添加到
.env
文件:
您可以通过在Alpaca创建帐户来获取这些凭证。
用法
运行 MCP 服务器:
服务器将启动并可供 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
- 获取投资组合的综合摘要
This server cannot be installed
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 接口的模型上下文协议服务器,允许用户通过自然语言交互来管理投资组合、进行交易和访问市场数据。
Related MCP Servers
- AsecurityAlicenseAqualityA 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 -73MIT License
- -securityAlicense-qualityA 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 -25MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables interaction with the Tradovate API for managing trading contracts, positions, orders, and accounts.Last updated -1MIT License
- -securityAlicense-qualityA 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 -3MIT License