Avanza-MCP
An MCP server for Avanza trading and market research that enables read-only monitoring, paper trading, guarded live order/stop-loss management, multi-session routing, and cross-source analysis via TradingView, Zacks, FMP, Polygon, SEC, and FRED.
Inspect Avanza bridge status, capabilities, accounts, tenant sessions, and selected account context.
Switch sessions/accounts and authorize or revoke live mutation permission for the active MCP/TUI session.
Read portfolio positions, real-time quotes, market movers, index constituents, stock search, account performance, instrument charts, cost attribution, and frozen-holdings attribution.
Read and audit regular open orders, stop-losses, transactions, protection gaps, recovery reachability, sold-today buyback state, recent fills needing protection, failed orders, and protection verification.
Dry-run, place, edit, or delete regular buy/sell orders and stop-losses; live mutations require R/W mode, confirm=true, and stop-loss mutations also require strategy intent/reason.
Manage local stop-loss strategy and position strategy registries, including protection classifications, audit exceptions, and fail-closed strategy/protection audits.
Run paper trading: create/list/cancel paper orders, positions, trades, session P/L summaries, risk guardrails, and scalp watchlists without placing real Avanza orders.
Access TradingView data: anonymous or authenticated symbol analytics, full profiles, pre-open snapshots, heatmaps, watchlists, custom lists, and TradingView session management.
Access Zacks, FMP, Polygon, SEC EDGAR, and FRED data, plus data-source health and cross-source signal bundles.
Estimate courtage/FX fees and break-even move for planned trades.
Expose these tools over MCP stdio to agent clients via an authenticated local TUI/Web bridge.
Allows reading Avanza credentials (username, password, and current TOTP code) from 1Password using the op CLI, with optional vault specification, enabling secure credential management for login.
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., "@Avanza-MCP show my portfolio summary"
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.
Avanza-MCP
This is an experimental project. Use it at your own risk.
Always start in read-only mode and paper trading mode first. Do not enable live write/trading until you have validated behavior end-to-end in paper mode.
Notes below explain what paper trading mode is for and how to use it safely.
Single-script CLI + Textual TUI for Avanza portfolio monitoring, regular buy/sell orders, stop-loss management, MCP integration, and paper trading.
Provider-neutral agent context starts at INSTRUCTIONS/PROVIDER_ENTRYPOINT.md.
The root AGENTS.md, CLAUDE.md, and GEMINI.md files are symbolic links to
that single source, so Codex, Claude Code, and Gemini CLI receive the same
repository rules. Cross-client work is handed off through the ignored local
INSTRUCTIONS/SESSION_HANDOFF.md; see LLM Client Interoperability.
Trading-assistant context lives in:
INSTRUCTIONS/INSTRUCTIONS.md: standing operating rules and safety constraints.INSTRUCTIONS/MEMORY.md: timestamped lessons, mistakes, strategy updates, and checklist changes. This is historical context, not live portfolio state.INSTRUCTIONS/WARMUP.md: prompt for starting a fresh Codex trading session with the right context.Strategy Governance: adopted agent-review policy for economic exposure, campaign floors, recovery and lifecycle checks, with an explicit backlog of controls not yet implemented in software.
The local GOAL-PROMPT.md and INSTRUCTIONS/WARMUP.md are identical,
copy/paste-ready prompts. They contain private account scope and must not be
published or committed. Updating these prompts does not update an already-set
Codex goal, enable trading, or implement the documented machine-control backlog.
The INSTRUCTIONS/ folder is kept visible in git, but its private contents are ignored and should remain local-only.
For trading analysis, always refresh live Avanza MCP data. Do not treat markdown memory as current holdings, orders, prices, account IDs, or stop-loss IDs.
Credentials are prompted at runtime:
username: visible prompt, unless passed with
--usernamepassword: masked
current TOTP code: masked
Alternatively, pass --onepassword-item ITEM and optional --onepassword-vault VAULT to read the Avanza username, password, and current TOTP code through the 1Password CLI (op). The TUI has a matching Login with 1Password path. The tool does not store these secrets; op will ask you to authorize access through the local 1Password app.
The current TOTP code is passed to avanza-api as totpToken, which is the field name expected by the installed library version.
TUI Demo:
Quick Start
# 1. Install uv (once), then dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
# 2a. Run the terminal UI ...
uv run python avanza_cli.py tui
# 2b. ... or the browser UI (prints a one-time access token — paste it
# into the login form that opens; then sign in to Avanza from there)
uv run python avanza_cli.py web
# 2c. ... or scriptable console commands
uv run python avanza_cli.py accounts
uv run python avanza_cli.py portfolio summaryLog in with your Avanza username, password, and current TOTP code (or via the 1Password CLI). Paper trading mode is on by default — order and stop-loss tickets go to a local paper ledger until you explicitly switch to live mode. The TUI and Web UI are mutually exclusive: run one at a time.
To expose the MCP tools to an agent: log in (TUI or Web), enable the MCP
toggle, then register python avanza_cli.py mcp in your MCP client — see
"MCP Server Registration & Run" below.
Related MCP server: tastytrade-mcp
Setup
uv sync --dev
chmod +x scripts/verify.sh .githooks/pre-commit .githooks/pre-push
git config core.hooksPath .githooksIf uv is not installed yet, install it first:
curl -LsSf https://astral.sh/uv/install.sh | shCommand examples below can be run either inside an activated environment or by prefixing with uv run.
For example: uv run python avanza_cli.py tui.
Run the full quality gate at any time:
scripts/verify.shThe quality gate also validates the private review artifacts without granting
trade authority. The instrument strategy master derives its current instrument
and exact account-position counts from row identities, binds them with SHA-256
identity digests, and requires matching objective, factor, and portfolio-control
scope. No historical instrument or position count is completion authority.
Buy-back governance has two separate evidence
layers: the August 6 daily ledger remains a fixed historical snapshot, while
the latest dated live-coverage artifact is rebuilt from the current dynamic
universe and has no fixed candidate count. The live validator derives account,
one-share, low-exposure, full-exit, state, and percentage-coverage totals from
its rows and rejects copied percentage vectors across different instruments.
It also checks
the authoritative factor, pending-order, capital-displacement, and
risk-governance overlays and ensures the objective-completion audit remains
explicitly open while live and forward evidence are missing. It also checks
the 12-measure forward KPI coverage audit and refuses to infer current returns,
benchmark results, drawdown, participation, or lifecycle outcomes from stale
or mixed-session snapshots. Generated portfolio artifacts are analysis
context, not broker instructions. Every
strategy-master account row also carries exact tenant/account/orderbook scope.
The clean-sheet, factor, pending-order, displacement, risk, and live
reconciliation overlays are checked for the same scope and authority flags.
They also carry explicit STAMPED_ANALYSIS_SNAPSHOT freshness metadata and
cannot claim current live state or authorize action without a new exact scoped
refresh.
Every current buy-back row carries an explicit protection classification,
coverage state, low-exposure decision, and exact next gate. Unsupported stages
remain PERCENTAGE_NOT_SET; an ordinary broker BUY row is not promoted into a
ladder. The fixed historical ledger still carries explicit promotion and
rejection/hold evidence and is never presented as current coverage.
Transaction history is audited independently: historical summary coverage,
manual sold slices, raw-source availability, and same-day BUY attribution are
kept separate, with missing recent/raw evidence failing closed.
The latest ignored PORTFOLIO_FULL_HISTORY_CANONICAL_* and
PORTFOLIO_FULL_DYNAMIC_GOVERNANCE_MIRROR_* artifacts additionally preserve
every current source identity, effective lineage, immutable sale lot, recovery
allocation, terminal closure, and official-close reachability row. Their
validator checks current raw-boundary parity and rejects omissions, duplicate
or mutated transaction identities, over-allocation, mixed attributed/unattributed
sources, stale terminal decisions, and rebounds that conceal an unserved
crossing. These files are audit evidence only and never authorize an order.
The scheduler ledger is separately checked for its 18-row Approval C queue,
non-terminal check windows, and explicit active/archive gaps.
Catalyst coverage separately prevents estimated dates or stale scanner labels
from being treated as verified issuer publication.
Commands
Console commands print human-readable Rich tables and summaries, not raw API payloads.
Show running app version:
python avanza_cli.py --versionLaunch the browser trading console (see the Web UI section):
python avanza_cli.py webShow account overview:
python avanza_cli.py accountsShow portfolio summary:
python avanza_cli.py portfolio summaryShow detailed portfolio positions:
python avanza_cli.py portfolio positionsShow transaction history (executed orders by default):
python avanza_cli.py transactions listPull broader history:
python avanza_cli.py transactions list --all --max-elements 5000Search for a stock/order book:
python avanza_cli.py search-stock "VOLV B"List active stop-loss orders:
python avanza_cli.py stoploss listDry-run a trailing/gliding sell stop-loss:
python avanza_cli.py stoploss set \
--account-id ACCOUNT_ID \
--order-book-id ORDER_BOOK_ID \
--trigger-type follow-upwards \
--trigger-value 5 \
--trigger-value-type % \
--order-type sell \
--order-price 1 \
--order-price-type % \
--volume 10Place the order for real by adding --confirm after reviewing the dry-run output.
If --valid-until is omitted, avanza_cli automatically uses the longest currently allowed date (today + 90 days).
If --order-valid-days is omitted, avanza_cli uses the current Avanza-safe default (1).
Dry-run/preview now shows both trigger validity and derived triggered-order expiry (if triggered today).
For live non-SEK/foreign instruments, order_valid_days > 1 is blocked to prevent Avanza Ogiltigt giltighetsdatum trigger failures.
Delete a stop-loss order dry-run:
python avanza_cli.py stoploss delete \
--account-id ACCOUNT_ID \
--stop-loss-id STOP_LOSS_IDDelete for real by adding --confirm.
List open regular orders:
python avanza_cli.py orders listDry-run a regular buy/sell order:
python avanza_cli.py orders set \
--account-id ACCOUNT_ID \
--order-book-id ORDER_BOOK_ID \
--order-type buy \
--price 100 \
--valid-until 2026-05-28 \
--volume 10 \
--condition normalDelete an order dry-run:
python avanza_cli.py orders delete \
--account-id ACCOUNT_ID \
--order-id ORDER_IDTextual TUI
Run the terminal UI from the same script:
python avanza_cli.py tuiThe TUI masks password and TOTP inputs, clears those fields after a successful login, and hides the login screen. You can also enter a 1Password item name/ID and optional vault, then use Login with 1Password to let the local op CLI fetch username, password, and TOTP after your 1Password approval. Use Review Only first to validate and log an order request without creating a paper or live order.
Use the Reload TUI top-button to hard-restart python avanza_cli.py tui with the same arguments and load latest code changes without manually quitting/relaunching.
The bottom status bar includes an automatic GitHub update checker indicator; when a newer release exists, it flashes a warning status.
Controls: AVANZA_UPDATE_CHECK_ENABLED=0 disables checks, AVANZA_GITHUB_REPO=owner/repo overrides source.
After login, the largest account by total value is selected by default. The top panel groups account metrics into colored cards, keeps action buttons together, and shows a live clock plus a weekday OMXS open/close countdown. The P/L metric cycles through 1D P/L, 1W P/L, 1M P/L, 1Y P/L, Since Start P/L, and Total P/L, with SEK and % values colored separately. The main table shows the selected account's stocks with day movement, profit state, a distinct header row, and a real-time quote indicator: green dot for real-time, yellow dot for delayed or unresolved status. The order ticket searches as you type by stock name, ticker, or ISIN, so it supports opening new positions as well as trading current holdings. The lower table shows stop-losses and open orders for the selected account, with trigger and price values labeled as SEK or %; its cancel column opens a guarded cancellation ticket. Buy/sell side cells are color-coded green/red. Click any table column header to sort by that column; click the same header again to reverse the order. Drag the horizontal divider between tables, the vertical divider beside Active Trades, or the left edge of the order/stop-loss ticket to resize panes. Position and order state refreshes live every 5 seconds.
Multi-session mode: use Login extra account to add more authenticated Avanza sessions without leaving TUI. The session selector lets you switch tenant context quickly; account drop-down and all tables follow the selected session. Background refresh keeps inactive tenant/account snapshots warm without visibly switching the active TUI context.
Web UI
Run the browser-based trading console from the same script:
python avanza_cli.py web # 127.0.0.1:8787, opens the browser
python avanza_cli.py web --port 9000 --no-browserThe Web UI has feature parity with the TUI — portfolio with live 5-second
updates, order and stop-loss tickets (dry-run → review → typed PLACE),
guarded cancellations, multi-tenant session switching with re-auth, MCP
bridge management (bridge/R-W/live-authorization controls, token and proxy
command, streaming tool log), a dedicated Paper trading workspace,
TradingView lists, source-ranked research candidates, performance charting,
orders/transactions history, and a full-page configured stop-loss view
beside the compact dashboard stop-loss pane.
When using 1Password CLI login, the Web UI can remember browser-local
profiles containing only the 1Password item name, optional vault, and display
label, so future primary or extra-session logins can pull credentials from
1Password without retyping the item name.
The dashboard keeps view and trade actions in a second top-toolbar row;
Activity and MCP Live logs sit under Ongoing Orders, scroll independently,
and the main/side, portfolio/order/log, and Activity/MCP splits can be
drag-resized and are remembered locally.
It binds 127.0.0.1 only and is protected by a startup access token,
cookie session, CSRF header, and a strict CSP (self + two pinned CDN files
with SRI). See docs/web.md for the full security model, endpoint table,
and smoke checklist.
The Web UI and the TUI are mutually exclusive: one at a time per checkout
(enforced via .avanza_ui.lock). Both manage the same MCP bridge contract,
so python avanza_cli.py mcp works identically against either.
MCP Server Registration & Run
This project exposes MCP through python avanza_cli.py mcp (stdio transport).
1) Start and authenticate the TUI
python avanza_cli.py tuiLog in, then enable the MCP tick box in the TUI. This starts the localhost bridge and writes .avanza_mcp_session.json.
By default, the MCP bridge token is saved to macOS Keychain (security CLI) and only metadata is written to the dotfile; if keychain is unavailable, it falls back to file storage. Override with AVANZA_MCP_SESSION_BACKEND=keychain|file|auto (default auto).
2) Register the MCP server in your client
Codex, Claude Code, and Gemini CLI all support the same local stdio proxy. The recommended absolute-path command is:
uv run --project /ABSOLUTE/PATH/TO/avanza-mcp \
python /ABSOLUTE/PATH/TO/avanza-mcp/avanza_cli.py mcpRegistration commands and the provider-neutral handoff workflow are documented in LLM Client Interoperability.
3) Run from your MCP client
After registration, start or reload the selected MCP client. It will launch the same proxy regardless of provider:
python avanza_cli.py mcpThe MCP proxy forwards tool calls to the authenticated TUI session through the localhost bridge. MCP starts read-only. Enable Live R/W in the TUI for live mutations; live stop-loss/order placement, edit, or deletion still requires MCP arguments to include confirm: true. Monetary stop-losses also require broker-derived, verified instrument currency; market/country inference alone cannot authorize a live submission. MCP activity is shown in the lower-right log console.
For multi-session setups:
use
avanza_sessionsto inspect loaded tenant sessions,use
avanza_select_sessionto switch active context,account/session-context
avanza_*tools accept optionaltenant_session_idfor explicit tenant routing.or pass
account_idand the bridge auto-scopes to the session owning that account.paper-ledger tools use
session_idfor paper ledger grouping; usetenant_session_idwhen explicit tenant routing is required.
Available MCP Tools
Tool | Purpose |
| Show TUI MCP bridge status, selected account, and current safety mode. |
| Return consolidated MCP safety/capability status for automation loops (paper/live guards, account context, and tool availability). |
| Explicitly enable live mutation permission for this active MCP or TUI session. |
| Disable live mutation permission for this MCP or TUI session and force paper-only mode. |
| List Avanza accounts currently visible to the authenticated TUI session. |
| List loaded authenticated Avanza tenant sessions in the running TUI. |
| Switch active MCP/TUI tenant session context. |
| Safely switch MCP or TUI selected account context. |
| Read the logged-in account holder's current courtage class and available choices for an explicit account. |
| Preview or explicitly confirm an account-holder-wide courtage-class change, with post-change readback. |
| Read Avanza account performance/development for the selected or supplied account_id over a chosen period. |
| Read authenticated daily or intraday Avanza OHLC history for one order book; read-only analysis input. |
| Replay cash-flow-adjusted account return with posted commission and modeled FX removed; read-only and fail-closed on truncated history. |
| Reconstruct a frozen starting-holdings path from authenticated daily prices and account history; read-only and fail-closed on missing identity, prices, cash events, or truncated history. |
| Fetch TradingView symbol analytics and technical recommendation barometers from public scanner data. |
| Fetch rich TradingView symbol payload (scanner analytics + technical labels + symbol profile metadata) in LLM-friendly JSON. |
| Open TradingView login page in browser and show session setup instructions for authenticated MCP usage. |
| Persist TradingView session cookie for authenticated tv_auth_* MCP tools. |
| Open instrumented browser, let user log in normally, and automatically capture/save TradingView session cookies. |
| Show saved TradingView authenticated session status used by tv_auth_* tools. |
| Delete saved TradingView authenticated session cookie. |
| Fetch TradingView symbol analytics in authenticated mode (inherits account entitlements from supplied TradingView cookie/session). |
| Fetch rich TradingView symbol payload in authenticated mode (scanner analytics + technical labels + profile metadata + entitlement context). |
| Return a compact TradingView pre-open/extended-hours snapshot for one symbol. |
| Return TradingView pre-open snapshots for a symbol list with per-symbol error isolation. |
| Fetch TradingView market heatmap rows with exchange, OTC, liquidity, market-cap, price, and sort filters. |
| Read-only bundle that merges Avanza portfolio state with TradingView context; exact SELL targets are optional and never inferred from full holdings. |
| Best-effort TradingView watchlist monitor in authenticated mode (cookie/session required for private list context). |
| Load authenticated TradingView custom tracking lists and rows from your TradingView profile session. |
| Fetch Zacks rank via quote-feed and scrape symbol/report pages for Earnings ESP plus visible analysis text (best effort; HTML may be blocked). |
| Fetch analyst recommendation history for a symbol from Financial Modeling Prep (requires FMP API key). |
| Fetch analyst insights/ratings for a symbol from Polygon Benzinga feed (requires Polygon API key). |
| Fetch recent SEC EDGAR filings by ticker or CIK (official SEC data). |
| Fetch FRED macro observations (requires a free FRED API key via FRED_API_KEY or api_key input). |
| Return current health, freshness, and safety flags for Avanza, TradingView, Zacks, FMP, Polygon, SEC, and FRED source integrations. |
| Build a compact cross-source signal bundle (TradingView technicals + SEC filings + optional Zacks/FMP/Polygon + optional FRED macro). |
| List portfolio positions, optionally filtered by one instrument and compact mode. |
| List stop-loss orders with durable strategy intent and missing/mismatch metadata audit, optionally filtered by instrument, side, status, and compact mode. |
| Refresh active broker stops and verify that each exact row reloads with matching durable local strategy metadata. |
| Dry-run or atomically register reviewed intent for exact active broker rows; changes only the local registry, never Avanza. |
| Refresh exact holdings plus aggregate active-stop/open-order exposure, return the read-only |
| Dry-run or atomically register reviewed per-position plans and instrument-specific protection reasons against exact live account state. Material no-SELL exceptions use closed, expiring evidence; calibrated active SELL plans carry exact target and retained-core Antal; verified non-stop eligibility uses dated capability evidence. An explicit preservation flag can update semantics without rebaselining a holding-only exception. This changes only the local registry, never Avanza. |
| List live open/pending regular orders, optionally filtered by instrument, side, or status. |
| Debug tool for normalized open orders plus optional raw Avanza order payload. |
| List ongoing orders for the selected account: live stop-losses + live open orders, with optional paper active orders. |
| List executed orders/history with optional account/date/type/instrument filters; |
| Read a decision-ready polling snapshot, with optional compact instrument filtering. |
| Read one account position by orderbook ID. |
| Read stop-loss rows for one instrument/account. |
| Read open/pending regular orders for one instrument/account. |
| Read transactions for one instrument/account. |
| Read one instrument's quote, position, stops, orders, transactions, and mechanical full-holding diagnostic. |
| Audit exact strategy SELL targets, failed SELL stops, and overcoverage without inferring a full-core exit. |
| Summarize same-day sold instruments using fail-closed recovery attribution; same-day BUY fills offset sales, while pre-existing/generic BUY stops and unattributed regular BUY orders remain conditional exposure rather than assumed repair. |
| Audit every active BUY row for practical fixed-price distance, secondary/deep residuals, reversal-trigger width, and recovery coverage, while separately reconciling explicit named, locked, secondary, or dormant position-plan semantics; raw issues remain visible and thresholds are never placement advice. |
| Review recent BUY fills; report a SELL gap only against an explicit percentage or exact strategy target. |
| Compact post-mutation check for failed/rejected open orders. |
| Verify exact strategy SELL targets; default mode checks failed SELL rows and overcoverage only. |
| Fetch real-time quote snapshot for selected account holdings (best with a 5s polling loop). |
| Fetch arbitrary quote snapshots for supplied orderbook IDs (supports 5s polling loops for 20-50 symbols). |
| Fetch Avanza market movers (gainers/losers) with optional country/market/turnover filters. |
| Fetch index constituents (default OMXS30) with optional quote/spread enrichment for building a liquid scalp universe. |
| Estimate courtage/FX costs and break-even move, with explicit |
| Search Avanza stock/order book data by name, ticker, or ISIN. |
| Create a local paper stop-loss order. |
| List local paper-trading orders and events for the selected account, or a supplied account_id. |
| List paper positions for a selected account/session, with optional active-only filter. |
| List completed paper trades (entry+exit ledger rows) for account/session. |
| Return P/L summary for a paper trading session/account. |
| Create a local paper buy/sell order. |
| Close an open paper position by position_id or orderbook_id and create a completed paper trade entry. |
| Evaluate paper-session guardrails before allowing a new trade entry. |
| Store/update a named scalp watchlist (orderbook IDs + optional labels) in local paper session state. |
| Load a named scalp watchlist and optionally include current quotes for all members. |
| Cancel a local paper order. |
| Dry-run or place a stop-loss order; live MCP placement requires an auditable strategy intent and reason. |
| Place multiple stop-loss orders with per-item strategy-intent validation and final readback. |
| Dry-run or place a regular buy/sell order. |
| Dry-run or update an existing open order (price/volume/valid_until). |
| Dry-run or update an existing open/pending regular order. |
| Dry-run or delete a regular open order. |
| Dry-run or cancel an existing open/pending regular order. |
| Dry-run or delete a stop-loss order; live deletion requires intent/reason matching the exact durable stop metadata. |
| Dry-run or edit an existing stop-loss (delete old + place new). |
Canonical naming note:
use
avanza_open_ordersuse
avanza_stoplosses
Stop-loss strategy metadata is stored locally in
.avanza_stoploss_strategy.json with owner-only permissions. The registry is
keyed by account and stop ID and fingerprints the complete broker row. Missing
or changed broker fields produce MISSING or STALE_MISMATCH; the old intent
is not trusted or silently transferred. This registry records why an order
exists, but never authorizes a broker mutation.
Reviewed whole-position plans are stored separately in
.avanza_position_strategy.json, also with owner-only permissions. Each
account-plus-orderbook record binds the intended thesis, horizon, priority,
strategy gate, and reviewed aggregate holding/stop/open-order exposure to exact
live state. A fill, holding change, stop edit, leftover order, missing plan, or
stale plan makes avanza_position_strategy_audit fail closed until the change
is reviewed. Rebaselining records a decision; it never authorizes a trade.
Intentional holding-only drift may be documented with an audit_exception whose
kind is USER_CONTROLLED_ALLOCATION or POST_MANUAL_EXIT_DRIFT, with an owner,
reason, review point, and allowed_mismatches: ["holding"]. The audit must still
remain incomplete, rebaseline_authorized is always false, and stop, order, or
other exposure drift is never acknowledged by this mechanism.
For an existing reviewed holding-only exception,
avanza_position_strategy_register_batch may set
preserve_audit_exception_fingerprint: true on that exact row to update only
semantic plan fields. The request must still match current live state exactly;
the stored fingerprint must differ only in holding; the existing exception
must explicitly set rebaseline_authorized: false; and supplied exception
metadata must be unchanged. Missing exceptions, no actual holding drift, or any
stop/open-order mismatch are rejected atomically. This remains a private
registry write and never mutates or authorizes Avanza.
Every reviewed row also requires one exact protection_classification:
CALIBRATED_STOP_PROFIT_LADDER, CORE_HOLD_EXCEPTION, MARKER_EXCEPTION,
NAMED_EXCEPTION, NON_STOP_ELIGIBLE, or REPAIR_REQUIRED, plus an
instrument-specific protection_reason. The registry validates the class
against current SELL exposure and live holding size. Missing or contradictory
metadata is rejected; REPAIR_REQUIRED is durable but blocks governance
completion. A valid acknowledged holding-only exception can therefore remain
strictly fingerprint-incomplete while still being governance-complete, without
silently changing its stored fingerprint.
Contract revision 2026-09-12.position-protection-v2 adds three fail-closed
position-protection controls while retaining private registry version 1 for
additive legacy readability:
A material zero-SELL
CORE_HOLD_EXCEPTIONorNAMED_EXCEPTIONrequires a closedno_stop_exception_evidenceobject with timezone-awaredecision_at,evidence_as_of,next_review_at, andvalid_until, a nonblank gap-risk statement, unique source IDs, and exactly one ofTACTICAL_PROFIT_SLICE,WIDER_CALIBRATED_CORE_ROW, orDELIBERATELY_UNPROTECTED_CORE. Missing, malformed, future-dated, elapsed, or unknown evidence fails closed; legacy prose is never promoted.An active SELL position plan must be
CALIBRATED_STOP_PROFIT_LADDERwith exact positiveprotection_target_antaland non-negativeretained_core_antal. Their sum must equal the exact live holding and the active SELL Antal must equal the target; undercoverage and overcoverage both require review. Strategy-target coverage remains distinct from full-holding coverage.NON_STOP_ELIGIBLEexcludes a row only while a closed, dated, sourced broker capability-evidence object is current.
These fields are visible in dry-run, persisted local-registry readback, audit
output, and capability discovery. They never create a broker SELL row, protected
Antal, live authorization, or a trade. A current decision to remain unprotected
therefore remains actual broker coverage 0 and blocks a protected/complete
claim.
The private output/PORTFOLIO_GOVERNANCE_REVIEW_STREAK.json ledger records
each scheduled twice-daily review. Validate it with:
python3 scripts/verify_governance_review_streak.pyThe verifier rejects duplicate windows, missing account or gate evidence,
late backfills, false eligibility flags, premature completion claims, and any
review whose exact-account authorization state is not explicitly off. An
existing malformed historical attempt may be preserved only by appending a
current annotation bound to its immutable review ID, index, and canonical
SHA-256 hash; annotations cannot change an attempt to eligible or rewrite the
review. Goal
completion additionally requires ten eligible morning/evening reviews across
five regular market sessions; use --require-complete only when asserting that
terminal condition.
Mechanical registry equality does not prove that analysis sources carry the
same meaning. Use avanza-strategy-audit to compare every account-position
semantic field and live fingerprint across an instrument master, clean sheet,
and private registry. The command exits nonzero on missing coverage or any
field contradiction and includes source SHA-256 hashes in its JSON result.
avanza-strategy-sync is a separate guarded analysis-only maintenance command.
It defaults to dry-run, requires a documented --reason, and refuses to
synchronize semantics unless holdings and active BUY/SELL fingerprints already
match. --confirm changes only the supplied clean sheet and master; it never
changes Avanza or the private registry and never grants trade authority.
Run avanza_recovery_reachability separately for each exact account after
refreshing holdings and stops. Its default 8% fixed-distance band is
practical participation; 8-15% is secondary review only, 15%+ is deep
review, and 4% is the maximum default reversal width. These are review
boundaries, not entry recommendations. A deep- or secondary-only row without
practical participation is blocked as recovery coverage. Event, thesis,
technical, risk, factor, capacity, and full-friction gates still determine
whether a correction is a nearer row or an explicit dormant review with no
active BUY.
The raw complete, review_required, issue_count, and per-instrument
issues fields remain mechanical and are never suppressed. The separate
governance_complete result is true only when every active BUY instrument has
a current exact-account position plan with a matching active-BUY fingerprint
and every raw issue is explicitly
classified as a named exception, locked residual, secondary review, or dormant
review. Missing or stale plans, REPAIR_REQUIRED, unclassifiable rows, live cleanup
requirements, and plan-versus-distance contradictions remain unresolved and
fail closed. An explained issue is review inventory, not practical recovery
coverage and not order authority.
avanza-strategy-audit \
--master output/PORTFOLIO_INSTRUMENT_STRATEGY_MASTER_20260731.json \
--clean-sheet output/PORTFOLIO_CLEAN_SHEET_POST_MINI_20260731.json \
--registry .avanza_position_strategy.json \
--account-map Personal=5227886 \
--account-map DarkCell=7616265SEC EDGAR access identity
sec_filings_recent uses a provider-specific declared identity for official
SEC requests. It does not reuse the browser-style user agent required by
TradingView. By default, Avanza-MCP derives the contact address from the local
git config user.email value without writing that address into the repository.
For a machine without Git contact configuration, set either a contact email or the complete SEC user agent before starting the TUI/MCP bridge:
export AVANZA_SEC_CONTACT_EMAIL="admin@example.com"
# Or provide the complete declared identity:
export AVANZA_SEC_HTTP_USER_AGENT="Avanza-MCP/0.2.31 Example Company admin@example.com"The ticker-to-CIK index is cached for 24 hours per process and SEC requests are
serialized below the official 10-requests-per-second ceiling. Advanced local
overrides are AVANZA_SEC_TICKER_INDEX_CACHE_SECONDS and
AVANZA_SEC_REQUEST_MIN_INTERVAL_SECONDS; the latter is always clamped to at
least 0.1 seconds. Restart the bridge after changing any of these settings.
TradingView/Zacks scrape mode notes
These tools are intentionally marked experimental.
tv_scrape_*runs in free anonymous mode.tv_auth_*supports three auth paths:explicit tool input (
cookieorsessionid+sessionid_sign),environment variables (
TRADINGVIEW_SESSIONID, optionalTRADINGVIEW_SESSIONID_SIGN),saved local session via
tv_auth_session_set.
Saved TradingView session storage defaults to macOS Keychain (
securityCLI) when available, with metadata in.avanza_tradingview_session.json(ignored by git). Fallback is file-only storage.Optional override:
AVANZA_TV_SESSION_BACKEND=keychain|file|auto(defaultauto).Preferred path:
tv_auth_session_login_autoto open an instrumented browser and capture cookies automatically after login.Browser-assisted flow:
call
tv_auth_session_login_auto,log in normally in opened browser window,
wait for auto-capture confirmation, then run
tv_auth_session_status,use
tv_auth_*tools with no repeated cookie input.
The TUI
TradingView Liststab uses the same authenticated profile and provides a dedicated custom-list monitor with list switching.The Web UI
Research candidatesview uses/api/recommendations/stocksto assemble a bounded, read-only candidate list from TradingView movers/technicals and Zacks rank/analysis summaries. Its source controls filter the loaded table instantly without another server request and report compact per-source enrichment health. It is research input only, not an order instruction.If auto mode is unavailable, fallback is
tv_auth_session_start+ manualtv_auth_session_set.If Codex or another agent does not expose
tv_*tools as direct native calls, keep using the registeredavanza_cliMCP server and call the tools through the local stdio/TUI bridge. The bridge command remainspython avanza_cli.py mcp; it forwards to the authenticated TUI localhost session.Avanza U.S. extended hours, available from 2026-09-08, are three distinct Stockholm-local windows: pre-market
11:00-15:30, regular15:30-22:00, and after-hours22:00-22:30. Verify current venue/calendar/DST state rather than treating the full interval as regular. Avanza documents lower liquidity, wider spreads, faster moves, pre-market-to-regular order rollover,22:30cancellation of unfilled after-hours orders, official-close portfolio valuation, and no Stop-loss or Limit-on-Close outside regular trading. The current MCP regular-order schema has no explicit extended-hours selector, so agents must not infer opt-in fromavanza_order_setorcondition; extended-hours mutation remains unsupported until the tool contract and readback expose it explicitly. See the official announcement and order mechanics.Pre-open workflow:
start and authenticate the TUI, then enable MCP,
confirm
tv_auth_session_statusif authenticated TradingView data is needed,call
tv_preopen_batch_snapshotfor watchlist/candidate symbols oravanza_tv_preopen_portfolio_bundlefor an Avanza account review,use
tv_scrape_heatmapwith filters such asexchanges=["NASDAQ","NYSE","AMEX"],exclude_otc=true,min_market_cap,min_price, andmin_volumeto avoid OTC/microcap noise.
Performance notes:
tv_preopen_batch_snapshotuses bounded bulk TradingView scanner chunks for normal multi-symbol reviews, preserving per-symbol error isolation for large or mixed-exchange requests; Avanza MCP read tools keep a short in-process account cache to avoid repeated full portfolio/stop/order pulls during focused workflows;avanza_orderbook_quotesdeduplicates IDs and can skip metadata enrichment whenfieldscontains only price fields.TradingView extended-hours fields depend on TradingView entitlement/session and scanner availability.
premarket_close,postmarket_close,update_mode, and quote freshness warnings are reported explicitly; missing fields are returned asnullinstead of inferred from Avanza.zacks_scrape_symbolis best effort; it uses Zacks quote-feed data for rank when available, then attempts the quote page and free Zacks equity-report page for visible analysis text. It returnsrank_source,quote_feed,analysis_summary,analysis_sources, andblocked_sources. Zacks HTML pages can still return bot-protection pages unless a valid browser session/cookie is provided.Treat scrape output as decision support only. Keep live mutations behind Avanza read/write + explicit
confirm: true.API-key tools:
fmp_analyst_recommendations: passapi_keyor setFMP_API_KEY.polygon_analyst_insights: passapi_keyor setPOLYGON_API_KEY.
MCP Transaction History Quick Use
Use avanza_transactions to retrieve executed order history (BUY/SELL by default).
Most recent 15 rows:
{"max_elements": 15}
Include dividends and interest:
{"types": ["BUY", "SELL", "DIVIDEND", "INTEREST"], "max_elements": 200}
Full export window:
{"transactions_from": "2026-01-01", "transactions_to": "2026-12-31", "executed_only": false, "max_elements": 5000}
avanza_transactions is read-only and works while MCP remains read-only.
When preserving transaction evidence, pass include_raw: true and verify the
response contains raw_payload. avanza_capabilities also reports
contract_features.transactions_include_raw; a missing feature indicates that
the loaded MCP runtime must be reloaded before raw-source evidence can be
accepted.
Also verify mcp_contract_revision after a reload; the package version alone
is not sufficient to distinguish an older long-running bridge process.
4) Remote-only client note
ChatGPT developer mode currently expects remote MCP apps/connectors over SSE or streaming HTTP, so it cannot directly register this local stdio proxy.
For auto-trading experiments, use avanza_live_snapshot as the polling tool. It returns a decision-ready account snapshot and is safe to call every 5 seconds. Paper trading is available in read-only MCP mode through avanza_paper_stoploss_set, avanza_paper_order_set, avanza_paper_orders, and avanza_paper_cancel; paper state is stored in .avanza_paper_session.json and never places an Avanza order. The TUI's Paper tick box is on by default; while it is on, the order and stop-loss form submit buttons create local paper orders. Turn Paper off only when you intend to use live Avanza placement, which still requires typing PLACE. Regular live buy/sell orders are also exposed through avanza_order_set and avanza_order_delete, gated by MCP R/W mode and confirm: true.
TUI sessions write structured JSONL logs under avanza-cli/logs/: a timestamped session log plus persistent app.jsonl, mcp.jsonl, and trading.jsonl.
Safety
This uses the unofficial avanza-api package. Start with stoploss list and dry-runs. Verify Avanza's live interpretation of % and gliding stop-loss fields with very small size before trusting it for meaningful orders.
Stop-losses are not guaranteed earnings-gap or overnight protection. A tight Kurs 99% can avoid a bad normal-session fill, but it can also fail, remain unfilled, or show ERROR if price gaps through the trigger after hours, before open, during a halt, or in a fast market. Treat ERROR rows as unprotected, and handle after-close/before-open catalysts with explicit sizing, trim, sell, hedge, or hold-and-accept decisions.
If an ERROR row reason contains Ogiltigt giltighetsdatum, the failure is usually triggered-order validity, not trigger logic or slippage. Set order_valid_days=1 and replace the stop-loss.
Credits
Creators: Hamid Kashfi and Codex (OpenAI).
This project builds on the Python avanza-api library by fama93:
PyPI: avanza-api
Source: github.com/fhqvst/avanza
The dependency is pinned to reviewed upstream commit 16b6e260 (package
version 16.2.0), replacing the previous >=16.1,<17 range. The pin contains
the regular-order /order/new and /order/delete route correction used here.
It also adds an insider-transactions API and changes the insights-report
request from one account ID to a POST body containing account IDs, together
with its response model. Avanza-MCP currently invokes neither collateral API.
Available Tools
82 toolsavanza_account_cost_attributionB
Replay one account's Avanza cash-flow-adjusted return with posted commission and modeled FX removed. Read-only and fail-closed on truncated history.
Inputs: period, account_id, session_id, start_date, +4 more.
avanza_account_performanceB
Read Avanza account performance/development for the selected or supplied account_id over a chosen period.
Inputs: period, account_id, session_id, tenant_session_id.
avanza_accountsB
List Avanza accounts currently visible to the authenticated TUI session.
Inputs: session_id, tenant_session_id.
avanza_capabilitiesA
Return consolidated MCP safety/capability status for automation loops (paper/live guards, account context, and tool availability).
Inputs: session_id, tenant_session_id.
avanza_fee_estimateB
Estimate courtage/FX costs and break-even move for a planned trade (conservative assumptions when exact class data is unavailable).
Inputs: side (required), price (required), quantity (required), account_id (required), +6 more.
avanza_frozen_holdings_attributionB
Reconstruct an account's frozen starting-holdings path using authenticated Avanza daily prices, transactions, and cash events. Read-only and fail-closed on missing history or unsupported cash events.
Inputs: start_date (required), period, account_id, session_id, +2 more.
avanza_index_constituentsB
Fetch index constituents (default OMXS30) with optional quote/spread enrichment for building a liquid scalp universe.
Inputs: index_id, index_name, include_quotes, include_spread.
avanza_instrument_chartA
Read authenticated Avanza OHLC history for one order book and period. Read-only; intended for auditable performance and counterfactual analysis.
Inputs: orderbook_id (required), period, resolution, session_id, +1 more.
avanza_instrument_open_ordersB
Read open/pending regular orders for one instrument/account, with optional raw payload diagnostics.
Inputs: account_id (required), orderbook_id (required), side, status, +7 more.
avanza_instrument_stateC
Read one instrument's quote, position, active/error stops, open orders, recent transactions, and protection summary.
Inputs: account_id (required), orderbook_id (required), to, date, +7 more.
avanza_instrument_stoplossesB
Read stop-loss rows for one instrument/account with optional side/status filters.
Inputs: account_id (required), orderbook_id (required), side, status, +6 more.
avanza_instrument_transactionsB
Read recent transactions for one instrument/account without dumping unrelated history.
Inputs: account_id (required), orderbook_id (required), to, date, +15 more.
avanza_live_session_authorizeA
Explicitly enable live mutation permission for this active MCP/TUI session. Requires read_write mode and acknowledge=true.
Inputs: reason, session_id, acknowledge, tenant_session_id.
avanza_live_session_revokeA
Disable live mutation permission for this MCP/TUI session and force paper-only mode.
Inputs: session_id, tenant_session_id.
avanza_live_snapshotB
Read a decision-ready snapshot for polling loops; supports compact instrument filtering to reduce payload size.
Inputs: side, status, compact, refresh, +6 more.
avanza_market_moversB
Fetch Avanza market movers (gainers/losers) with optional country/market/turnover filters.
Inputs: limit, min_price, countryCodes, marketPlaces, +1 more.
avanza_ongoing_ordersB
List ongoing orders for the selected account: live stop-losses + live open orders, with optional paper active orders.
Inputs: side, status, compact, refresh, +7 more.
avanza_open_order_cancelA
Dry-run or cancel an existing open/pending regular order (alias of avanza_order_delete). Live cancellation requires TUI R/W mode and confirm=true.
Inputs: order_id (required), account_id (required), confirm, session_id, +1 more.
avanza_open_order_editB
Dry-run or update an existing open/pending regular order (alias of avanza_order_edit). Live update requires TUI R/W mode and confirm=true.
Inputs: price (required), volume (required), order_id (required), account_id (required), +4 more.
avanza_open_ordersA
List live open/pending regular orders, optionally filtered by instrument, side, or status, with stable IDs for edit/cancel flows.
Inputs: side, status, compact, refresh, +6 more.
avanza_open_orders_rawC
Debug tool: return normalized open orders plus raw Avanza order payload for schema diagnostics.
Inputs: side, status, compact, refresh, +7 more.
avanza_orderbook_quotesB
Fetch arbitrary quote snapshots for supplied orderbook IDs (supports 5s polling loops for 20-50 symbols).
Inputs: orderbook_ids (required), fields, refresh.
avanza_order_deleteA
Dry-run or delete a regular open order. Live deletion requires TUI R/W mode and confirm=true.
Inputs: order_id (required), account_id (required), confirm, session_id, +1 more.
avanza_order_editA
Dry-run or update an existing open order (price/volume/valid_until). Live update requires TUI R/W mode and confirm=true.
Inputs: price (required), volume (required), order_id (required), account_id (required), +4 more.
avanza_order_setB
Dry-run or place a regular buy/sell order. Live placement requires TUI R/W mode and confirm=true.
Inputs: price (required), volume (required), account_id (required), valid_until (required), +6 more.
avanza_paper_cancelA
Cancel a local paper order. This never changes Avanza and is allowed in MCP read-only mode.
Inputs: paper_order_id (required).
avanza_paper_order_exitA
Close an open paper position by position_id or orderbook_id and create a completed paper trade entry.
Inputs: account_id (required), exit_price (required), session_id, exit_reason, +3 more.
avanza_paper_ordersB
List local paper-trading orders and events for the selected account, or a supplied account_id.
Inputs: account_id, active_only.
avanza_paper_order_setA
Create a local paper buy/sell order. This never places an Avanza order and is allowed in MCP read-only mode.
Inputs: price (required), volume (required), account_id (required), valid_until (required), +10 more.
avanza_paper_positionsB
List paper positions for a selected account/session, with optional active-only filter.
Inputs: account_id, session_id, active_only, tenant_session_id.
avanza_paper_risk_stateB
Evaluate paper-session guardrails before allowing a new trade entry.
Inputs: account_id (required), session_id, max_open_trades, tenant_session_id, +4 more.
avanza_paper_session_summaryC
Return P/L summary for a paper trading session/account.
Inputs: account_id, session_id, tenant_session_id.
avanza_paper_stoploss_setA
Create a local paper stop-loss order. This never places an Avanza order and is allowed in MCP read-only mode.
Inputs: volume (required), account_id (required), order_price (required), order_book_id (required), +12 more.
avanza_paper_tradesB
List completed paper trades (entry+exit ledger rows) for account/session.
Inputs: account_id, session_id, tenant_session_id.
avanza_portfolioC
List portfolio positions for the selected account, optionally filtered by one instrument.
Inputs: side, status, compact, refresh, +6 more.
avanza_positionA
Read one account position by orderbook_id without dumping the full portfolio.
Inputs: account_id (required), orderbook_id (required), session_id, tenant_session_id.
avanza_position_strategy_auditA
Refresh exact holdings, active stop exposure, regular open orders, and stop-intent metadata for one account, then fail closed on any missing or stale reviewed position plan, missing/contradictory protection classification, or REPAIR_REQUIRED row. Read-only at Avanza.
Inputs: account_id (required), session_id, tenant_session_id.
avanza_position_strategy_register_batchA
Dry-run or atomically register reviewed strategy plans for exact live account-position states. Changes only the private local registry, never Avanza; confirm=true requires MCP R/W but not live-trading authorization. An explicit per-row preservation flag can update semantics without rebaselining a reviewed holding-only exception, but refuses every stop/order or other mismatch. Every row requires an explicit protection classification and instrument-specific reason.
Inputs: items (required), account_id (required), confirm, session_id, +2 more.
avanza_protection_gapsB
Audit exact strategy-classified SELL targets, failed SELL stops, and overcoverage. By default it preserves current active SELL volume as the baseline and does not infer full-holding protection for core positions.
Inputs: account_id, session_id, exclude_eth, coverage_targets, +4 more.
avanza_realtime_quotesB
Fetch real-time quote snapshot for selected account holdings (best with a 5s polling loop).
Inputs: account_id, session_id, tenant_session_id.
avanza_recent_fills_needing_protectionA
Review recent BUY fills without assuming they require full-holding SELL stops. Missing SELL coverage is reported only against an explicit percentage or exact strategy-classified target.
Inputs: since, account_id, session_id, exclude_eth, +3 more.
avanza_recovery_reachabilityA
Read-only fail-closed audit of active BUY reachability. Flags fixed rows beyond the review-distance limit, overly wide reversal gliders, and deep-only recovery designs without treating the thresholds as placement advice.
Inputs: account_id, session_id, tenant_session_id, max_fixed_distance_percent, +2 more.
avanza_scalp_watchlist_getA
Load a named scalp watchlist and optionally include current quotes for all members.
Inputs: watchlist_id (required), include_quotes.
avanza_scalp_watchlist_setA
Store/update a named scalp watchlist (orderbook IDs + optional labels) in local paper session state.
Inputs: items (required), watchlist_id (required).
avanza_search_stockA
Search Avanza stock/order book data by name, ticker, or ISIN.
Inputs: query (required), limit.
avanza_select_accountA
Safely switch MCP/TUI selected account context. Read-only context switch; no order mutations.
Inputs: account_id (required), session_id, tenant_session_id.
avanza_select_sessionA
Switch active MCP/TUI session context to a loaded tenant session (read-only context switch).
Inputs: session_id (required).
avanza_sessionsA
List authenticated Avanza tenant sessions currently loaded in TUI.
Inputs: no named parameters.
avanza_sold_today_buyback_stateB
Summarize same-day sold instruments and fail closed on economic recovery coverage. Same-day BUY fills offset sold volume; active BUY stops count only with durable sold-slice recovery attribution, and regular BUY orders remain unattributed exposure.
Inputs: date, account_id, session_id, tenant_session_id, +1 more.
avanza_statusA
Show TUI MCP bridge status, selected account, and current safety mode.
Inputs: session_id, tenant_session_id.
avanza_stoploss_deleteA
Dry-run or delete a stop-loss order. Live deletion requires TUI R/W mode, confirm=true, strategy_intent, strategy_reason, and an exact match to durable stop metadata.
Inputs: account_id (required), stop_loss_id (required), confirm, session_id, +3 more.
avanza_stoploss_editB
Dry-run or edit an existing stop-loss (place new + delete old). Live MCP placement requires strategy_intent and strategy_reason.
Inputs: volume (required), account_id (required), order_price (required), stop_loss_id (required), +15 more.
avanza_stoplossesC
List stop-loss orders with durable strategy intent and missing/mismatch metadata audit, optionally filtered by instrument, side, or status.
Inputs: side, status, compact, refresh, +6 more.
avanza_stoploss_setB
Dry-run or place a stop-loss order. Live placement requires TUI R/W mode, confirm=true, strategy_intent, and strategy_reason.
Inputs: volume (required), account_id (required), order_price (required), order_book_id (required), +14 more.
avanza_stoploss_set_batchA
Place multiple stop-loss orders with per-item validation/readback. Every live item requires strategy_intent and strategy_reason in addition to TUI R/W mode, live authorization, and confirm=true.
Inputs: items (required), account_id (required), confirm, session_id, +1 more.
avanza_stoploss_strategy_auditA
Refresh active broker stop-losses and audit whether every exact row has matching durable local strategy metadata. Read-only at Avanza.
Inputs: account_id (required), compact, session_id, tenant_session_id.
avanza_stoploss_strategy_register_batchA
Dry-run or atomically register strategy metadata for exact active broker stop rows. This changes only the local registry, never Avanza; confirm=true requires MCP R/W but not live-trading authorization.
Inputs: items (required), account_id (required), confirm, session_id, +2 more.
avanza_transactionsB
List executed orders/history (BUY/SELL by default) with optional account/date/type filters.
Inputs: to, date, from, isin, +17 more.
avanza_tv_preopen_portfolio_bundleC
Read-only Avanza portfolio protection state merged with TradingView pre-open market/technical snapshots.
Inputs: cookie, market, compact, sessionid, +8 more.
avanza_verify_no_raw_failed_ordersC
Compact post-mutation check for failed/rejected open regular orders.
Inputs: account_id, session_id, orderbook_ids, tenant_session_id.
avanza_verify_protectionB
Compact post-mutation check against exact strategy SELL targets. Without explicit targets, it checks failed SELL rows and overcoverage without inferring a full-holding exit.
Inputs: account_id, session_id, exclude_eth, full_holding, +6 more.
data_source_statusC
Return current health, freshness, and safety flags for Avanza, TradingView, Zacks, FMP, Polygon, SEC, and FRED source integrations.
Inputs: market, symbol, exchange.
fmp_analyst_recommendationsC
Fetch analyst recommendation history for a symbol from Financial Modeling Prep (requires FMP API key).
Inputs: symbol (required), limit, api_key.
fred_seriesB
Fetch FRED macro observations (requires a free FRED API key via FRED_API_KEY or api_key input).
Inputs: series_id (required), limit, api_key, sort_order.
polygon_analyst_insightsB
Fetch analyst insights/ratings for a symbol from Polygon Benzinga feed (requires Polygon API key).
Inputs: symbol (required), date, limit, api_key.
sec_filings_recentA
Fetch recent SEC EDGAR filings by ticker or CIK (official SEC data).
Inputs: cik, limit, ticker.
signal_context_bundleC
Build a compact cross-source signal bundle (TradingView technicals + SEC filings + optional Zacks/FMP/Polygon + optional FRED macro).
Inputs: market, symbol, compact, symbols, +10 more.
tv_auth_custom_listsB
Load authenticated TradingView custom tracking lists and rows from your TradingView profile session.
Inputs: limit, list_id, list_name.
tv_auth_session_clearA
Delete saved TradingView authenticated session cookie.
Inputs: no named parameters.
tv_auth_session_login_autoB
Open instrumented browser, let user log in normally, and automatically capture/save TradingView session cookies.
Inputs: timeout_seconds.
tv_auth_session_setC
Persist TradingView session cookie for authenticated tv_auth_* MCP tools.
Inputs: cookie, source, sessionid, sessionid_sign.
tv_auth_session_startA
Open TradingView login page in browser and show session setup instructions for authenticated MCP usage.
Inputs: open_browser.
tv_auth_session_statusA
Show saved TradingView authenticated session status used by tv_auth_* tools.
Inputs: no named parameters.
tv_auth_symbol_analyticsB
Fetch TradingView symbol analytics in authenticated mode (inherits account entitlements from supplied TradingView cookie/session).
Inputs: symbol (required), cookie, market, exchange, +2 more.
tv_auth_symbol_fullB
Fetch rich TradingView symbol payload in authenticated mode (scanner analytics + technical labels + profile metadata + entitlement context).
Inputs: symbol (required), cookie, market, exchange, +2 more.
tv_auth_watchlistB
Best-effort TradingView watchlist monitor in authenticated mode (cookie/session required for private list context).
Inputs: limit, cookie, market, exchange, +3 more.
tv_preopen_batch_snapshotA
Return TradingView pre-open snapshots for a symbol list with per-symbol error isolation.
Inputs: symbols (required), cookie, market, compact, +5 more.
tv_preopen_symbol_snapshotB
Return a compact TradingView pre-open/extended-hours review snapshot for one symbol.
Inputs: symbol (required), cookie, market, exchange, +3 more.
tv_scrape_heatmapC
Fetch TradingView market heatmap rows (top movers) using free scanner data.
Inputs: limit, market, sector, sort_by, +7 more.
tv_scrape_symbol_analyticsC
Fetch TradingView symbol analytics and technical recommendation barometers from public scanner data.
Inputs: symbol (required), market, exchange.
tv_scrape_symbol_fullC
Fetch rich TradingView symbol payload (scanner analytics + technical labels + symbol profile metadata) in LLM-friendly JSON.
Inputs: symbol (required), market, exchange.
zacks_scrape_symbolB
Fetch Zacks rank via quote-feed and scrape symbol/report pages for Earnings ESP plus visible analysis text (best effort; HTML may be blocked without valid browser session/cookies).
Inputs: symbol (required), cookie.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 82 tools
Many tools overlap in scope: avanza_status, avanza_capabilities, and data_source_status all report state, while multiple order and audit tools have near-identical names such as avanza_open_orders vs avanza_ongoing_orders and avanza_open_order_cancel vs avanza_order_delete. The descriptions help, but an agent would frequently struggle to pick the correct tool.
The server broadly uses avanza_* and tv_* prefixes with readable verb_noun names, but consistency breaks down with aliases like avanza_open_order_cancel vs avanza_order_delete, adjective-noun names like avanza_live_snapshot, and mixed provider prefixes like zacks_scrape_symbol vs fmp_analyst_recommendations.
82 tools is far beyond the typical well-scoped MCP server and includes many aliases, per-instrument read variants, and overlapping audit helpers. Even with multiple integrations, the tool surface feels inflated rather than carefully pruned.
Core workflows are well covered: live and paper order lifecycle, stop-loss management, portfolio/position reads, quotes, transactions, account selection, multi-source market data, and strategy audits. Minor gaps exist, such as no dedicated single-order status fetch or paper stop-loss edit tool, but the main strategy-protection workflow has no obvious dead ends.
Maintenance
Related MCP Connectors
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Hosted MCP server for Indian market quotes, option-chain Greeks and multi-broker telemetry.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for Angel One SmartAPI. Lets AI clients trade Indian stocks, manage orders and GTT rules, read holdings/positions/funds, fetch quotes/candles/OI/Greeks, and estimate margin/brokerage with TOTP login and built-in safety guards.3274 npm1MIT
- AlicenseAqualityDmaintenanceMCP server for the tastytrade brokerage API, providing tools for account management, market data, and order execution.18MIT
- AlicenseAqualityCmaintenanceMCP server for the Trading 212 public API, enabling account, portfolio, order, pie, and history access with read tools always available and trading tools opt-in.131MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Tradernet/Freedom24 trading platform API, enabling portfolio management, order placement, quotes, ticker search, and price alerts via AI assistants.53 npm1MIT