Serveur MCP Alpaca
Expose les données de marché et l'API du courtier Alpaca en tant qu'outils MCP.
Installation
Installation via Smithery
Pour installer Alpaca Market Data Server pour Claude Desktop automatiquement via Smithery:
npx -y @smithery/cli install @cesarvarela/alpaca-mcp --client claude
Installation manuelle
npm install alpaca-mcp
Développement local
git clone <repo-url> cd alpaca-mcp npm install
Variables d'environnement
Créez un fichier .env à la racine du projet avec :
ALPACA_ENDPOINT=https://data.alpaca.markets ALPACA_BROKER_ENDPOINT=https://broker-api.alpaca.markets ALPACA_API_KEY=VOTRE_ALPACA_API_KEY ALPACA_SECRET_KEY=VOTRE_ALPACA_SECRET_KEY
Commandes
- start (dev) :
npm start(exécutenpx tsx index.ts) - build:
npm run build(compile dansdist/) - exécuter compilé:
node dist/index.js
Utilisation
Une fois lancé, le serveur MCP écoute sur stdin/stdout. Utilisez n'importe quel client MCP ou le CLI :
npm link # optional alpaca-mcp # démarre le serveur globalement
Outils disponibles
- 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[] }
Chacune renvoie du JSON dans content[0].text ou une erreur.
Configuration du client MCP
Pour l'intégration via mcp.config.json, ajoutez ce qui suit sous la clé 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" : "<VOTRE_CLÉ_API>", "ALPACA_SECRET_KEY" : "<YOUR_SECRET_KEY>" } } } ## Publishing ```bash npm publish
Licence
ISC




