Skip to main content
Glama
claude-fidelity-mcp

claude-fidelity-mcp

by TylerFlar

@tasque/fidelity-mcp

通过 Playwright 浏览器自动化实现富达(Fidelity)经纪账户的 MCP 服务器。

警告 — 富达没有公开 API。此工具通过自动化网页界面实现,这可能违反其服务条款。

工具

工具

描述

fidelity_login

登录富达(支持 TOTP 和短信 2FA)

fidelity_submit_2fa

提交短信 2FA 验证码

fidelity_get_accounts

列出所有账户及其余额

fidelity_get_positions

获取所有账户的持仓情况

fidelity_transfer

在富达账户之间转账现金

fidelity_get_quote

获取当前股票/ETF 价格

fidelity_place_order

下买入/卖出订单(默认为 dry_run 试运行模式)

fidelity_batch_orders

依次下多个订单(默认为 dry_run 试运行模式)

fidelity_status

检查浏览器会话状态

fidelity_logout

关闭会话并保存 Cookie

fidelity_save_session

将浏览器状态保存到磁盘

fidelity_screenshot

截取全页屏幕截图

fidelity_page_content

获取页面 URL 和交互元素

Related MCP server: fidelity-mcp

环境变量

变量

必需

描述

FIDELITY_USERNAME

是

富达登录用户名

FIDELITY_PASSWORD

是

富达登录密码

FIDELITY_TOTP_SECRET

否

用于自动 2FA 的 Base32 TOTP 密钥

FIDELITY_HEADLESS

否

设置为 "false" 以显示浏览器(默认:true)

FIDELITY_SESSION_DIR

否

会话持久化目录(默认:~/.fidelity-mcp)

FIDELITY_SESSION_TITLE

否

用于多个账户的会话文件标识符

FIDELITY_DEBUG

否

设置为 "true" 以开启调试日志

FIDELITY_TIMEOUT

否

默认超时时间(毫秒,默认:30000)

身份验证设置

设置 FIDELITY_USERNAME 和 FIDELITY_PASSWORD。如需自动 2FA,请从“富达安全设置 > 身份验证器应用 > 无法扫描代码?”中获取您的 TOTP 密钥并设置 FIDELITY_TOTP_SECRET。如果没有 TOTP,服务器将回退到短信 2FA(需要调用 fidelity_submit_2fa)。

需要 Playwright Firefox:npx playwright install firefox

开发

npm install
npx playwright install firefox
npm run build
npm start        # stdio mode

Available Tools

13 tools
fidelity_batch_ordersA

Place multiple buy/sell orders sequentially in a single account. Useful for portfolio rebalancing. Each order is placed one at a time. Returns results for each order.

Inputs: account_number (required), orders (required), dry_run.

fidelity_get_accountsB

List all Fidelity accounts with their names, numbers, and optionally withdrawal balances.

Inputs: include_balances.

fidelity_get_positionsA

Get all positions (holdings) across all Fidelity accounts. Returns account details with stock ticker, quantity, price, and value for each holding.

Inputs: no named parameters.

fidelity_get_quoteB

Get the current price for a stock/ETF symbol via Fidelity's trade page.

Inputs: symbol (required).

fidelity_loginA

Log in to Fidelity. Supports TOTP 2FA (automatic) and SMS 2FA (requires follow-up with fidelity_submit_2fa). Credentials can be passed directly or via env vars FIDELITY_USERNAME, FIDELITY_PASSWORD, FIDELITY_TOTP_SECRET.

Inputs: username, password, totp_secret.

fidelity_logoutA

Close the Fidelity browser session and save cookies for faster re-login next time.

Inputs: no named parameters.

fidelity_page_contentA

Get the current page URL and key HTML structure. Useful for debugging when selectors fail.

Inputs: url.

fidelity_place_orderA

Place a buy or sell order for a stock/ETF on Fidelity. Supports market and limit orders. Use dry_run=true to preview without executing. For penny stocks (<$1) and extended hours, limit orders are used automatically.

Inputs: account_number (required), symbol (required), action (required), quantity (required), +3 more.

fidelity_save_sessionA

Manually save the current browser session state (cookies/localStorage) for persistence across restarts.

Inputs: no named parameters.

fidelity_screenshotA

Take a screenshot of the current Fidelity browser page. Useful for debugging when tools return unexpected results.

Inputs: url.

fidelity_statusA

Check whether the Fidelity browser session is active and logged in.

Inputs: no named parameters.

fidelity_submit_2faA

Submit the SMS 2FA code received on your phone to complete Fidelity login. Only use this after fidelity_login returns needsSms2FA=true.

Inputs: code (required).

fidelity_transferA

Transfer cash between two Fidelity accounts. Validates available balance before submitting.

Inputs: from_account (required), to_account (required), amount (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool has a unique and clear purpose (login, logout, get accounts, place orders, etc.). No two tools overlap in functionality, and the descriptions clearly differentiate them.

    Naming Consistency5/5

    All tools follow a consistent 'fidelity_verb_noun' pattern in snake_case (e.g., fidelity_get_accounts, fidelity_place_order). This makes the set predictable and easy to navigate.

    Tool Count5/5

    With 13 tools, the server covers essential Fidelity operations (login, orders, transfers, debugging) without being bloated. Each tool feels necessary for the domain.

    Completeness4/5

    The tool set covers core workflows: login, account info, quotes, orders (single & batch), transfers, and session management. Minor gaps like order cancellation or history exist, but the surface is strong for its stated purpose.

    Related MCP Connectors

    Related MCP Servers