mcp-tastytrade-server
The mcp-tastytrade-server lets you manage your TastyTrade brokerage account, place trades, and retrieve market data through an MCP client. Key capabilities:
Account Management: list accounts, view balances & buying power, get open positions, retrieve transaction history (with date filtering and pagination), and access customer watchlists.
Order Management: view orders filtered by status (e.g., Live, Filled, Cancelled, Rejected); place live orders (Limit, Market, Stop, Stop Limit, Notional Market) for equities, equity options, futures, and future options; cancel orders; and validate orders without placing (
dry_run_order) to check buying power impact, fees, and warnings. Option symbols are auto-formatted to OCC standard.Market Data & Research: fetch option chains (nested by expiry or as a compact flat list); get market metrics (IV rank, IV percentile, 30-day IV, liquidity) for one or more symbols; search equities by symbol or partial term, optionally filtering by lendability (Easy To Borrow, Locate Required, Preborrow Required).
Security & Safety: uses OAuth2 (no password stored); supports a sandbox environment (
TASTYTRADE_SANDBOX=true) for risk-free testing; dry-run orders let you preview costs and buying power effects before committing real capital.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-tastytrade-server show my open positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-tastytrade-server
An MCP server that exposes the TastyTrade brokerage API as tools for Claude and other MCP-compatible clients.
Features
Tool | Description |
| List all accounts |
| Open positions for an account |
| Balances and buying power |
| Orders (filterable by status) |
| Validate an order — fees, BP impact, warnings |
| Place a live order |
| Cancel a live order |
| Option chain (nested by expiry or compact flat list) |
| IV rank, IV percentile, 30-day IV, liquidity |
| Transaction history |
| Search equity instruments by symbol |
| Customer watchlists |
Related MCP server: TastyTrade MCP Server
Setup
1. Install dependencies
pip install -e .
# or with uv:
uv pip install -e .2. OAuth2 setup
This server authenticates with OAuth2 — a scoped, revocable refresh token — instead of your TastyTrade account password. Your actual login credentials are never entered anywhere in this project.
Go to my.tastytrade.com → Manage → My Profile → API → OAuth Applications.
Click + New OAuth Client, give it any name, and set a redirect URI (e.g.
http://localhost) — it's required but unused by the personal-grant flow below.Save the app, then note the Client Secret shown (it's only displayed once).
Click Manage on the new app → Create Grant to issue yourself a Personal Grant. Copy the Refresh Token shown (also only displayed once).
Copy the env template and fill in those two values:
cp .env.example .envVariable | Required | Description |
| Yes | Client secret from the OAuth application |
| Yes | Refresh token from the personal grant |
| No | Set to |
The refresh token doesn't expire on its own — if you ever want to cut off access, revoke the grant at my.tastytrade.com and generate a new one, no password change required.
3. Test the connection
python scripts/smoke_test.pyThis runs every read-only tool (get_accounts, get_balances, get_positions,
get_orders, search_equities, get_market_metrics, get_option_chain,
get_watchlists) through the same list_tools()/call_tool() interface a
real MCP client uses, and prints PASS/FAIL for each. It never places or
cancels orders. Requires .env to be filled in (step 2).
4. Configure Claude Desktop
Add the following to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"tastytrade": {
"command": "mcp-tastytrade",
"env": {
"TASTYTRADE_CLIENT_SECRET": "your_client_secret",
"TASTYTRADE_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Or using uv run without installing:
{
"mcpServers": {
"tastytrade": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/mcp-tastytrade-server", "mcp-tastytrade"],
"env": {
"TASTYTRADE_CLIENT_SECRET": "your_client_secret",
"TASTYTRADE_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Option symbol format
Options use the OCC 21-character format: SYMBOL YYMMDDCPRICE
Examples:
AAPL 241220C00200000— AAPL $200 call expiring 2024-12-20SPY 241220P00580000— SPY $580 put expiring 2024-12-20
The get_option_chain tool returns symbols already formatted correctly.
Development
# Run directly
python -m mcp_tastytrade.server
# Or via the installed script
mcp-tastytradeSecurity
Authentication uses OAuth2 (client secret + refresh token) — your TastyTrade account password is never used or stored anywhere in this project.
Credentials are passed via environment variables only.
The
.envfile is in.gitignoreand must never be committed.Access tokens are short-lived (~15 minutes), held in memory only, and refreshed automatically.
To revoke access at any time, delete the grant at my.tastytrade.com — no password change needed.
Use
TASTYTRADE_SANDBOX=truefor testing — the certification environment uses separate accounts with no real money.
Available Tools
12 toolscancel_orderC
Cancel a live order on a TastyTrade account.
Inputs: order_id (required), account_number (required).
dry_run_orderA
Validate an order without placing it. Returns buying power effect, fees, and any warnings.
Inputs: legs (required), order_type (required), price_effect (required), time_in_force (required), +2 more.
get_accountsA
List all TastyTrade accounts for the authenticated customer.
Inputs: no named parameters.
get_balancesC
Get current balances and buying power for a TastyTrade account.
Inputs: account_number (required).
get_market_metricsB
Get market metrics for one or more symbols: IV rank, IV percentile, 30-day IV, liquidity rating, and more.
Inputs: symbols (required).
get_option_chainA
Get the option chain for an underlying symbol. Use format='nested' (default) for expirations grouped by date, or format='compact' for a flat list.
Inputs: symbol (required), format.
get_ordersC
Get orders for a TastyTrade account, optionally filtered by status.
Inputs: account_number (required), status.
get_positionsB
Get current open positions for a TastyTrade account.
Inputs: account_number (required).
get_transactionsC
Get transaction history for a TastyTrade account.
Inputs: account_number (required), end_date, per_page, start_date.
get_watchlistsA
Get all watchlists for the authenticated customer.
Inputs: no named parameters.
place_orderB
Place a new order on a TastyTrade account. Use dry_run_order first to validate the order and check buying power impact.
Inputs: legs (required), order_type (required), price_effect (required), time_in_force (required), +2 more.
search_equitiesC
Search for equity instruments by symbol.
Inputs: symbol (required), lendability.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a distinct purpose clearly described. get_positions and get_balances are separate, place_order and dry_run_order are complementary but distinct, no overlapping functionality.
All tools follow a consistent verb_noun pattern with underscores (e.g., get_accounts, cancel_order, dry_run_order). The verbs vary but are appropriate and predictable.
12 tools cover the essential operations for a trading platform without being excessive. Each tool serves a clear need, and the count is within the ideal range.
Core workflows like account information, order management, and market data are covered. Minor gaps exist, such as no modify order or create watchlist, but agents can work around these with the available tools.
Related MCP Connectors
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Agentic brokerage access to a US brokerage account: quotes, orders, positions, cash and documents.
Build and backtest investing strategies from your AI assistant. Remote MCP with OAuth sign-in.
1Trade Robinhood through natural language in Claude Code.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading operations for stocks, options, crypto, and portfolio management via Alpaca's Trading API through AI assistants.MIT
- AlicenseNot gradedqualityDmaintenanceConnects your TastyTrade trading account to AI assistants like Claude Desktop and ChatGPT for conversational trading and portfolio management.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to scan markets, build option strategies, track positions, and execute trades on TastyTrade via the Model Context Protocol.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables natural-language paper trading with real-time market data, FinBERT sentiment analysis, conditional orders, and price alerts.-