fidelity-mcp
This MCP server automates Fidelity brokerage tasks through a Playwright browser session, with user-driven login/2FA and dry-run safeguards for most trading actions.
Check browser/session status, log in via a visible browser window, and log out while keeping the saved session.
List Fidelity accounts and retrieve holdings/positions, including ticker, quantity, price, value, and cash balance.
Get last and extended-hours quotes for stocks/ETFs.
Preview or place stock/ETF buy/sell orders; dry runs are the default and actual placement requires explicit confirmation.
Stage an order in a visible Fidelity window and leave the final Place order click to the user; supports stock/ETF quantities and mutual-fund dollar amounts.
Run batch market/auto-limit orders sequentially in one account, with dry-run default.
Transfer cash between the user's Fidelity accounts immediately; no dry run.
Take debugging screenshots and inspect page buttons, links, form fields, and tables.
Note: the README also mentions a rebalance-planning tool, but it is not present in the provided server schema.
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., "@fidelity-mcp show me my Fidelity account balances and current 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.
fidelity-mcp
MCP server for Fidelity brokerage accounts via Playwright browser automation.
Warning: Fidelity has no public API. This automates the website, which may violate their Terms of Service. Use at your own risk.
Setup
Requires Node 22+.
npm install
npx playwright install firefox
npm run build
claude mcp add fidelity -s user -- node "$(pwd)/dist/index.js"Related MCP server: fidelity-mcp
Logging in
You always log in yourself; the server never sees your password.
From Claude: ask it to log in.
fidelity_loginopens a browser window (Playwright's Firefox, branded "Nightly"). Log in and complete 2FA there; the window closes when the portfolio summary loads.From a terminal:
npm run logindoes the same.
The session is saved to ~/.fidelity-mcp/fidelity_session_default.json and reused by later tool calls. When it expires, tools say so; log in again.
Tools
fidelity_status, fidelity_login, fidelity_logout, fidelity_get_accounts, fidelity_get_positions, fidelity_get_quote, fidelity_place_order, fidelity_stage_order, fidelity_batch_orders, fidelity_rebalance_plan, fidelity_transfer, fidelity_screenshot, fidelity_page_content.
Orders and transfers default to dry_run: true (preview or review step only). Stocks/ETFs trade by share quantity, mutual funds by dollar amount. fidelity_stage_order fills and previews an order in a visible window and leaves the final Place order click to you. fidelity_rebalance_plan turns target weights into a list of orders without placing any. Positions include cost basis and total gain/loss when Fidelity shows them.
Environment variables
All optional.
Variable | Description |
|
|
| Session directory (default: |
| Session file suffix, for multiple logins |
| Default timeout in ms (default: |
Troubleshooting
Symptom | Fix |
"Session expired or not logged in" | Log in again ( |
Code changes have no effect |
|
"Something went wrong" during 2FA | Stop retrying (lockout risk); wait and try once later |
See CLAUDE.md for architecture and rules for AI agents.
Available Tools
12 toolsfidelity_batch_ordersB
Run several market/auto-limit orders one after another in one account. Dry run by default.
Inputs: orders (required), account_number (required), dry_run.
fidelity_get_accountsA
List Fidelity accounts (number and nickname). For balances use fidelity_get_positions.
Inputs: no named parameters.
fidelity_get_positionsA
Get holdings for every account from Fidelity's positions CSV: ticker, quantity, price, value, and cash balance (balance).
Inputs: no named parameters.
fidelity_get_quoteB
Get the last price (and extended-hours price when available) for a stock/ETF from the trade ticket.
Inputs: symbol (required).
fidelity_loginA
Open a visible browser window on Fidelity's sign-in page so the USER can log in and complete 2FA themselves. Waits up to 10 minutes, then saves the session. Never asks for or types credentials. Call once when a tool reports the session expired; don't retry in a loop.
Inputs: no named parameters.
fidelity_logoutB
Close the browser. The saved session stays on disk for the next tool call.
Inputs: no named parameters.
fidelity_page_contentA
List the page's buttons, links, form fields and tables (id, aria-label, text), optionally after opening a Fidelity URL. For fixing selectors.
Inputs: url.
fidelity_place_orderA
Buy or sell a stock/ETF. Dry run by default (preview only). Penny stocks (< $1) and extended hours always use limit orders; without limit_price the limit is one tick past the last price. The result shows the exact order (including limit price) for the user to confirm.
Inputs: action (required), symbol (required), quantity (required), account_number (required), +3 more.
fidelity_screenshotA
Screenshot the browser page, optionally after opening a Fidelity URL. For debugging selectors.
Inputs: url.
fidelity_stage_orderA
Set up a buy/sell for the USER to place: opens a visible Fidelity window, fills the trade ticket, clicks Preview, verifies it, and leaves it on the preview screen. The user clicks Place order (or Cancel) there; this tool never places. Stocks/ETFs take quantity (whole shares); mutual funds (5-letter tickers ending in X, e.g. FSKAX) take amount in dollars and fill at the next NAV. Tell the user the window is open.
Inputs: action (required), symbol (required), account_number (required), amount, +3 more.
fidelity_statusA
Report whether the browser is running, whether it is on a sign-in page, and when the session was last saved. Does not navigate.
Inputs: no named parameters.
fidelity_transferA
Move cash between two of the user's Fidelity accounts. Has no dry run: it submits immediately, so only call after the user confirmed from, to and amount.
Inputs: amount (required), to_account (required), from_account (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target distinct actions: status/login/logout cover auth, get_accounts vs get_positions vs get_quote cover data, and screenshot vs page_content are split for debugging. The order trio (place_order dry-run, stage_order user-confirmed, batch_orders multi-order) is the main risk; descriptions clarify the boundaries but an agent could still hesitate between place_order and batch_orders for a single account.
All tools use a consistent fidelity_ prefix and snake_case, with verb_noun patterns like get_positions, place_order, stage_order, batch_orders. The one deviation is fidelity_status, a bare noun rather than a verb phrase, but it stays readable and predictable.
Twelve tools is well-scoped for a brokerage automation server, with each tool covering a distinct stage: auth, read, trade, transfer, and debugging. Nothing feels padded or missing at the count level.
The surface covers the full lifecycle: session status, login/logout, accounts, positions, quotes, order placement (dry-run, staged, batch), transfers, and selector debugging. Gaps are minor but real: no order status/cancel or order history, and no transaction history, which an agent may need after placing or staging an order.
Related MCP Connectors
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Let your AI agent operate any website through a real, logged-in browser session.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Fidelity Investments brokerage accounts using Playwright browser automation to manage balances, positions, and trades. It supports secure 2FA authentication and session persistence for seamless account management via Claude.134MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to read balances, positions, and transaction history, and place limit sell orders on Fidelity Investments accounts via Playwright browser automation.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Robinhood brokerage accounts via browser automation, supporting portfolio viewing, quotes, trading, and account management.810 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables browser automation and web interaction control through Playwright, allowing Claude Code to navigate, click, fill forms, take screenshots, and manage sessions.100 npm9MIT