Alpaca MCP Server

Servidor MCP de Alpaca

Exponer Alpaca Market Data & Broker API como herramientas MCP.

Instalación

npm install alpaca-mcp

Desarrollo local

git clone <repo-url> cd alpaca-mcp npm install

Variables de entorno

Cree un .env en la raíz del proyecto con:

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

Comandos

  • inicio (dev): npm start (ejecuta npx tsx index.ts )
  • compilación : npm run build (compila en dist/ )
  • ejecutar compilado : node dist/index.js

Uso

Una vez en ejecución, el servidor MCP escucha en la entrada/salida estándar. Utilice cualquier cliente MCP o la CLI:

npm link # optional alpaca-mcp # starts server globally

Herramientas disponibles

  • obtener-activos { assetClass?: "us_equity" | "crypto" }
  • get-stock-bars { symbols: string[]; start: string; end: string; timeframe: string }
  • obtener-días-de-mercado { start: string; end: string }
  • obtener-noticias { start: string; end: string; symbols: string[] }

Cada uno devuelve JSON en content[0].text o un error.

Configuración del cliente MCP

Para integrar a través de mcp.config.json , agregue lo siguiente bajo la clave 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": "<YOUR_API_KEY>", "ALPACA_SECRET_KEY": "<YOUR_SECRET_KEY>" } } } } ## Publishing ```bash npm publish

Licencia

ISC

-
security - not tested
-
license - not tested
-
quality - not tested

Servidor MCP que expone Alpaca Market Data & Broker API como herramientas, lo que permite el acceso a datos financieros como barras de acciones, activos, días de mercado y noticias a través del Protocolo de Control de Mensajes.

  1. Installation
    1. Local Development
      1. Environment Variables
        1. Commands
          1. Usage
            1. Available Tools
          2. MCP Client Configuration
            1. License
              ID: k8u0hj5os7