Alpaca Trading MCP Server
Servidor MCP de Alpaca Trading
Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona una interfaz a la API de comercio de Alpaca, permitiéndole administrar su cartera de acciones y criptomonedas, realizar operaciones y acceder a datos del mercado.
Características
Administración de cuentas : vea los detalles de la cuenta, los saldos y el estado de la cartera
Trading : Colocar órdenes de mercado, límite, stop y stop-limit
Gestión de cartera : ver posiciones, calcular el rendimiento y cerrar posiciones
Datos de mercado : acceda a cotizaciones en tiempo real y datos históricos de precios
Información sobre activos : obtenga detalles sobre los activos negociables
Related MCP server: Alpaca MCP Server
Instalación
Clonar este repositorio
Instalar dependencias:
pip install -e .O usando uv:
uv pip install -e .Configuración
Copie el archivo
.env.examplea.env:
cp .env.example .envAgregue sus credenciales de API de Alpaca Paper Trading al archivo
.env:
ALPACA_PAPER_API_KEY = "your-api-key"
ALPACA_PAPER_API_SECRET = "your-api-secret"Puede obtener estas credenciales creando una cuenta en Alpaca .
Uso
Ejecute el servidor MCP:
python src/server.pyEl servidor se iniciará y estará disponible para que los clientes de MCP puedan conectarse.
Recursos disponibles
El servidor proporciona los siguientes recursos:
account://info- Obtener información actual de la cuentapositions://all- Obtener todas las posiciones actualespositions://{symbol}- Obtener detalles de la posición de un símbolo específicoorders://recent/{limit}- Obtener los pedidos más recientes con el límite especificadomarket://{symbol}/quote- Obtener la cotización actual del mercado para un símbolo específicomarket://{symbol}/bars/{timeframe}- Obtener barras de precios históricas para un símbolo con un período de tiempo específicoassets://list- Lista de activos negociables disponibles en Alpacaassets://{symbol}- Obtenga información detallada de los activos por símbolo
Herramientas disponibles
El servidor proporciona las siguientes herramientas:
get_account_info_tool- Obtener información actual de la cuentaplace_market_order- Colocar una orden de mercado para comprar o vender una acciónplace_limit_order- Coloque una orden limitada para comprar o vender una acción a un precio específicoplace_stop_order- Coloca una orden de stop para comprar o vender una acción cuando alcanza un precio específicoplace_stop_limit_order- Coloque una orden stop-limit combinando funciones de órdenes stop y limitcancel_order- Cancelar una orden abierta por su IDclose_position- Cerrar una posición abierta para un símbolo específicoget_portfolio_summary- Obtenga un resumen completo de la cartera
Available Tools
8 toolscancel_orderB
Cancel an open order by its ID.
Args: order_id: ID of the order to cancel
Returns: Confirmation of cancellation
Inputs: order_id (required).
close_positionC
Close an open position for a specific symbol.
Args: symbol: Stock symbol to close position for
Returns: Confirmation of position closure
Inputs: symbol (required).
get_account_info_toolB
Get current account information.
Returns: Account summary with balance and status
Inputs: no named parameters.
get_portfolio_summaryB
Get a comprehensive summary of the portfolio including account details and open positions.
Returns: Portfolio summary with account and positions information
Inputs: no named parameters.
place_limit_orderB
Place a limit order to buy or sell a stock at a specified price.
Args: symbol: Stock symbol (e.g., 'AAPL') quantity: Number of shares to buy or sell (can be fractional) side: Either 'buy' or 'sell' limit_price: Maximum price for buy or minimum price for sell time_in_force: Order duration - 'day', 'gtc' (good till canceled), 'ioc' (immediate or cancel)
Returns: Order confirmation details
Inputs: symbol (required), quantity (required), side (required), limit_price (required), +1 more.
place_market_orderB
Place a market order to buy or sell a stock.
Args: symbol: Stock symbol (e.g., 'AAPL') quantity: Number of shares to buy or sell (can be fractional) side: Either 'buy' or 'sell'
Returns: Order confirmation details
Inputs: symbol (required), quantity (required), side (required).
place_stop_limit_orderA
Place a stop-limit order combining stop and limit order features.
Args: symbol: Stock symbol (e.g., 'AAPL') quantity: Number of shares to buy or sell (can be fractional) side: Either 'buy' or 'sell' stop_price: Price that triggers the order limit_price: Maximum/minimum price for the triggered order time_in_force: Order duration - 'day', 'gtc' (good till canceled)
Returns: Order confirmation details
Inputs: symbol (required), quantity (required), side (required), stop_price (required), +2 more.
place_stop_orderA
Place a stop order to buy or sell a stock when it reaches a specified price.
Args: symbol: Stock symbol (e.g., 'AAPL') quantity: Number of shares to buy or sell (can be fractional) side: Either 'buy' or 'sell' stop_price: Price that triggers the order time_in_force: Order duration - 'day', 'gtc' (good till canceled)
Returns: Order confirmation details
Inputs: symbol (required), quantity (required), side (required), stop_price (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no ambiguity. Order placement tools (market, limit, stop, stop-limit) are well-differentiated by order type, while account/portfolio tools and order/position management tools serve separate functions. An agent can easily distinguish between them based on their specific actions.
Most tools follow a consistent verb_noun pattern (e.g., cancel_order, close_position, place_market_order). However, get_account_info_tool deviates slightly with the '_tool' suffix, breaking perfect consistency. The naming is otherwise predictable and readable across the set.
With 8 tools, this server is well-scoped for trading operations. It covers essential functions like order placement (4 tools), order cancellation, position management, and account/portfolio queries. Each tool earns its place without being overly sparse or bloated for the domain.
The toolset provides strong coverage for core trading workflows: placing various order types, managing orders and positions, and viewing account/portfolio data. A minor gap exists in the lack of tools for modifying existing orders or retrieving specific order details, but agents can work around this with the available tools.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.28MIT
- AlicenseNot gradedqualityDmaintenanceA 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.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server implementation for Alpaca's Trading API that enables LLMs to interact with Alpaca's trading infrastructure using natural language, supporting stock, options, and crypto trading, portfolio management, watchlists, and market data.4MIT

NINX MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that provides financial trading tools and market analysis capabilities, enabling AI assistants to access real-time market data, execute trades, analyze portfolios, and perform comprehensive financial analysis.MIT