Alpaca Trading MCP Server

Alpaca Trading MCP Server

MCP server interface for real-time stock and crypto trading via Alpaca.

33
Stars
11
Forks
33
Watchers
2
Issues
Alpaca Trading MCP Server provides a Model Context Protocol (MCP) compliant server that acts as an interface to the Alpaca trading API. It enables users to manage portfolios, place trades, access real-time and historical market data, and handle account information programmatically. The server exposes standardized resources and tools for account management, trading, asset information, and market analytics, offering integration with MCP clients such as Claude Desktop.

Key Features

Account management for balances and portfolio details
Place market, limit, stop, and stop-limit orders
Portfolio summary and position tracking
Access real-time quotes and historical pricing
Asset information retrieval
Order cancellation and management
Integration with Claude Desktop via Smithery
Configurable API credentials via environment files
Comprehensive toolset for trading operations
Standardized MCP resources endpoint structure

Use Cases

Automating portfolio tracking and reporting
Programmatically executing stock and crypto trades
Retrieving and analyzing live financial market data
Configuring trading bots for asset management with Alpaca
Integrating MCP financial tools into AI applications
Managing account balances and positions in real-time
Researching tradable asset details for investment decisions
Cancelling open orders efficiently via API
Monitoring historical price movements for specific symbols
Providing clean interfaces for AI or agentic clients to interact with financial APIs

README

Alpaca Trading MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides an interface to the Alpaca trading API, allowing you to manage your stock and crypto portfolio, place trades, and access market data.

Features

  • Account Management: View account details, balances, and portfolio status
  • Trading: Place market, limit, stop, and stop-limit orders
  • Portfolio Management: View positions, calculate performance, and close positions
  • Market Data: Access real-time quotes and historical price data
  • Asset Information: Get details about tradable assets

Installation

Installing via Smithery

To install Alpaca Trading MCP Server for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @laukikk/alpaca-mcp --client claude

Manual Installation

  1. Clone this repository
  2. Install dependencies:
bash
pip install -e .

Or using uv:

bash
uv pip install -e .

Configuration

  1. Copy the .env.example file to .env:
bash
cp .env.example .env
  1. Add your Alpaca Paper Trading API credentials to the .env file:
ALPACA_PAPER_API_KEY = "your-api-key"
ALPACA_PAPER_API_SECRET = "your-api-secret"

You can obtain these credentials by creating an account at Alpaca.

Usage

Run the MCP server:

bash
python src/server.py

The server will start and be available for MCP clients to connect to.

Testing with Claude for Desktop

Configuration:

Open your Claude for Desktop App configuration in a text editor. Create the file if it doesn't exist.

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application\ Support/Claude/claude_desktop_config.json

Add the Alpaca MCP server configuration:

json
{
    "mcpServers": {
        "alpaca": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/alpaca-mcp-server",
                "run",
                "src/server.py"
            ]
        }
    }
}

MCP For Server Developers: Quickstart

Available Resources

The server provides the following resources:

  • account://info - Get current account information
  • positions://all - Get all current positions
  • positions://{symbol} - Get position details for a specific symbol
  • orders://recent/{limit} - Get most recent orders with specified limit
  • market://{symbol}/quote - Get current market quote for a specific symbol
  • market://{symbol}/bars/{timeframe} - Get historical price bars for a symbol with specified timeframe
  • assets://list - List tradable assets available on Alpaca
  • assets://{symbol} - Get detailed asset information by symbol

Available Tools

The server provides the following tools:

  • get_account_info_tool - Get current account information
  • place_market_order - Place a market order to buy or sell a stock
  • place_limit_order - Place a limit order to buy or sell a stock at a specified price
  • place_stop_order - Place a stop order to buy or sell a stock when it reaches a specified price
  • place_stop_limit_order - Place a stop-limit order combining stop and limit order features
  • cancel_order - Cancel an open order by its ID
  • close_position - Close an open position for a specific symbol
  • get_portfolio_summary - Get a comprehensive summary of the portfolio

Star History

Star History Chart

Repository Owner

laukikk
laukikk

User

Repository Details

Language Python
Default Branch main
Size 43 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
98.86%
Dockerfile
1.14%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • QuantConnect MCP Server

    QuantConnect MCP Server

    Official bridge for secure AI access to QuantConnect's algorithmic trading cloud platform

    QuantConnect MCP Server enables artificial intelligence systems such as Claude and OpenAI to interface with QuantConnect's cloud platform through an official, secure, and dockerized implementation of the Model Context Protocol (MCP). It facilitates automated project management, strategy writing, backtesting, and live deployment by exposing a comprehensive suite of API tools for users with valid access credentials. As the maintained official version, it ensures security, easy deployment, and cross-platform compatibility for advanced algorithmic trading automation.

    • 50
    • MCP
    • QuantConnect/mcp-server
  • Coincap MCP

    Coincap MCP

    Query live cryptocurrency data through Coincap's public API for desktop AI tools.

    Coincap MCP provides seamless access to cryptocurrency market data from Coincap's public API without requiring API keys or registration. Designed to integrate with Claude Desktop using the Model Context Protocol (MCP), it enables users to query crypto asset prices, market capitalization, and a list of available assets. Installation and configuration are streamlined through Smithery or direct setup. The tool includes sample prompts and exposes specialized tools for crypto price lookup and asset listing.

    • 89
    • MCP
    • QuantGeekDev/coincap-mcp
  • Twelve Data MCP Server

    Twelve Data MCP Server

    Seamless AI-powered access to financial market data via the Twelve Data API.

    Twelve Data MCP Server provides a Model Context Protocol-compliant server for integrating and accessing Twelve Data’s financial market API. It enables users and AI agents to retrieve historical data, real-time quotes, and instrument metadata for stocks, forex, and crypto using natural language or endpoint calls. The system leverages AI-driven routing, including OpenAI GPT-4o, to intelligently map plain English queries to relevant API endpoints for structured or conversational workflows. Integration options are available for platforms like Claude Desktop and VS Code, with flexible local or remote deployment.

    • 43
    • MCP
    • twelvedata/mcp
  • mcp-server-ledger

    mcp-server-ledger

    Model Context Protocol server for interacting with Ledger CLI via AI assistants.

    mcp-server-ledger provides a standardized Model Context Protocol interface for the Ledger CLI, enabling AI-driven querying and analysis of double-entry accounting data. It exposes key Ledger CLI commands as tools accessible by Large Language Models for financial reporting, budget analysis, and account management. It supports deployment via Docker, Smithery, or 'uv', and requires a valid ledger file and appropriate environment setup.

    • 35
    • MCP
    • minhyeoky/mcp-server-ledger
  • Bitcoin MCP Server

    Bitcoin MCP Server

    Real-time Bitcoin blockchain data server for MCP clients.

    Provides tools to deliver real-time Bitcoin blockchain data for use with Model Context Protocol (MCP) clients. Offers specialized endpoints for querying blockchain addresses, transactions, UTXOs, and block information by interfacing with the mempool.space API. Supports easy installation and integration with popular MCP clients, enabling seamless access to blockchain analytics.

    • 0
    • MCP
    • JamesANZ/bitcoin-mcp
  • Bitcoin & Lightning Network MCP Server

    Bitcoin & Lightning Network MCP Server

    Enable AI models to safely interact with Bitcoin and Lightning Network in a standardized way.

    The Bitcoin & Lightning Network MCP Server implements the Model Context Protocol, allowing AI models to interface with Bitcoin and Lightning Network functionalities such as key generation, address validation, transaction decoding, blockchain queries, and lightning payments. It provides standardized endpoints for AI model integration, including support for Claude Desktop and Goose. The solution supports querying blockchain data, parsing transactions and invoices, and managing cryptographic operations in a secure and extensible manner.

    • 65
    • MCP
    • AbdelStark/bitcoin-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results