Private per-account portfolio · Free API key

Track your positions from your AI assistant or a spreadsheet

Tell Claude, ChatGPT, or any MCP-capable agent what you bought and it lands in a portfolio only your account can see. Or upload the CSV / Excel export your broker already gives you. Read it back from the website or from any assistant holding your key. Never connects to a broker, never places orders.

https://www.stashgamma.com/api/dataapi/mcp

1. Get a free API key

Sign in, open Profile → Developer API and click Get free key. The key is issued to your account, which is what keeps your portfolio separate from everyone else's — an assistant holding it can only see and change your positions.

2. Connect your assistant

Claude Code:

claude mcp add --transport http stashgamma https://www.stashgamma.com/api/dataapi/mcp --header "X-Api-Key: sg_live_..."

Claude.ai / Claude Desktop (Settings → Connectors → Add custom connector), or any client that only takes a URL:

https://www.stashgamma.com/api/dataapi/mcp/sg_live_...

OpenAI Responses API:

{ "type": "mcp", "server_label": "stashgamma", "server_url": "https://www.stashgamma.com/api/dataapi/mcp",
  "headers": { "X-Api-Key": "sg_live_..." }, "require_approval": "never" }

Full click-by-click setup on the Claude & ChatGPT guide.

3. Just tell it what you hold

  • “Add 100 shares of NVDA at 120.50 to my portfolio.”
  • “I bought 50 more AAPL at 230 — merge it into my existing lot.”
  • “Here is my broker export, import it: symbol,qty,cost\nMSFT,40,412.10\nQQQ,25,690”
  • “What am I holding and what is my total cost basis?”
  • “Remove my short TSLA position.”
  • “Pull the latest close for everything in my portfolio and tell me the unrealized P&L.”

The last prompt combines the portfolio tools with get_latest_quote from the same server — the assistant reads your positions, fetches each close, and does the arithmetic.

4. Or upload a CSV / Excel file

On Profile → Portfolio choose a .csv, .xlsx or .xls file. Columns are matched by header name, so most broker exports work unchanged. A headerless file is read as symbol, quantity, avgCost, side.

symbol,quantity,avgCost,side,notes
NVDA,100,120.50,Long,core
AAPL,50,230.00,Long,
QQQ,3,690.00,Short,hedge
Recognized headers
symbol / ticker · quantity / qty / shares · avgCost / cost / price / entry · side / direction · notes / comment
Rules
Same symbol + side rows merge with a weighted average cost · negative quantity = Short · $ and , are fine · up to 2,000 rows · merge keeps what is not in the file, replace makes the file the whole portfolio

The five tools

ToolInputReturns
get_portfolio_positionsportfolio? (named list, default "default")symbol, side, quantity, average cost, cost basis, notes — plus the total cost basis
add_portfolio_positionwritesymbol, quantity, avg_cost?, side? (Long|Short), notes?, mode? (replace | add)the saved position; "add" merges into an existing lot with a quantity-weighted average cost
import_portfolio_csvwritecsv text, mode? (merge | replace)counts added / updated / removed and any per-row errors
remove_portfolio_positionwritesymbol, side?the removed position
clear_portfoliowriteconfirm: true, portfolio?number of positions removed

Write tools are annotated destructiveHint, so assistants ask before running them; clear_portfolio also requires confirm: true. Each call counts as one request against the same hour/day/week quota as the EOD data tools. Errors come back as isError tool results, so the agent can read the reason and fix its input.

How isolation works

  • Positions are stored under your account id. Every read and write is scoped to that id on the server — there is no way to name another user.
  • Over MCP the account comes from the API key. Rotating the key (Profile → Developer API) instantly cuts off any assistant still holding the old one.
  • The key-free public options analyzer server has no portfolio tools at all — anonymous callers have no account to write into.
  • Uploads are parsed on the server with the same rules as the MCP importer; your file is not stored, only the positions it yields.

Your positions, wherever you ask about them

Get a free key, connect your assistant, or just upload the file. Not investment advice — a tracker, not a broker.