MCP ExplorerExplorer

Alpaca Mcp

@wlu03on a year ago
4 MIT
FreeCommunity
AI Systems
alpaca-mcp using stdio/stdout

Overview

What is Alpaca Mcp

ALPACA-MCP is an MCP server that provides an interface to the Alpaca trading API, enabling users to trade stocks, place orders, and access market information seamlessly.

Use cases

Use cases for ALPACA-MCP include algorithmic trading, portfolio management, real-time market analysis, and integrating trading functionalities into custom applications.

How to use

To use ALPACA-MCP, you can interact with its various tools via standard input/output. Each tool corresponds to a specific function such as fetching account details, placing orders, or retrieving market data.

Key features

Key features of ALPACA-MCP include order management (create, modify, cancel orders), position tracking, watchlist management, portfolio performance history, and access to market news and corporate actions.

Where to use

ALPACA-MCP can be used in financial services, trading applications, and by individual investors looking to automate their trading strategies and manage their portfolios effectively.

Content

Alpaca API MCP Server


This MCP server provides an interface to the Alpaca trading API allowing you to trade stock, place trades, and access market information. Here is a list of “tools” it uses:

get-alpaca-account: Fetches your Alpaca account details.

alpaca-createOrder: Places a new order on Alpaca (buy/sell).

alpaca-getOrder: Retrieves a single order by its ID.

alpaca-getOrders: Lists orders with optional filters (status, limit, direction).

alpaca-replaceOrder: Modifies an existing order’s quantity or limit price.

alpaca-cancelOrder: Cancels a specific order by ID.

alpaca-cancelOrders: Cancels all open orders at once.

alpaca-getPosition: Retrieves details for a specific position.

alpaca-getPositions: Lists all current positions in your account.

alpaca-closePosition: Closes a specific position by symbol or asset ID.

alpaca-closePositions: Closes all open positions.

alpaca-exerciseOption: Exercises a specified option contract.

alpaca-getWatchlist: Retrieves a single watchlist by ID.

alpaca-getWatchlists: Lists all your watchlists.

alpaca-createWatchlist: Creates a new watchlist with given symbols.

alpaca-updateWatchlist: Updates an existing watchlist’s name and symbols.

alpaca-deleteWatchlist: Deletes a watchlist by ID.

alpaca-getPortfolioHistory: Fetches historical portfolio performance data.

alpaca-getActivity: Retrieves a specific account activity record.

alpaca-getActivities: Lists all account activity records.

alpaca-getOptionsContract: Retrieves details for one options contract.

alpaca-getOptionsContracts: Lists options contracts with filters.

alpaca-getCorporateAction: Retrieves a specific corporate action event.

alpaca-getCorporateActions: Lists corporate actions within a date range.

alpaca-getStocksCorporateActions: Lists corporate actions for stocks.

alpaca-getNews: Fetches news articles for specified symbols.

alpaca-getStocksMostActives: Lists the most active stocks by volume or change.

alpaca-getStocksMarketMovers: Lists top market movers by volume or change.

alpaca-getStocksQuotes: Retrieves quotes for specified symbols.

alpaca-getStocksQuotesLatest: Retrieves the latest quotes for symbols.

alpaca-getStocksSnapshots: Fetches snapshot data for symbols.

alpaca-getStocksConditions: Retrieves tick condition codes for trades or quotes.

alpaca-getStocksExchangeCodes: Lists available stock exchange codes.

alpaca-getStocksTrades: Retrieves trade data for specified symbols.

alpaca-getStocksTradesLatest: Retrieves the latest trade data for symbols.

Installation


  1. Clone this repo
  2. Install once using npm install
    • Reads the package.json and package-lock.json to install dependencies
  3. For Development: npm run dev
  4. To ship
    1. npm run build
      • will execute the build script in the package.json
    2. npm start
      • launches the development server on Node.js backend

Connecting to Claude Desktop App


After running npm run build to build your server, you can test your MCP server using Claude as the client.

After installing Claude for Desktop, the App configuration sits in ~/Library/Application Support/Claude/claude_desktop_config.json. You can use the command
code ~/Library/Application\ Support/Claude/claude_desktop_config.json to open this file.

Now, you want to add the following to this json file for your MCP server.

{
    "mcpServers": {
        "alpaca": {
            "command": "node",
            "args": [
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/alpaca/build/index.js"
            ]
        }
    }
}

Save the file and restart Claude for Desktop. Once you launch you should see the hammer logo with your preloaded MCP toolkit/functions. Enjoy Trading!

Contributions

Contributions are welcome! Please fork this repository, make your changes, and open a pull request.

License

This project is licensed under the MIT License.

Contact

For issues, questions, and suggestions, create an issue in the repository or contact the maintainers through GitHub.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers