X

alpaca-mcp

Information

Alpaca MCP Server 将Alpaca市场数据和经纪商API作为MCP工具暴露。 安装 npm install alpaca-mcp 本地开发 git clone cd alpaca-mcp npm install 环境变量 在项目根目录下创建一个.env文件,内容如下: ALPACA_ENDPOINT=https://data.alpaca.markets ALPACA_BROKER_ENDPOINT=https://broker-api.alpaca.markets ALPACA_API_KEY=YOUR_ALPACA_API_KEY ALPACA_SECRET_KEY=YOUR_ALPACA_SECRET_KEY 命令 启动 (开发模式): npm start (运行 npx tsx index.ts) 构建: npm run build (编译到 dist/) 运行编译后的代码: node dist/index.js 使用方法 一旦运行起来,MCP服务器会监听标准输入/输出。可以使用任何MCP客户端或CLI来与之交互: npm link # optional alpaca-mcp # starts server globally 可用工具 get-assets \{ assetClass?: "us_equity" | "crypto" \} get-stock-bars \{ symbols: string[]; start: string; end: string; timeframe: string \} get-market-days \{ start: string; end: string \} get-news \{ start: string; end: string; symbols: string[] \} 每个命令返回的JSON位于content[0].text中,或者返回错误信息。 MCP客户端配置 要通过mcp.config.json集成,请在mcpServers键下添加以下内容: \{ "mcpServers": \{ "alpaca-mcp": \{ "command": "npx", "args": [ "-y", "alpaca-mcp" ], "env": \{ "ALPACA_ENDPOINT": "https://data.alpaca.markets", "ALPACA_BROKER_ENDPOINT": "https://broker-api.alpaca.markets", "ALPACA_API_KEY": "", "ALPACA_SECRET_KEY": "" \} \} \} \} ## Publishing \`\`\`bash npm publish 许可证 ISC

Prompts

Reviews

Tags

Write Your Review

Detailed Ratings

ALL
Correctness
Helpfulness
Interesting
Upload Pictures and Videos

Name
Size
Type
Download
Last Modified
  • Community

Add Discussion

Upload Pictures and Videos