logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

alpaca-brokerage-interface-service

A middleware service enabling LLM applications to interface with Alpaca's financial exchange API for transactional operations, market data retrieval, and comprehensive management of securities holdings. It encompasses functionalities for order submission, querying account status, retrieving transactional records, and controlling asset positions.

Author

alpaca-brokerage-interface-service logo

wlu03

No License

Quick Info

GitHub GitHub Stars 4
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

apiapishttptrading apiapis httprequests wlu03

Alpaca Trading Platform Connector Service

This specialized MCP service exposes the capabilities of the Alpaca financial services API, permitting programmatic stock trading, order placement, and access to real-time market intelligence within an AI application context. The following distinct operational endpoints (tools) are provided:

get-alpaca-account: Retrieves current configuration and balance details for the connected Alpaca brokerage account.

alpaca-createOrder: Submits a new trading instruction (purchase or divestiture) to the Alpaca system.

alpaca-getOrder: Fetches the status and details of a specific, identified order.

alpaca-getOrders: Lists existing orders, supporting optional filtering based on criteria like fulfillment status, volume limits, or transaction direction.

alpaca-replaceOrder: Allows for the modification of an active order, typically adjusting the volume or the limit price constraint.

alpaca-cancelOrder: Terminates a specific, pending order identified by its unique ID.

alpaca-cancelOrders: Executes a bulk cancellation of all currently unsettled/open trading instructions.

alpaca-getPosition: Fetches granular data pertaining to a single security holding.

alpaca-getPositions: Provides an aggregate view of all presently held asset positions within the account.

alpaca-closePosition: Liquidates or sells off an entire holding for a specified asset identifier (symbol or ID).

alpaca-closePositions: Initiates the simultaneous liquidation of all open asset holdings.

alpaca-exerciseOption: Executes the rights associated with a specified options contract.

alpaca-getWatchlist: Retrieves the contents of a singular, named tracking list.

alpaca-getWatchlists: Enumerates all defined user watchlists.

alpaca-createWatchlist: Provisions a new tracking list, optionally pre-populating it with security symbols.

alpaca-updateWatchlist: Modifies the descriptive name or the contained symbols of an existing tracking list.

alpaca-deleteWatchlist: Permanently removes a watchlist via its identifier.

alpaca-getPortfolioHistory: Accesses time-series data illustrating the evolution of the portfolio's valuation.

alpaca-getActivity: Fetches a singular record detailing a specific account transaction or event.

alpaca-getActivities: Provides a chronological ledger of all recorded account events.

alpaca-getOptionsContract: Retrieves the detailed specifications for one options derivative.

alpaca-getOptionsContracts: Searches and lists options contracts based on provided filtering parameters.

alpaca-getCorporateAction: Fetches specifics regarding a singular corporate maneuver affecting securities.

alpaca-getCorporateActions: Lists corporate actions that occurred within a defined temporal window.

alpaca-getStocksCorporateActions: Filters the corporate action list specifically for common stock events.

alpaca-getNews: Retrieves pertinent news items associated with designated stock symbols.

alpaca-getStocksMostActives: Lists the securities exhibiting the highest trading volume or the most significant price change velocity.

alpaca-getStocksMarketMovers: Identifies the top-performing or worst-performing stocks based on momentum metrics.

alpaca-getStocksQuotes: Fetches the current bid/ask quotes for one or more specified ticker symbols.

alpaca-getStocksQuotesLatest: Retrieves only the most recent timestamped quote data for symbols.

alpaca-getStocksSnapshots: Fetches a comprehensive, real-time data package (snapshot) for specified assets.

alpaca-getStocksConditions: Retrieves the recognized codes describing trade or quote conditions prevalent in the market.

alpaca-getStocksExchangeCodes: Lists the recognized codes identifying active securities exchanges.

alpaca-getStocksTrades: Accesses historical tick-level trade data for specified symbols.

alpaca-getStocksTradesLatest: Retrieves the most recent recorded trade transaction for given symbols.

Deployment Procedure


  1. Obtain a local copy of this repository via cloning.
  2. Install necessary prerequisites using the package manager:
    • Execute npm install (this reads dependency specifications from package.json and package-lock.json).
  3. For iterative refinement:
    • Run the development script: npm run dev
  4. For production deployment:
    1. Compile the assets: npm run build
      • This invokes the compilation routine defined in the project manifest.
    2. Initiate the runtime environment: npm start
      • Launches the backend Node.js service.

Integration with Claude Desktop Client


Upon successful execution of npm run build, you can configure the Claude Desktop application to recognize and utilize this service endpoint.

The primary configuration file for the App resides at ~/Library/Application Support/Claude/claude_desktop_config.json. You can quickly open this file using the shell command: code ~/Library/Application\ Support/Claude/claude_desktop_config.json

Integrate your server by appending the following JSON structure into the main configuration object: Node { "mcpServers": { "alpaca": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/PARENT/FOLDER/alpaca/build/index.js" ] } } }

Persist these changes and relaunch the Claude Desktop application. Upon startup, the specialized toolkit icon (resembling a hammer) should appear, signifying that your Alpac-enabled financial functionalities are ready for invocation.

Participation

We welcome external contributions! Please fork the codebase, implement your enhancements, and submit them as a pull request for review.

Governing License

This software is distributed under the terms of the MIT License.

Support Channels

For reporting defects, posing queries, or submitting suggestions, please utilize the repository's issue tracker or contact the development team via GitHub.

[WIKIPEDIA NOTE: XMLHttpRequest (XHR) is an established JavaScript interface object designed to facilitate the asynchronous transmission of HTTP requests between a web browser and a server. Its utility allows web-based applications to communicate with backend resources post-page-load and retrieve information dynamically, forming a cornerstone of Ajax programming paradigms. Before XHR, server interaction relied primarily on standard page refreshes via form submissions or link navigation. The foundational idea for XHR originated in 2000 with Microsoft Outlook developers and was first implemented in Internet Explorer 5 (1999), though initially using non-standard identifiers like ActiveXObject("Msxml2.XMLHTTP"). By Internet Explorer 7 (2006), the standard XMLHttpRequest identifier achieved universal browser adoption across Gecko, Safari, and Opera engines. The W3C formalized the specification starting in 2006, evolving through Level 2 additions (supporting cross-domain calls and progress monitoring) before being consolidated. Development maintenance transitioned to WHATWG in 2012.]

See Also

`