Public.com MCP Server
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HOST | No | Host for streamable-http transport (default: 0.0.0.0). | |
| PORT | No | Port for streamable-http transport (default: 8000). | |
| MCP_TRANSPORT | No | Transport mode: stdio (default) or streamable-http. | |
| PUBLIC_COM_SECRET | Yes | Your API secret key for Public.com. | |
| PUBLIC_COM_ACCOUNT_ID | No | Optional default account ID to use when not specified in requests. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_setupA | Verify that the Public.com API credentials are configured correctly. Checks the PUBLIC_COM_SECRET environment variable and attempts to authenticate. Run this first to confirm connectivity. |
| get_accountsA | List all brokerage accounts associated with the API key. Returns account IDs and types (BROKERAGE, HIGH_YIELD, etc.). |
| get_portfolioA | Get a snapshot of the account portfolio. Returns positions, equity breakdown, buying power, and open orders. Only non-IRA accounts are supported. Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_ordersA | Get all open/active orders on the account. Fetches the account portfolio and returns only the orders list. Returns order details including symbol, side, type, status, quantity, and prices. Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_orderA | Get the status and details of a specific order. Note: Order placement is asynchronous. This may return an error if the order has not yet been indexed. Args: order_id: The UUID of the order to look up. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_historyA | Retrieve account transaction history. Returns trades, money movements (deposits, withdrawals, dividends), and position adjustments (splits, mergers). Args: account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. start: Start timestamp in ISO 8601 format (e.g. 2025-01-15T09:00:00-05:00). end: End timestamp in ISO 8601 format. page_size: Max number of records to return. next_token: Pagination token for the next page. |
| get_quotesA | Get real-time quotes for one or more symbols. Returns last price, bid, ask, volume, and other market data. Args: symbols: List of ticker symbols (e.g. ["AAPL", "GOOGL"]). instrument_type: Type for all symbols. One of EQUITY, CRYPTO, OPTION, INDEX, ALT, BOND, TREASURY. Default is EQUITY. For mixed types, call this tool multiple times. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_historic_barsA | Get OHLCV historic bar data for a symbol over a given time period. Returns pre-market, regular-market, and after-hours bars plus the last regular trading session close. Args: symbol: Ticker symbol. Format depends on instrument_type: - EQUITY: e.g. "AAPL" - CRYPTO: e.g. "BTC" (do not append "-USD") - OPTION: OSI-normalized symbol, e.g. "AAPL260320C00280000" - INDEX: e.g. "SPX" period: Time window. One of DAY, WEEK, MONTH, QUARTER, HALF_YEAR, YEAR, FIVE_YEARS, YTD, SINCE_PURCHASE. instrument_type: EQUITY, CRYPTO, OPTION, or INDEX. Default EQUITY. aggregation: Optional bar size. One of ONE_MINUTE, FIVE_MINUTES, TEN_MINUTES, FIFTEEN_MINUTES, THIRTY_MINUTES, ONE_HOUR, ONE_DAY, ONE_WEEK, ONE_MONTH, THREE_MONTHS, SIX_MONTHS, ONE_YEAR. If omitted, the server picks an appropriate size for the period. purchase_date: Required when period is SINCE_PURCHASE. Format: YYYY-MM-DD. |
| get_instrumentA | Get details about a specific tradeable instrument. Returns trading status, fractional trading availability, and option trading capabilities. Args: symbol: Ticker symbol (e.g. "AAPL"). instrument_type: One of EQUITY, CRYPTO, OPTION, INDEX, ALT, BOND, TREASURY. Default is EQUITY. |
| get_all_instrumentsA | List all available tradeable instruments with optional filters. Args: type_filter: Filter by instrument types (e.g. ["EQUITY", "CRYPTO"]). Valid: EQUITY, CRYPTO, OPTION, ALT, BOND, INDEX, TREASURY. trading_filter: Filter by trading status (e.g. ["BUY_AND_SELL"]). Valid: BUY_AND_SELL, LIQUIDATION_ONLY, DISABLED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_option_expirationsA | Get available option expiration dates for a symbol. Args: symbol: Underlying ticker symbol (e.g. "AAPL"). instrument_type: EQUITY or UNDERLYING_SECURITY_FOR_INDEX_OPTION. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_option_chainA | Get the full option chain (calls and puts) for a symbol and expiration. Args: symbol: Underlying ticker symbol (e.g. "AAPL"). expiration_date: Expiration date in YYYY-MM-DD format. instrument_type: EQUITY or UNDERLYING_SECURITY_FOR_INDEX_OPTION. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_option_greeksB | Get option Greeks (delta, gamma, theta, vega, rho, IV) for option symbols. Args: osi_symbols: List of OSI-normalized option symbols (e.g. ["AAPL260320C00280000"]). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| get_option_greekA | Get option Greeks (delta, gamma, theta, vega, rho, IV) for a single option symbol. Args: osi_symbol: OSI-normalized option symbol (e.g. "AAPL260320C00280000"). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_orderA | Estimate costs and impact of a potential single-leg trade before placing it. Returns estimated commission, regulatory fees, order value, buying power requirements, and margin impact. Does NOT place an order. Args: symbol: Ticker symbol (e.g. "AAPL"). instrument_type: EQUITY, OPTION, or CRYPTO. order_side: BUY or SELL. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT. time_in_force: DAY or GTD. Default is DAY. quantity: Number of shares/contracts (mutually exclusive with amount). amount: Dollar amount (mutually exclusive with quantity). limit_price: Required for LIMIT and STOP_LIMIT orders. stop_price: Required for STOP and STOP_LIMIT orders. open_close_indicator: For options only — OPEN or CLOSE. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. For equity orders only. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_multileg_orderA | Estimate costs for a multi-leg (options strategy) trade before placing it. Does NOT place an order. Args: legs: List of leg objects. Each leg must have: - symbol (str): The option/equity symbol (e.g. "SPY260313P00670000") - type (str): EQUITY or OPTION - side (str): BUY or SELL - open_close_indicator (str, optional): OPEN or CLOSE (required for options) - ratio_quantity (int, optional): Ratio between legs (default 1) Example: [{"symbol": "SPY260313P00670000", "type": "OPTION", "side": "SELL", "open_close_indicator": "OPEN", "ratio_quantity": 1}, {"symbol": "SPY260313P00665000", "type": "OPTION", "side": "BUY", "open_close_indicator": "OPEN", "ratio_quantity": 1}] limit_price: The limit price for the spread. time_in_force: DAY or GTD. Default is DAY. quantity: Number of spreads. Must be > 0. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_short_orderA | Estimate costs for a short-sale equity order before placing it. Returns estimated commission, fees, and buying power impact. Does NOT place an order. Args: symbol: Ticker symbol to short (e.g. "AAPL"). quantity: Number of shares to short. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT. Default is MARKET. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT and STOP_LIMIT orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_call_credit_spreadA | Estimate costs for a Bear Call Spread (call credit spread) before placing it. Sell a lower-strike call, buy a higher-strike call. Receives a net credit. Does NOT place an order. Args: sell_contract_osi: OSI symbol of the call to sell (lower strike). buy_contract_osi: OSI symbol of the call to buy (higher strike). quantity: Number of spreads. limit_price: Net credit to receive per spread (positive = credit received). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_call_debit_spreadA | Estimate costs for a Bull Call Spread (call debit spread) before placing it. Buy a lower-strike call, sell a higher-strike call. Pays a net debit. Does NOT place an order. Args: sell_contract_osi: OSI symbol of the call to sell (higher strike). buy_contract_osi: OSI symbol of the call to buy (lower strike). quantity: Number of spreads. limit_price: Net debit to pay per spread (positive = debit paid). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_put_credit_spreadA | Estimate costs for a Bull Put Spread (put credit spread) before placing it. Sell a higher-strike put, buy a lower-strike put. Receives a net credit. Does NOT place an order. Args: sell_contract_osi: OSI symbol of the put to sell (higher strike). buy_contract_osi: OSI symbol of the put to buy (lower strike). quantity: Number of spreads. limit_price: Net credit to receive per spread (positive = credit received). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| preflight_put_debit_spreadA | Estimate costs for a Bear Put Spread (put debit spread) before placing it. Buy a higher-strike put, sell a lower-strike put. Pays a net debit. Does NOT place an order. Args: sell_contract_osi: OSI symbol of the put to sell (lower strike). buy_contract_osi: OSI symbol of the put to buy (higher strike). quantity: Number of spreads. limit_price: Net debit to pay per spread (positive = debit paid). time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_orderA | Place a single-leg order (buy/sell stocks, crypto, or options). ⚠️ This executes a real trade. Consider running preflight_order first. Args: symbol: Ticker symbol (e.g. "AAPL"). instrument_type: EQUITY, OPTION, or CRYPTO. order_side: BUY or SELL. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT. time_in_force: DAY or GTD. Default is DAY. quantity: Number of shares/contracts (mutually exclusive with amount). amount: Dollar amount (mutually exclusive with quantity). limit_price: Required for LIMIT and STOP_LIMIT orders. stop_price: Required for STOP and STOP_LIMIT orders. open_close_indicator: For options only — OPEN or CLOSE. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. For equity orders only. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_multileg_orderA | Place a multi-leg order (options strategies: spreads, straddles, etc.). ⚠️ This executes a real trade. Consider running preflight_multileg_order first. Args: legs: List of leg objects. Each leg must have: - symbol (str): The option/equity symbol (e.g. "SPY260313P00670000") - type (str): EQUITY or OPTION - side (str): BUY or SELL - open_close_indicator (str, optional): OPEN or CLOSE (required for options) - ratio_quantity (int, optional): Ratio between legs (default 1) Example: [{"symbol": "SPY260313P00670000", "type": "OPTION", "side": "SELL", "open_close_indicator": "OPEN", "ratio_quantity": 1}, {"symbol": "SPY260313P00665000", "type": "OPTION", "side": "BUY", "open_close_indicator": "OPEN", "ratio_quantity": 1}] quantity: Number of spreads. Must be > 0. limit_price: Limit price. Positive for debit, negative for credit. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_call_credit_spreadA | Place a Bear Call Spread (call credit spread). Sell a lower-strike call, buy a higher-strike call. Receives a net credit. ⚠️ This executes a real trade. Consider running preflight_call_credit_spread first. Args: sell_contract_osi: OSI symbol of the call to sell (lower strike). buy_contract_osi: OSI symbol of the call to buy (higher strike). quantity: Number of spreads. limit_price: Minimum net credit to receive per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_call_debit_spreadA | Place a Bull Call Spread (call debit spread). Buy a lower-strike call, sell a higher-strike call. Pays a net debit. ⚠️ This executes a real trade. Consider running preflight_call_debit_spread first. Args: sell_contract_osi: OSI symbol of the call to sell (higher strike). buy_contract_osi: OSI symbol of the call to buy (lower strike). quantity: Number of spreads. limit_price: Maximum net debit to pay per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_put_credit_spreadA | Place a Bull Put Spread (put credit spread). Sell a higher-strike put, buy a lower-strike put. Receives a net credit. ⚠️ This executes a real trade. Consider running preflight_put_credit_spread first. Args: sell_contract_osi: OSI symbol of the put to sell (higher strike). buy_contract_osi: OSI symbol of the put to buy (lower strike). quantity: Number of spreads. limit_price: Minimum net credit to receive per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_put_debit_spreadA | Place a Bear Put Spread (put debit spread). Buy a higher-strike put, sell a lower-strike put. Pays a net debit. ⚠️ This executes a real trade. Consider running preflight_put_debit_spread first. Args: sell_contract_osi: OSI symbol of the put to sell (lower strike). buy_contract_osi: OSI symbol of the put to buy (higher strike). quantity: Number of spreads. limit_price: Maximum net debit to pay per spread. time_in_force: DAY or GTD. Default is DAY. expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| place_short_orderA | Place an equity short-sale order. ⚠️ This executes a real trade. Consider running preflight_short_order first. Args: symbol: Ticker symbol to short (e.g. "AAPL"). quantity: Number of shares to short. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT. Default is MARKET. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT and STOP_LIMIT orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| flatten_and_go_shortA | Sell any existing long position in a symbol, then place a short-sale order. ⚠️ Experimental — this is a two-order workflow, not atomic. Market conditions may change between the flatten fill and the short entry. Both orders execute as real trades. If no long position exists the flatten step is skipped and only the short order is placed. Args: symbol: Ticker symbol (e.g. "AAPL"). short_quantity: Number of shares to short after flattening. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT. Default is MARKET. time_in_force: DAY or GTD. Default is DAY. limit_price: Required for LIMIT and STOP_LIMIT orders. stop_price: Required for STOP and STOP_LIMIT orders. expiration_time: Required when time_in_force is GTD. ISO 8601 format. equity_market_session: CORE or EXTENDED. flatten_timeout: Seconds to wait for the flatten order to fill (default 60). account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| cancel_orderA | Cancel an existing order. Note: While most cancellations are processed immediately during market hours, this is not guaranteed. Use get_order to confirm cancellation. Args: order_id: The UUID of the order to cancel. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
| cancel_and_replace_orderA | Atomically cancel an existing order and replace it with new parameters. ⚠️ This modifies an existing order. Args: order_id: UUID of the existing order to cancel and replace. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT for the replacement. time_in_force: DAY or GTD. Default is DAY. quantity: New quantity for the replacement order. limit_price: New limit price (for LIMIT/STOP_LIMIT orders). stop_price: New stop price (for STOP/STOP_LIMIT orders). expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PublicDotCom/publicdotcom-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server