Skip to main content

Webull Local MCP Server

Webull Local MCP Server enables AI assistants (Cursor, Claude Desktop, Kiro, etc.) to securely access Webull OpenAPI trading and market data capabilities via the Model Context Protocol (MCP).

Source code: webull-inc/webull-openapi-mcp


What is Webull Local MCP​

Webull Local MCP Server is a server built on the Model Context Protocol that wraps Webull OpenAPI capabilities into tools callable by AI assistants. With MCP, you can use natural language in your AI coding assistant to:

  • Query real-time market data
  • View account balances and positions
  • Place, modify, and cancel orders
  • Query order history and order details

Architecture Overview​


Prerequisites​

API Credentials (App Key and App Secret)​

Other Requirements​


Setup Steps​

Step 1: Install​

Ensure Python 3.10+ and uvx are installed. No need to manually install Webull Local MCP Server — your AI client will automatically download and launch it via uvx.

Step 2: Configure AI Client​

Add the following configuration to your AI client's MCP config file. Replace your_app_key and your_app_secret with the credentials obtained in the prerequisites:

Edit .cursor/mcp.json:

{
"mcpServers": {
"webull": {
"command": "uvx",
"args": ["webull-openapi-mcp", "serve"],
"env": {
"WEBULL_APP_KEY": "your_app_key",
"WEBULL_APP_SECRET": "your_app_secret",
"WEBULL_REGION_ID": "th",
"WEBULL_ENVIRONMENT": "prod"
}
}
}
}

Tip: For uat environment, set WEBULL_ENVIRONMENT to uat.

Step 3: Authenticate​

This step is only required if your account has Two-Factor Authentication enabled.

Complete a one-time authentication in the terminal before first use:

uvx webull-openapi-mcp auth

Authentication flow:

After approving the request in the Webull App, the token is saved locally. The token is valid for 15 days and auto-refreshes on use.

Step 4: Verify Connection​

Restart your AI client and try the following in a conversation:

Get my account list

If your account information is returned, Webull MCP is successfully connected.


Usage Examples​

Market Data​

Get a real-time snapshot for AAPL
Show me AAPL's daily bars for the last 5 days
What are today's top gainers in the US market?

Trading​

Buy 100 shares of AAPL at limit price $200
Place a market order to sell 50 shares of TSLA
Show my open orders

Available Tools​

Webull Local MCP Server supports US stock and ETF market data and stock trading. The following 56 tools are available, grouped by toolset (see WEBULL_TOOLSETS below). Run uvx webull-openapi-mcp tools to list the tools enabled by your current configuration.

Account (account)​

ToolDescription
get_account_listGet all linked accounts
get_account_balanceGet account balance, buying power, and cash details
get_account_positionsGet current positions and holdings

Instrument and Fundamentals (instrument)​

ToolDescription
get_instrumentsGet stock/ETF instrument info (US_STOCK, US_ETF only)
get_company_profileGet company profile including business description, industry, sector
get_analyst_ratingGet analyst rating for a security
get_analyst_target_priceGet analyst target price for a security
get_stock_capital_flowGet capital flow distribution for a stock by date
get_stock_filingsGet SEC filings for a US stock (last 3 years)
get_stock_earnings_calendarGet earnings calendar for a stock
get_stock_dividend_calendarGet dividend calendar for a stock
get_stock_forecast_epsGet forecast EPS for a stock
get_stock_industry_comparisonGet industry comparison for a stock (up to 20 peers)
get_fund_ratingGet fund rating history
get_fund_performanceGet fund performance returns over multiple horizons
get_fund_allocationGet fund asset allocation by date
get_fund_holdingsGet fund top 10 holdings
get_fund_briefGet fund brief information
get_fund_dividendsGet fund dividend history
get_fund_splitsGet fund split history
get_fund_net_valueGet fund net value (NAV) history
get_fund_filesGet fund files/documents
get_financial_alertGet financial alert (next report estimates vs last year)
get_financial_indicatorsGet financial indicators (key ratios/metrics) for a stock
get_income_statementGet income statement for a stock across periods
get_balance_sheetGet balance sheet for a stock across periods
get_cash_flowGet cash flow statement for a stock across periods

Market Data (market-data)​

Stock market data

ToolDescription
get_stock_snapshotGet real-time stock/ETF snapshot (multiple symbols, extended-hours and overnight data)
get_stock_quotesGet real-time bid/ask quotes with depth
get_stock_tickGet stock tick-by-tick trade data
get_stock_footprintGet stock large order footprint (order flow)
get_stock_barsGet stock OHLCV bars in batch
get_stock_bars_singleGet OHLCV bars for a single stock
get_stock_noii_barsGet NOII (Net Order Imbalance Indicator) bars for a stock
get_stock_noii_snapshotGet latest NOII snapshot for a stock during auction phases

Screener

ToolDescription
get_gainers_losersGet top gainers or losers ranking by price change
get_most_activeGet most actively traded stocks ranking
get_market_sectorsGet market sector overview ranking
get_market_sectors_detailGet stock list and statistics for a specific market sector
get_high_dividendGet high dividend stocks ranking
get_52_week_high_lowGet 52-week high/low stocks ranking

Watchlist

ToolDescription
get_watchlistsGet all watchlists for the current user
create_watchlistCreate a new watchlist (up to 20)
update_watchlistUpdate an existing watchlist's name or sort order
delete_watchlistDelete a watchlist and all instruments in it
get_watchlist_instrumentsGet all instruments in a watchlist
add_watchlist_instrumentsAdd instruments to a watchlist
remove_watchlist_instrumentsRemove instruments from a watchlist
update_watchlist_instrumentsUpdate the sort order of instruments in a watchlist

Trading (trading)​

ToolDescription
preview_stock_orderPreview a stock order without submitting (estimated cost and fees)
place_stock_orderPlace a stock order
replace_stock_orderModify an existing stock order
cancel_orderCancel an unfilled order
get_open_ordersGet all current open/pending orders
get_order_historyGet historical orders (default last 7 days)
get_order_detailGet single order details

Supported Scope​

  • Order market is US; instrument categories are US_STOCK and US_ETF
  • Stock accounts are cash accounts (INDIVIDUAL_CASH)
  • Supported order types: MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT
  • Supported time in force: DAY, GTC
  • Supported trading sessions: CORE, ALL, NIGHT, ALL_DAY
  • Options, futures, crypto, event contracts, combo orders, option strategies, and algo orders are not supported
  • list_order_executions may appear in the tool list but is not supported for your account

Configuration Parameters​

VariableDescriptionDefault
WEBULL_APP_KEYApp Key (required)—
WEBULL_APP_SECRETApp Secret (required)—
WEBULL_ENVIRONMENTuat or prod (production)uat
WEBULL_REGION_IDMust be set to thus
WEBULL_TOOLSETSEnabled toolsets (comma-separated): account, instrument, market-data, tradingall enabled
WEBULL_MAX_ORDER_NOTIONAL_USDMax order notional for US market (USD)10000
WEBULL_MAX_ORDER_QUANTITYMax order quantity per order1000
WEBULL_SYMBOL_WHITELISTAllowed symbols whitelist (comma-separated)no restriction
WEBULL_TOKEN_DIRToken storage directory./conf/
WEBULL_AUDIT_LOG_FILEPath to audit log filedisabled

For read-only access, set WEBULL_TOOLSETS=account,instrument,market-data to disable trading tools.

Environment Endpoints​

EnvironmentHTTP API
Productionapi.webull.co.th
UATth-api.uat.webullbroker.com

Server Commands​

CommandDescription
uvx webull-openapi-mcp serveStart the MCP server (used by your AI client)
uvx webull-openapi-mcp authOne-time 2FA authentication and token creation
uvx webull-openapi-mcp statusShow configuration status and environment information
uvx webull-openapi-mcp toolsList the tools available for the current configuration

Security Recommendations​

  • Never share your App Key, App Secret, or Token via chat with an AI model. These credentials should only be passed to the MCP Server process via the env field in mcp.json, never as conversation content.
  • Use preview_stock_order before placing orders to verify estimated costs.
  • Use WEBULL_SYMBOL_WHITELIST to restrict tradable symbols.
  • Use WEBULL_MAX_ORDER_NOTIONAL_USD and WEBULL_MAX_ORDER_QUANTITY to set per-order risk limits.

Disclosure​

Webull Local MCP Server provides information solely for reference purposes and does not constitute investment advice. Trading in securities and other financial instruments involves substantial risk of loss. All trading decisions are made at your own discretion and risk. You are solely responsible for verifying order details before execution. This software is provided "as is" without warranty of any kind.