Skip to main content
Glama
fidelity-mcp

fidelity-mcp

by jiaweitang22

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_login opens 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 login does 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

FIDELITY_HEADLESS

"false" to show the server's browser (default: headless)

FIDELITY_SESSION_DIR

Session directory (default: ~/.fidelity-mcp)

FIDELITY_SESSION_TITLE

Session file suffix, for multiple logins

FIDELITY_TIMEOUT

Default timeout in ms (default: 30000)

Troubleshooting

Symptom

Fix

"Session expired or not logged in"

Log in again (fidelity_login or npm run login)

Code changes have no effect

npm run build, then reload the MCP server (/mcp or restart)

"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 tools
fidelity_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

    A3.7/5.0

    Scored across 12 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      13
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to read balances, positions, and transaction history, and place limit sell orders on Fidelity Investments accounts via Playwright browser automation.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to interact with Robinhood brokerage accounts via browser automation, supporting portfolio viewing, quotes, trading, and account management.
      8
      10 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables browser automation and web interaction control through Playwright, allowing Claude Code to navigate, click, fill forms, take screenshots, and manage sessions.
      100 npm
      9
      MIT