claude-fidelity-mcp
Click on "Install 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., "@claude-fidelity-mcpshow me my current portfolio positions and account balances"
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.
claude-fidelity-mcp
MCP server for interacting with Fidelity Investments brokerage accounts from Claude / Claude Code.
Since Fidelity has no public retail API, this uses Playwright browser automation (Firefox) to control Fidelity's web interface, with stealth measures and session persistence to minimize re-authentication.
Features
Login with 2FA - Supports automatic TOTP (authenticator app) and interactive SMS verification
Session persistence - Saves cookies/localStorage so you don't re-login every time
Account listing - View all accounts with names, numbers, and balances
Portfolio positions - Get all holdings across accounts (ticker, quantity, price, value)
Stock quotes - Get current and extended-hours prices
Order placement - Buy/sell stocks with market or limit orders (dry-run by default)
Transfers - Move cash between Fidelity accounts
Penny stock handling - Auto-switches to limit orders for stocks under $1
Extended hours - Automatically enables and adjusts for pre/post-market trading
Tools
Tool | Description |
| Log in with username/password + TOTP or SMS 2FA |
| Complete SMS 2FA with the code from your phone |
| List all accounts with names, numbers, balances |
| Get all holdings across all accounts |
| Get current price for a stock/ETF symbol |
| Buy/sell stocks (dry-run by default) |
| Transfer cash between Fidelity accounts |
| Check if browser session is active |
| Manually save session state |
| Close browser and save session |
Setup
1. Install dependencies
npm install
npx playwright install firefox2. Build
npm run build3. Configure
Add to your global Claude config (~/.claude.json) or project config (.claude/mcp.json):
{
"mcpServers": {
"fidelity": {
"command": "node",
"args": ["/path/to/claude-fidelity-mcp/build/index.js"],
"env": {
"FIDELITY_USERNAME": "your-username",
"FIDELITY_PASSWORD": "your-password",
"FIDELITY_TOTP_SECRET": "your-totp-secret",
"FIDELITY_HEADLESS": "true",
"FIDELITY_TIMEOUT": "30000"
}
}
}
}4. Set up TOTP (recommended)
For fully automatic login without manual 2FA prompts:
Go to Fidelity Security Settings > Authenticator app > Connect
Click "Can't scan the code?" to reveal the TOTP secret (a base32 string)
Copy the secret into
FIDELITY_TOTP_SECRETAlso add it to your authenticator app (Google Authenticator, Authy, etc.) and verify the code with Fidelity to activate
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Fidelity login username |
| Yes | - | Fidelity login password |
| No | - | TOTP secret for automatic 2FA |
| No |
| Set to |
| No |
| Where to save session files |
| No |
| Session file identifier (for multiple accounts) |
| No |
| Default timeout in milliseconds |
Project Structure
src/
index.ts # MCP server entry point + tool registrations
browser.ts # Playwright browser lifecycle, stealth, session persistence
auth.ts # Login flow, TOTP/SMS 2FA handling
accounts.ts # Account listing, balances, transfers
positions.ts # Portfolio positions via CSV download
trading.ts # Quotes and order placement
types.ts # TypeScript interfacesNotes
Dry-run by default -
fidelity_place_orderpreviews orders without executing unless you setdry_run: falseBrowser automation - This relies on Fidelity's web UI, which may change. If tools break, selectors may need updating
Security - Credentials are stored in your Claude config. Never commit them to version control
Rate limiting - Avoid rapid repeated calls; Fidelity may flag automated access
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TylerFlar/claude-fidelity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server