Docs

Accurate setup and tool list derived from the StockMCP repository.

Quick Start (from repo)

  1. Clone the repo and enter it:
    git clone https://github.com/Ponesicek/StockMCP
    cd StockMCP
  2. Create .env with Alpaca paper credentials:
    ALPACA_KEY=your_api_key_here
    ALPACA_SECRET=your_secret_key_here
    ALPACA_BASE_URL=https://paper-api.alpaca.markets/v2
  3. Run with Docker Compose (as per README):
    npm run docker:dev
  4. Configure your MCP client to execute the server inside the Docker container:
    "stock-mcp": {
      "command": "docker",
      "args": ["exec", "-i", "stock-mcp-server", "node", "dist/index.js"]
    }

This follows the authoritative instructions in the project README.

Tools

get-stock-price

Get current price for a symbol.

input: { "symbol": "AAPL" }
output: "AAPL: $<price> (as of <timestamp>)"

get-account

Return account information.

input: {}
output: <account json>

get-cash

Return cash and currency.

input: {}
output: "<cash> <currency>"

get-stock-asset-info

Detailed asset info.

input: { "symbol": "AAPL" }
output: <asset json>

get-orders

Recent orders (status: all, limit: 10).

input: {}
output: <orders json or "No orders found">

get-positions

Current positions with key fields.

input: {}
output: [{ "symbol": "...", "quantity": "...", "side": "...", "market_value": "...", "unrealized_pl": "..." }, ...] or "No current positions"

place-order

Market order.

input: { "symbol": "AAPL", "quantity": 1, "side": "buy"|"sell", "time_in_force": "day"|"gtc"|"opg"|"ioc" }
output: <order json>

get-quote

Latest quote.

input: { "symbol": "AAPL" }
output: <quote json>

cancel-order

Cancel by order_id.

input: { "order_id": "<id>" }
output: <cancel result json>

place-limit-order

Limit order.

input: { "symbol": "AAPL", "quantity": 1, "side": "buy"|"sell", "price": 100, "time_in_force": "day"|"gtc"|"opg"|"ioc" }
output: <order json>

get-portfolio-value

Portfolio value.

input: {}
output: "<value>"

get-market-status

Clock/status.

input: {}
output: <clock json>

get-historical-data

Bars via getBarsV2.

input: { "symbol": "AAPL", "timeframe": "1Min"|"5Min"|"15Min"|"1Hour"|"1Day", "start"?: ISO, "end"?: ISO, "limit"?: number }
output: [<bar>, ...] or message

place-stop-order

Stop order.

input: { "symbol": "AAPL", "quantity": 1, "side": "buy"|"sell", "price": 95, "time_in_force": "day"|"gtc"|"opg"|"ioc" }
output: <order json>

place-stop-limit-order

Stop limit order.

input: { "symbol": "AAPL", "quantity": 1, "side": "buy"|"sell", "stop_price": 95, "limit_price": 96, "time_in_force": "day"|"gtc"|"opg"|"ioc" }
output: <order json>