能力标签
🔌
MCP工具

阿尔帕卡MCP服务器

基于 Python · 让 AI 助手直接操作你的系统与工具
英文名:alpaca-mcp-server
⭐ 842 Stars 🍴 248 Forks 💻 Python 📄 MIT 🏷 AI 8.0分
8.0AI 综合评分
ai-tradingalgorithmic-tradingcryptoetfsmcppython
✦ AI Skill Hub 推荐

AI Skill Hub 强烈推荐:阿尔帕卡MCP服务器 是一款优质的MCP工具。AI 综合评分 8.0 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。

📚 深度解析

阿尔帕卡MCP服务器 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 阿尔帕卡MCP服务器,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。阿尔帕卡MCP服务器 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 阿尔帕卡MCP服务器 评为 AI 评分 8.0 分,属于同类工具中的优质选择。

📋 工具概览

阿尔帕卡MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 842
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
MIT
AI 综合评分
8.0 分
工具类型
MCP工具
Forks
248

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

阿尔帕卡MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/alpacahq/alpaca-mcp-server

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "----mcp---": {
      "command": "npx",
      "args": ["-y", "alpaca-mcp-server"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 阿尔帕卡MCP服务器 执行以下任务...
Claude: [自动调用 阿尔帕卡MCP服务器 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "____mcp___": {
      "command": "npx",
      "args": ["-y", "alpaca-mcp-server"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 95/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

<p align="center"> <img src="https://raw.githubusercontent.com/alpacahq/alpaca-mcp-server/main/assets/01-primary-alpaca-logo.png" alt="Alpaca logo" width="220"> </p>

<a href="https://x.com/alpacahq?lang=en" target="_blank"><img src="https://img.shields.io/badge/X-DCDCDC?logo=x&logoColor=000" alt="X"></a> <a href="https://www.reddit.com/r/alpacamarkets/" target="_blank"><img src="https://img.shields.io/badge/Reddit-DCDCDC?logo=reddit&logoColor=000" alt="Reddit"></a> <a href="https://alpaca.markets/slack" target="_blank"><img src="https://img.shields.io/badge/Slack-DCDCDC?logo=slack&logoColor=000" alt="Slack"></a> <a href="https://www.linkedin.com/company/alpacamarkets/" target="_blank"><img src="https://img.shields.io/badge/LinkedIn-DCDCDC" alt="LinkedIn"></a> <a href="https://forum.alpaca.markets/" target="_blank"><img src="https://img.shields.io/badge/Forum-DCDCDC?logo=discourse&logoColor=000" alt="Forum"></a> <a href="https://docs.alpaca.markets/docs/getting-started" target="_blank"><img src="https://img.shields.io/badge/Docs-DCDCDC" alt="Docs"></a> <a href="https://alpaca.markets/sdks/python/" target="_blank"><img src="https://img.shields.io/badge/Python_SDK-DCDCDC?logo=python&logoColor=000" alt="Python SDK"></a>

</div>

<p align="center"> A comprehensive Model Context Protocol (MCP) server for Alpaca's Trading API. Enable natural language trading operations through AI assistants like Claude, Cursor, and VS Code. Supports stocks, options, crypto, portfolio management, and real-time market data. </p>

Alpaca MCP Server v2 is here. This version is a complete rewrite built with FastMCP and OpenAPI. If you're upgrading from v1, please read the Upgrade Guide — tool names, parameters, and configuration have changed.

Features

  • Market Data — Real-time quotes, trades, and price bars for stocks, crypto, and options. Historical data with flexible timeframes. Option Greeks and implied volatility.
  • Account Management — View balances, buying power, account status, and portfolio history.
  • Order Management — Place market, limit, stop, stop-limit, and trailing-stop orders for stocks, crypto, and options. Cancel orders individually or in bulk.
  • Options Trading — Search contracts by expiration/strike/type. Place single-leg or multi-leg strategies. Get latest quotes, Greeks, and IV.
  • Crypto Trading — Market, limit, and stop-limit orders with GTC/IOC. Quantity or notional-based.
  • Position Management — View, close, or liquidate positions. Exercise option contracts.
  • News — News articles filterable by ticker and date range.
  • Market Status — Market open/close times, calendar, corporate actions.
  • Watchlists — Create, update, and manage watchlists.
  • Asset Search — Query details for stocks, ETFs, crypto, and options with filtering.

Prerequisites

Integration tests (requires paper API keys)

ALPACA_API_KEY=... ALPACA_SECRET_KEY=... pytest tests/ -m integration -v ```

Setup

Add the server to your MCP client config, then restart the client. No init command, no .env files — credentials are set in one place only.

How to avoid V1-style usage in V2

MCP clients discover tools dynamically from the server. There is no config file where you "whitelist" tool names — the client gets whatever tools the server exposes. To avoid your client or AI assistant using V2 incorrectly:

  1. Do not reuse V1 config — Treat V2 as a new server. Update your MCP client config with the new command/args; remove any .env or init-based setup.
  2. Clear tool caches — Restart your MCP client (Claude Desktop, Cursor, VS Code, etc.) after switching so it fetches the new tool list instead of using a stale one.
  3. Start a fresh chat/session — Existing conversations may have cached references to old tool names. Start a new chat so the LLM sees the current V2 tools and their schemas.
  4. Update custom instructions and rules — If you have Cursor rules, Claude instructions, or other prompts that mention specific V1 tool names (e.g. "use get_account_info"), update them to match V2 tool names or remove those references and let the LLM discover tools from context.
  5. Restrict tools with ALPACA_TOOLSETS — If you previously limited which capabilities your assistant could use, V2 supports server-side filtering via the ALPACA_TOOLSETS env var. See Configuration > Toolset Filtering for the list of toolsets.

Example Prompts

Basic Trading

  1. What's my current account balance and buying power on Alpaca?
  2. Show me my current positions in my Alpaca account.
  3. Buy 5 shares of AAPL at market price.
  4. Sell 5 shares of TSLA with a limit price of $300.
  5. Cancel all open stock orders.
  6. Cancel the order with ID abc123.
  7. Liquidate my entire position in GOOGL.
  8. Close 10% of my position in NVDA.
  9. Place a limit order to buy 100 shares of MSFT at $450.
  10. Place a market order to sell 25 shares of META.

Crypto Trading

  1. Place a market order to buy 0.01 ETH/USD.
  2. Place a limit order to sell 0.01 BTC/USD at $110,000.

Option Trading

  1. Show me available option contracts for AAPL expiring next month.
  2. Get the latest quote for the AAPL250613C00200000 option.
  3. Retrieve the option snapshot for the SPY250627P00400000 option.
  4. Liquidate my position in 2 contracts of QQQ calls expiring next week.
  5. Place a market order to buy 1 call option on AAPL expiring next Friday.
  6. What are the option Greeks for the TSLA250620P00500000 option?
  7. Find TSLA option contracts with strike prices within 5% of the current market price.
  8. Get SPY call options expiring the week of June 16th, 2025, within 10% of market price.
  9. Place a bull call spread using AAPL June 6th options: one with a 190.00 strike and the other with a 200.00 strike.
  10. Exercise my NVDA call option contract NVDA250919C001680.

Market Information

To access the latest 15-minute data, you need to subscribe to the Algo Trader Plus Plan. 1. What are the market open and close times today? 2. Show me the market calendar for next week. 3. Show me recent cash dividends and stock splits for AAPL, MSFT, and GOOGL in the last 3 months. 4. Get all corporate actions for SPY including dividends, splits, and any mergers in the past year. 5. What are the upcoming corporate actions scheduled for SPY in the next 6 months?

Historical & Real-time Data

  1. Show me AAPL's daily price history for the last 5 trading days.
  2. What was the closing price of TSLA yesterday?
  3. Get the latest bar for GOOGL.
  4. What was the latest trade price for NVDA?
  5. Show me the most recent quote for MSFT.
  6. Retrieve the last 100 trades for AMD.
  7. Show me 1-minute bars for AMZN from the last 2 hours.
  8. Get 5-minute intraday bars for TSLA from last Tuesday through last Friday.
  9. Get a comprehensive stock snapshot for AAPL showing latest quote, trade, minute bar, daily bar, and previous daily bar all in one view.
  10. Compare market snapshots for TSLA, NVDA, and MSFT to analyze their current bid/ask spreads, latest trade prices, and daily performance.

Orders

  1. Show me all my open and filled orders from this week.
  2. What orders do I have for AAPL?
  3. List all limit orders I placed in the past 3 days.
  4. Filter all orders by status: filled.
  5. Get me the order history for yesterday.

Watchlists

At this moment, you can only view and update trading watchlists created via Alpaca's Trading API through the API itself 1. Create a new watchlist called "Tech Stocks" with AAPL, MSFT, and NVDA. 2. Update my "Tech Stocks" watchlist to include TSLA and AMZN. 3. What stocks are in my "Dividend Picks" watchlist? 4. Remove META from my "Growth Portfolio" watchlist. 5. List all my existing watchlists.

Asset Information

  1. Search for details about the asset 'AAPL'.
  2. Show me the top 5 tradable crypto assets by trading volume.
  3. Get all NASDAQ active US equity assets and filter the results to show only tradable securities

Combined Scenarios

  1. Get today's market clock and show me my buying power before placing a limit buy order for TSLA at $340.
  2. Place a bull call spread with SPY July 3rd options: sell one 5% above and buy one 3% below the current SPY price.

Configuration

All configuration is through environment variables set in your MCP client config. No files are written to disk.

VariableRequiredDefaultDescription
ALPACA_API_KEYYesYour Alpaca API key
ALPACA_SECRET_KEYYesYour Alpaca secret key
ALPACA_PAPER_TRADENotrueSet to false for live trading
ALPACA_TOOLSETSNoallComma-separated list of toolsets to enable

Getting Your API Keys

  1. Visit the Alpaca Dashboard
  2. Create a free paper trading account
  3. Generate API keys from the dashboard

If you had custom V1 workflows

If you documented allowed tools, wrote scripts that call tools by name, or built prompts around specific V1 tool/parameter shapes — treat them as obsolete. Recreate them using the Available Tools listed below and the current parameter schemas exposed by the server.

VS Code

Create .vscode/mcp.json in your project root. See the official docs.

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

PyCharm

See the official guide.

1. Go to File → Settings → Tools → Model Context Protocol (MCP) 2. Add a new server: - Type: stdio - Command: uvx - Arguments: alpaca-mcp-server 3. Set environment variables:

   ALPACA_API_KEY=your_alpaca_api_key
   ALPACA_SECRET_KEY=your_alpaca_secret_key
  

Claude Code

claude mcp add alpaca --scope user --transport stdio uvx alpaca-mcp-server \
  --env ALPACA_API_KEY=your_alpaca_api_key \
  --env ALPACA_SECRET_KEY=your_alpaca_secret_key

Verify with /mcp in the Claude Code CLI.

Gemini CLI

See the Gemini CLI MCP docs.

Add to your settings.json:

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

Docker

git clone https://github.com/alpacahq/alpaca-mcp-server.git
cd alpaca-mcp-server
docker build -t mcp/alpaca:latest .

Add to your MCP client config:

{
  "mcpServers": {
    "alpaca": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "ALPACA_API_KEY=your_key",
        "-e", "ALPACA_SECRET_KEY=your_secret",
        "-e", "ALPACA_PAPER_TRADE=true",
        "mcp/alpaca:latest"
      ]
    }
  }
}

Troubleshooting

  • uv/uvx not found: Install uv from the official guide (https://docs.astral.sh/uv/getting-started/installation/) and then restart your terminal so uv/uvx are on PATH.
  • Credentials missing: Set ALPACA_API_KEY and ALPACA_SECRET_KEY in the client's env block. Paper mode default is ALPACA_PAPER_TRADE = True.
  • Client didn't pick up new config: Restart the client (Cursor, Claude Desktop, VS Code) after changes.
  • HTTP port conflicts: If using --transport streamable-http, change --port to a free port.
🎯 aiskill88 AI 点评 A 级 2026-06-24

高质量的开源MCP工具,支持多种交易类型

⚡ 核心功能

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

请参考官方文档和示例代码
💡 AI Skill Hub 点评

总体来看,阿尔帕卡MCP服务器 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 阿尔帕卡MCP服务器
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 alpaca-mcp-server
Topics ai-tradingalgorithmic-tradingcryptoetfsmcppython
GitHub https://github.com/alpacahq/alpaca-mcp-server
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/alpacahq/alpaca-mcp-server 🌐 官方网站  https://alpaca.markets/algotrading

收录时间:2026-06-24 · 更新时间:2026-06-24 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →