View as Markdown

Alpaca Integration

Trade US equities and crypto with Alpaca: account, orders, positions, clock, and assets

The Alpaca integration provides access to trade US equities and crypto with Alpaca: account, orders, positions, clock, and assets through the Integrate MCP server.

Installation

The Alpaca integration is included with the SDK:

import { alpacaIntegration } from "integrate-sdk/server";

Setup

Add Alpaca to your server configuration. Provide credentials via environment variables or integration config:

import { createMCPServer, alpacaIntegration } from "integrate-sdk/server";
 
export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    alpacaIntegration({
      // See configuration options below
    }),
  ],
});

Client-Side Usage

import { client } from "integrate-sdk";
 
const result = await client.alpaca.getAccount({});
 
console.log(result);

Environment Variables

  • ALPACA_API_KEY (when supported by this integration)

Configuration Options

export interface AlpacaIntegrationOptions {
  /** Alpaca API key ID (defaults to ALPACA_API_KEY_ID) */
  apiKeyId?: string;

Tools

alpaca_get_account

Get account

No parameters.

alpaca_list_positions

List positions

No parameters.

alpaca_get_position

Get position

export interface AlpacaGetPositionParams { symbol: string }

alpaca_list_orders

List orders

export interface AlpacaListOrdersParams {
    status?: string;

alpaca_get_order

Get order

export interface AlpacaGetOrderParams { order_id: string;

alpaca_create_order

Create order

export interface AlpacaCreateOrderParams {
    symbol: string;

alpaca_cancel_order

Cancel order

export interface AlpacaCancelOrderParams { order_id: string }

alpaca_cancel_all_orders

Cancel all orders

export interface AlpacaCancelAllOrdersParams { symbols?: string }

alpaca_get_clock

Get clock

No parameters.

alpaca_get_calendar

Get calendar

export interface AlpacaGetCalendarParams { start: string;

alpaca_list_assets

List assets

export interface AlpacaListAssetsParams { status?: string;

alpaca_get_asset

Get asset

export interface AlpacaGetAssetParams { symbol_or_id: string }

alpaca_get_portfolio_history

Get portfolio history

export interface AlpacaGetPortfolioHistoryParams {
    period?: string;

Notes

  • Category: Finance
  • Authentication mode: API key