Connect a broker or create a paper account
broker_connectionsConnect an existing broker using its supported credentials, prepare a deferred paper account request, create an internal simulated trading account, add/remove/set its virtual cash, delete it, or read operation progress. Creation is a write; progress is read-only. Each action retains its independent permission and owner checks. Reuse the same UUID requestId and unchanged inputs when retrying one creation; use distinct request IDs for multiple intended accounts.
Set "action" to choose the operation. Only send the fields listed for that action.
action="connect_existing": Create saved broker credential
Required fields: broker, displayName, paperOrLive, credentialValues. Stores broker credential material in Vault and returns only metadata for the authenticated user. Values are encrypted at rest and are not returned to MCP. Use this for broker login/trading credentials only. Do not add a brokerCredentialId to a deployment by default; let the user choose on the approval page unless they explicitly named the exact saved broker connection/account. The broker field controls validation for known Lumibot/BotSpot brokers; use the exact environment variable key names below. Kalshi (kalshi): KALSHI_API_KEY_ID + KALSHI_PRIVATE_KEY. Optional: KALSHI_SUBACCOUNT, KALSHI_EXCHANGE_INDEX, KALSHI_BASE_URL, KALSHI_WS_URL. Do not pass KALSHI_IS_DEMO; BotSpot derives it from paperOrLive. Example credentialValues: {"KALSHI_API_KEY_ID":"key-id...","KALSHI_PRIVATE_KEY":"private-key-pem..."}. Alpaca (alpaca): ALPACA_API_KEY + ALPACA_API_SECRET OR ALPACA_OAUTH_TOKEN. Do not pass ALPACA_IS_PAPER; BotSpot derives it from paperOrLive. Example credentialValues: {"ALPACA_API_KEY":"PK...","ALPACA_API_SECRET":"secret..."}. Tradier (tradier): TRADIER_ACCOUNT_NUMBER + TRADIER_ACCESS_TOKEN OR TRADIER_ACCOUNT_NUMBER + TRADIER_API_KEY OR TRADIER_ACCOUNT_NUMBER + TRADIER_TOKEN. Optional: TRADIER_REFRESH_TOKEN, TRADIER_OAUTH_CLIENT_ID, TRADIER_OAUTH_CLIENT_SECRET. Do not pass TRADIER_IS_PAPER; BotSpot derives it from paperOrLive. Example credentialValues: {"TRADIER_ACCOUNT_NUMBER":"6AB12345","TRADIER_ACCESS_TOKEN":"token..."}. Charles Schwab (schwab): SCHWAB_ACCOUNT_NUMBER + SCHWAB_TOKEN. Example credentialValues: {"SCHWAB_ACCOUNT_NUMBER":"123456789","SCHWAB_TOKEN":"base64url-token-payload..."}. Tradovate (tradovate): TRADOVATE_USERNAME + TRADOVATE_DEDICATED_PASSWORD + TRADOVATE_CID + TRADOVATE_SECRET. Optional: TRADOVATE_APP_ID, TRADOVATE_APP_VERSION. Do not pass TRADOVATE_IS_PAPER; BotSpot derives it from paperOrLive. Example credentialValues: {"TRADOVATE_USERNAME":"username...","TRADOVATE_DEDICATED_PASSWORD":"dedicated-password...","TRADOVATE_CID":"client-id...","TRADOVATE_SECRET":"secret..."}. TopstepX (projectx-topstepx): PROJECTX_TOPSTEPX_API_KEY + PROJECTX_TOPSTEPX_USERNAME. Optional: PROJECTX_TOPSTEPX_PREFERRED_ACCOUNT_NAME. Example credentialValues: {"PROJECTX_TOPSTEPX_API_KEY":"key...","PROJECTX_TOPSTEPX_USERNAME":"username..."}. WEEX (weex): WEEX_API_KEY + WEEX_API_SECRET + WEEX_API_PASSPHRASE. Example credentialValues: {"WEEX_API_KEY":"key...","WEEX_API_SECRET":"secret...","WEEX_API_PASSPHRASE":"passphrase..."}. Bitunix (bitunix): BITUNIX_API_KEY + BITUNIX_API_SECRET. Optional: BITUNIX_TRADING_MODE. Example credentialValues: {"BITUNIX_API_KEY":"key...","BITUNIX_API_SECRET":"secret..."}. Kraken (kraken): KRAKEN_API_KEY + KRAKEN_API_SECRET. Example credentialValues: {"KRAKEN_API_KEY":"key...","KRAKEN_API_SECRET":"secret..."}. Coinbase (coinbase): COINBASE_API_KEY_NAME + COINBASE_PRIVATE_KEY. Optional: COINBASE_API_PASSPHRASE, COINBASE_SANDBOX. Example credentialValues: {"COINBASE_API_KEY_NAME":"organizations/.../apiKeys/...","COINBASE_PRIVATE_KEY":"-----BEGIN EC PRIVATE KEY-----..."}. Any other CCXT 4.5.64 exchange id (for example okx, binance, bybit, bitget, hyperliquid): use that id as the broker and the credentials it requires, named _API_KEY, _API_SECRET, _API_PASSPHRASE, _UID, _PRIVATE_KEY or _WALLET_ADDRESS. Do not pass _SANDBOX; BotSpot derives it from paperOrLive. Do not put data-provider API keys, screener rows, CSV data, workbooks, JSON dumps, or BotSpot internal keys here; use saved_env_vars(action="create") for non-broker runtime secrets.
action="prepare_paper": Prepare paper trading account
No other fields required. Prepares editable paper account creation inputs for the signed-in user. No account is created or funded by this tool. Use when the user wants a paper account creation button in chat. Pass name and initialBalance whenever the user supplied them; preserve those requested values in the prepared action. Omit them only when unspecified: name then defaults to Paper trading account and initialBalance to 10000 simulated USD. General broker, data and backtesting questions do not authorize account creation. Existing suitable connections should be reused for research. External MCP clients that want to create an account directly can use broker_connections(action="create_paper") instead.
action="create_paper": Create paper trading account
Required fields: requestId, name. Creates an internal simulated trading account and attaches it to its own saved broker connection for the authenticated user. Call only when the user requests a new paper account. Supply one UUID requestId per intended account; reuse that exact requestId, name and initialBalance on retries. For multiple accounts, use a distinct UUID for each account. initialBalance is virtual USD, defaults to 10000, and supports at most two decimals. No bank link or API keys are needed. A pending result is not ready or funded: use broker_connections(action="paper_progress") with the returned creationId to read progress. Only state ready includes the saved brokerCredentialId. Do not start a deployment until ready, and select that connection only when the user requests it. Returns metadata only, never provider credentials. Operational account and creation-rate limits apply.
action="paper_progress": Get paper account creation progress
Required fields: creationId. Reads the authenticated owner's paper account creation progress using the creationId returned by broker_connections(action="create_paper"). This read does not create or fund an account. Only state ready means its saved broker connection is ready. No credentials are returned.
action="manage_paper": Manage paper account cash or delete an account
Required fields: brokerCredentialId, requestId, operation. Change virtual USD cash in an existing internal paper account. Use only when the user requests this exact change. Select its exact brokerCredentialId from saved connections. operation add_cash adds amount, remove_cash subtracts amount, set_cash sets the cash balance (not total equity). Cash changes keep positions, orders and history. Do not call a cash adjustment a fresh-account reset. operation close removes the internal paper account from BotSpot immediately and automatically stops its bots, cancels orders, closes simulated positions and removes cash before provider closure. History stays. The user does not do these steps manually. Supply one UUID requestId per intended operation. Repeat identical inputs and requestId to continue pending or uncertain replies; never generate a fresh requestId to retry a transfer. For cash changes, only completed confirms funding. For close, pending means removed from BotSpot with automatic provider cleanup still in progress; do not claim provider closure until completed. rejected is a failure. The tool cannot manage externally linked or live accounts and never returns credentials.
action="paper_operation": Read paper account operation progress
Required fields: brokerCredentialId, operationId. Read a cash-change or deletion receipt by its exact brokerCredentialId and operationId. This read never submits funding or closes an account. To continue pending work, repeat broker_connections(action="manage_paper") with its original requestId and unchanged inputs.
action="paper_options": Read paper account options permission
Required fields: brokerCredentialId. Read the selected managed paper account options approved level, effective trading level and buying power. This does not submit an application or verify market-data access.
action="request_paper_options": Request paper account options permission
Required fields: brokerCredentialId, level. Request options trading permission for an explicitly selected owned managed paper account when the user asks. level 1 covers covered calls and cash-secured puts; 2 adds long calls/puts; 3 adds supported spreads. A pending, rejected or lower-level application is not full approval. Read the returned effective permission; quote/data subscriptions require a separate check. An uncertain error must be reconciled with a permission read before another submission. This does not trade, buy data, or change a live brokerage account.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "broker_connections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Used with action="prepare_paper", action="create_paper". Required for action="create_paper". | |
| level | No | Used with action="request_paper_options". Required for action="request_paper_options". | |
| action | Yes | Which operation to run: "connect_existing", "prepare_paper", "create_paper", "paper_progress", "manage_paper", "paper_operation", "paper_options", "request_paper_options". See the tool description for each one. | |
| amount | No | Used with action="manage_paper". | |
| broker | No | Used with action="connect_existing". Required for action="connect_existing". | |
| operation | No | Used with action="manage_paper". Required for action="manage_paper". | |
| requestId | No | Used with action="create_paper", action="manage_paper". Required for action="create_paper", action="manage_paper". | |
| creationId | No | Used with action="paper_progress". Required for action="paper_progress". | |
| displayName | No | Used with action="connect_existing". Required for action="connect_existing". | |
| operationId | No | Used with action="paper_operation". Required for action="paper_operation". | |
| paperOrLive | No | Used with action="connect_existing". Required for action="connect_existing". | |
| initialBalance | No | Used with action="prepare_paper", action="create_paper". | |
| credentialValues | No | Used with action="connect_existing". Required for action="connect_existing". | |
| brokerCredentialId | No | Used with action="manage_paper", action="paper_operation", action="paper_options", action="request_paper_options". Required for action="manage_paper", action="paper_operation", action="paper_options", action="request_paper_options". |