Skip to content
Back to search

tasty-agent

Let Claude manage your tastytrade portfolio.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ferdousbhai--tasty-agent/badge.svg)](/listings/ferdousbhai--tasty-agent)

HTML

<a href="/listings/ferdousbhai--tasty-agent"><img src="/api/listings/ferdousbhai--tasty-agent/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/plugin.json · Manifest · 28 lines
  1. {
  2. "name": "tasty",
  3. "version": "7.1.0",
  4. "description": "TastyTrade brokerage integration for account management and trading",
  5. "author": {
  6. "name": "Ferdous",
  7. "email": "ferdous@hey.com"
  8. },
  9. "repository": "https://github.com/ferdousbhai/tasty-agent",
  10. "license": "MIT",
  11. "keywords": [
  12. "tastytrade",
  13. "brokerage",
  14. "trading",
  15. "options"
  16. ],
  17. "commands": "./commands/",
  18. "skills": "./skills/",
  19. "mcpServers": {
  20. "tasty-agent": {
  21. "command": "npx",
  22. "args": [
  23. "-y",
  24. "tasty-agent@7"
  25. ]
  26. }
  27. }
  28. }
README.md · README · 178 lines
  1. # tasty-agent: A TastyTrade MCP Server
  2. [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/ferdousbhai/tasty-agent)](https://archestra.ai/mcp-catalog/ferdousbhai__tasty-agent)
  3. A Model Context Protocol server for TastyTrade brokerage accounts. Enables LLMs to monitor portfolios, analyze positions, and execute trades. Features automated IV analysis prompts and compact tool output.
  4. Written in TypeScript against the Tastytrade REST API and DXLink directly (no SDK). The same code runs locally over stdio (`npx tasty-agent`) or as a remote MCP server on Cloudflare Workers.
  5. > **v7 is a rewrite.** The Python package (`uvx tasty-agent`, 6.x) is replaced by the npm package, and the Modal deployment by Cloudflare Workers. Tool names are unchanged. What differs from 6.x:
  6. > - `get_quotes` no longer takes `timeout`: quotes come from REST market data, so they also answer outside market hours.
  7. > - `get_greeks` accepts at most 100 contracts and a `timeout` of at most 30 seconds.
  8. > - Orders and replacements are refused when the broker's dry run returns any warning.
  9. > - A cancel, order, or watchlist change the broker may have applied without answering reports an unknown outcome instead of failing.
  10. > - Prices are rounded with the broker's tick schedules read as upper bounds (e.g. sub-penny below $1, a cent from $1), and futures options can now be priced.
  11. > - The `GTD` time-in-force and the local SSE/HTTP transports are gone; a blank `TASTYTRADE_ACCOUNT_ID` counts as unset.
  12. ## Trading options?
  13. tasty-agent gives your agent your tastytrade account and leaves the judgement to it. [spicytrade](https://spicy.trade) is the hosted version with guard rails, built on this client: a public market table with IV rank and term structure, a catalyst calendar and a daily options brief, and for signed-in members, orders limited to defined-risk trades that pass tastytrade's dry run. Try the market data and the brief first:
  14. ```bash
  15. claude mcp add --transport http spicytrade https://spicy.trade/mcp
  16. ```
  17. Any MCP client that speaks Streamable HTTP can use the same address. The public tier needs no account and no install. Nothing it returns, the brief included, is investment advice.
  18. ## Authentication
  19. **OAuth Setup**:
  20. 1. Create an OAuth app at https://my.tastytrade.com/app.html#/manage/api-access/oauth-applications
  21. 2. Check all scopes, save your client ID and client secret
  22. 3. Create a "New Personal OAuth Grant" in your OAuth app settings (check all scopes)
  23. 4. Copy the generated refresh token
  24. 5. Configure the MCP server with your credentials (see Usage below)
  25. | Variable | Required | Notes |
  26. | --- | --- | --- |
  27. | `TASTYTRADE_CLIENT_SECRET` | yes | OAuth app client secret |
  28. | `TASTYTRADE_REFRESH_TOKEN` | yes | Personal OAuth grant refresh token |
  29. | `TASTYTRADE_ACCOUNT_ID` | no | Needed only when the grant exposes several accounts; otherwise the one account is used |
  30. | `TASTYTRADE_API_BASE` | no | Defaults to `https://api.tastyworks.com`; use `https://api.cert.tastyworks.com` for the sandbox |
  31. | `MCP_BEARER_TOKEN` | Cloudflare only | Clients must send `Authorization: Bearer <token>` |
  32. ## MCP Tools
  33. ### Account & Portfolio
  34. - **`account_overview(include=["balances","positions"])`** - Account balances (including net liquidating value) and open positions.
  35. ### Market Data & Research
  36. - **`get_quotes(instruments)`** - Live bid/ask/mid quotes for stocks, options, futures, and indices (indices without a two-sided market report their last price)
  37. - **`get_greeks(options, timeout=10.0)`** - Greeks (delta, gamma, theta, vega, rho) for equity and futures options via DXLink streaming (up to 100 contracts, timeout at most 30s)
  38. - **`get_market_metrics(symbols)`** - IV rank, percentile, beta, liquidity for multiple symbols
  39. - **`market_status(exchanges=['Equity'])`** - Market hours, status, holidays, and current NYC time ('Equity', 'CME', 'CFE', 'Smalls')
  40. - **`search_symbols(symbol, limit=10)`** - Search for symbols by name/ticker
  41. ### History
  42. - **`get_history(type, days=None, underlying_symbol=None, transaction_type=None, page_offset=0, limit=25)`** - Transaction history (`type="transactions"`, default 90 days) or order history (`type="orders"`, default 7 days). Paginated — use `page_offset` and `limit` for large result sets. Filter transactions by `"Trade"` or `"Money Movement"`.
  43. ### Order Management
  44. - **`place_order(legs, target_value=None, time_in_force="Day", dry_run=false)`** - Place multi-leg orders with quote-derived mid pricing only. The tool fetches live quotes for the exact resolved instruments, computes the signed net mid, validates the final limit against bid/ask guardrails, and optionally sizes quantity from `target_value`.
  45. - `quantity` is the actual share/contract count. `target_value=50000` sizes an equity or equity-option order from quote-derived pricing; omit `quantity` for single-leg target-value orders. For multi-leg spreads with `target_value`, use `quantity` only to express the leg ratio, such as 1:1 or 2:1.
  46. - Order prices are aligned to the broker's valid tick grid before submission. If tick-size data is unavailable, the tool fails before placement instead of submitting an invalid price increment.
  47. - Every order is sent to the broker as a dry run first. Any dry-run warning refuses the order; `dry_run=true` returns the preview and marks such an order `blocked`.
  48. - If the broker does not answer a submission (timeout or 5xx), the tool reports an unknown outcome and never retries; check `list_orders` before placing again. Cancels and watchlist changes are handled the same way.
  49. - Equities and options use `Buy to Open`, `Buy to Close`, `Sell to Open`, or `Sell to Close`; futures use `Buy` or `Sell`.
  50. - **`replace_order(order_id)`** - Reprice an existing live order at the current quote-derived mid (dry-run checked the same way).
  51. - **`cancel_order(order_id)`** - Cancel an order.
  52. - **`list_orders()`** - Get all live orders.
  53. - Tool outputs are compact: quote tables include actionable bid/ask/mid/size fields; order results include compact order, buying-power, fee, warning, pricing, and sizing summaries.
  54. ### Watchlist Management
  55. - **`watchlist(action, ...)`** - Unified watchlist management:
  56. - `action="list"` - No `name` returns compact watchlist metadata (`name`, `group`, `symbol_count`); with `name`, returns compact symbol entries.
  57. - `action="add"` - Add symbols to a watchlist (creates if doesn't exist)
  58. - `action="remove"` - Remove symbols from a watchlist
  59. - `action="delete"` - Delete a watchlist
  60. ### MCP Prompts
  61. - **IV Rank Analysis** - Automated prompt to analyze IV rank extremes across positions and watchlists for entry/exit opportunities
  62. All broker requests, including token refreshes, share one two-requests-per-second gate (per process locally, one Durable Object on Cloudflare).
  63. ## Usage
  64. ### Local (stdio)
  65. Requires Node.js 22+. Add to your MCP client configuration (e.g., `claude_desktop_config.json`):
  66. ```json
  67. {
  68. "mcpServers": {
  69. "tastytrade": {
  70. "command": "npx",
  71. "args": ["-y", "tasty-agent@7"],
  72. "env": {
  73. "TASTYTRADE_CLIENT_SECRET": "your_client_secret",
  74. "TASTYTRADE_REFRESH_TOKEN": "your_refresh_token"
  75. }
  76. }
  77. }
  78. }
  79. ```
  80. Add `"TASTYTRADE_ACCOUNT_ID": "your_account_id"` only if your grant exposes more than one account.
  81. ### Remote (Cloudflare Workers)
  82. The Worker is configured in `cloudflare.config.ts` and deployed with the [`cf` CLI](https://www.npmjs.com/package/cf). From a checkout:
  83. ```bash
  84. npm install
  85. npx cf auth login
  86. npm run deploy # builds and deploys the Worker
  87. # with the values exported in your shell; MCP_BEARER_TOKEN is e.g. the output of: openssl rand -hex 32
  88. for name in TASTYTRADE_CLIENT_SECRET TASTYTRADE_REFRESH_TOKEN MCP_BEARER_TOKEN; do
  89. npx cf workers secrets update "$name" --worker tasty-agent --text "${!name}"
  90. done
  91. # only for multi-account grants:
  92. npx cf workers secrets update TASTYTRADE_ACCOUNT_ID --worker tasty-agent --text "$TASTYTRADE_ACCOUNT_ID"
  93. ```
  94. The server is then at `https://tasty-agent.<your-subdomain>.workers.dev/mcp` (streamable HTTP). Connect with the bearer token, for example in Claude Code:
  95. ```bash
  96. claude mcp add --transport http tastytrade https://tasty-agent.<your-subdomain>.workers.dev/mcp \
  97. --header "Authorization: Bearer $MCP_BEARER_TOKEN"
  98. ```
  99. To redeploy on every push, connect your fork under the Worker's **Settings → Builds** in the Cloudflare dashboard, with build command `npm run workers-builds:build` and deploy command `npx cf deploy --prebuilt`; a failing check stops the deploy.
  100. The Worker serves only your own account: anyone holding the bearer token can trade it, so treat the token like the refresh token.
  101. ### Reusing the Tastytrade client
  102. The REST client, rate gate, tick-size rules, and DXLink feed have no MCP dependency and are exported separately:
  103. ```ts
  104. import { createTastytradeClient, IntervalGate, collectFeedEvents } from 'tasty-agent/tastytrade'
  105. ```
  106. `createTastytradeClient` authenticates with either an OAuth grant it refreshes itself (`clientSecret` / `refreshToken`, each a string or an async getter read only when a token is minted) or a caller-minted `accessToken`, which is never refreshed or retried. Every request, including token refreshes, goes through the `gate` you pass. `request(path, { raw: true })` returns the whole response body (with `pagination`), and `signal` aborts a request early. A mutation that fails without a definite answer raises `TastytradeOutcomeUnknownError`. spicytrade uses this client for its own transport.
  107. ## Examples
  108. ```
  109. "Get my account balances and current positions"
  110. "What's my net liquidating value?"
  111. "Get real-time quotes for SPY and AAPL"
  112. "Get quotes for a TQQQ call at strike 100 expiring YYYY-MM-DD" (use a concrete listed expiration)
  113. "Get Greeks for an AAPL put at strike 150 expiring YYYY-MM-DD" (use a concrete listed expiration)
  114. "Get Greeks for an /ES call at strike 5800 expiring YYYY-MM-DD" (use a concrete listed expiration)
  115. "Buy to open 100 AAPL shares at mid"
  116. "Buy to open 17 TQQQ calls at strike 100 expiring YYYY-MM-DD" (use a concrete listed expiration)
  117. "Buy $50K of TSLA calls at strike 300 expiring YYYY-MM-DD" (use a concrete listed expiration)
  118. "Place an AAPL 150/155 call spread expiring YYYY-MM-DD" (use a concrete listed expiration)
  119. "Buy one /ES-CONTRACT future at mid" (use a concrete active contract symbol)
  120. "Reprice order 12345 at mid"
  121. "Cancel order 12345"
  122. "Show my live orders"
  123. "Get my trading history from January"
  124. "Get my order history for SPY"
  125. "Get my private watchlists"
  126. "Add TSLA and NVDA to my tech watchlist"
  127. ```
  128. ## Development
  129. ```bash
  130. npm install
  131. npm run check # type-check the Node and Worker builds
  132. npm test # unit tests; test/integration.test.ts runs live only when credentials are set
  133. npm run dev # local Worker via Vite (put secrets in .dev.vars, see .dev.vars.example)
  134. # Debug with MCP inspector
  135. npm run build && npx @modelcontextprotocol/inspector node dist/stdio.js
  136. ```
  137. ## License
  138. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.