Skip to main content
Glama

Alpaca MCP Server

Alpaca MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with the Alpaca Trading API.

Features

This MCP server provides the following tools:

  • get_account - Get account information and buying power
  • list_positions - List all current positions
  • list_orders - List orders with optional status filter
  • place_order - Place a new order (market/limit/stop/stop_limit)
  • cancel_order - Cancel an existing order
  • get_asset - Get information about a specific asset
  • get_latest_trade - Get latest trade for a symbol
  • get_latest_quote - Get latest quote for a symbol
  • get_bars - Get historical price bars

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
  3. Build the server:
    npm run build

Configuration

The server requires the following environment variables:

  • ALPACA_API_KEY - Your Alpaca API key
  • ALPACA_SECRET_KEY - Your Alpaca secret key
  • ALPACA_BASE_URL - API base URL (optional, defaults to paper trading URL)

MCP Settings Configuration

Add the following to your MCP settings file:

{ "mcpServers": { "alpaca": { "command": "node", "args": ["/path/to/alpaca-server/build/index.js"], "env": { "ALPACA_API_KEY": "your-api-key", "ALPACA_SECRET_KEY": "your-secret-key", "ALPACA_BASE_URL": "https://paper-api.alpaca.markets" } } } }

Usage Examples

Get Account Information

{ "tool": "get_account", "arguments": {} }

Place a Market Order

{ "tool": "place_order", "arguments": { "symbol": "AAPL", "qty": 10, "side": "buy", "type": "market" } }

Get Latest Quote

{ "tool": "get_latest_quote", "arguments": { "symbol": "AAPL" } }

Development

  • Run in watch mode: npm run watch
  • Run tests: npm test
  • Lint code: npm run lint

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Provides tools for interacting with the Alpaca Trading API, enabling trading operations like getting account information, placing/canceling orders, listing positions, and accessing market data.

  1. Features
    1. Installation
      1. Configuration
        1. MCP Settings Configuration
      2. Usage Examples
        1. Get Account Information
        2. Place a Market Order
        3. Get Latest Quote
      3. Development
        1. License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Facilitates interaction with Ethereum blockchain data via Etherscan's API, providing real-time access to balances, transactions, token transfers, contract ABIs, gas prices, and ENS name resolutions.
            Last updated -
            6
            3
            13
            TypeScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server enabling LLMs like Claude to interact with the Alpaca trading API through natural language for stock trading, checking positions, fetching market data, and managing your account.
            Last updated -
            Python
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables interaction with the Tradovate API for managing trading contracts, positions, orders, and accounts.
            Last updated -
            JavaScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables LLMs like Claude to interact with the Alpaca trading API, allowing for trading stocks, checking positions, fetching market data, and managing accounts through natural language.
            Last updated -
            Python
            MIT License

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/jwaresolutions/alpaca-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server