avanza-mcp
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 Avanza accounts and holdings"
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
An MCP server that lets an AI assistant read your Avanza accounts, holdings and transactions, and look up public market data. You log in with BankID through a small login panel shown right in the chat.
Unofficial. Avanza has no public API. This server uses the same internal endpoints as avanza.se's own web app. They can change or break at any time, and automated use may be against Avanza's terms. Not affiliated with Avanza or BankID. Use at your own risk.
What it can do
Read-only. There are no tools for orders or transfers.
Tool | Login needed | What it returns |
| Shows the BankID login panel | |
| Whether you're logged in, and how old the snapshot is | |
| Logs out and deletes the stored session | |
| snapshot without login | Accounts with total value and cash |
| snapshot without login | Positions and cash, for one account or all |
| yes | Trades, deposits, dividends and fees |
| no | Stocks, funds, ETFs etc. by name, ticker or ISIN |
| no | Quote, key ratios, dividends, or fund details |
| no | Closing prices from one week to five years |
Avanza ends a web session after at most 24 hours. Every time you log in, the server saves a snapshot
of your accounts and holdings. While you're logged out, get_accounts and get_holdings answer from
that snapshot, with holdings re-priced from live public quotes.
Related MCP server: Avanza MCP Server
The login panel
connect_avanza returns an interactive MCP Apps
panel instead of a link:
On a computer it shows a live BankID QR code. Scan it with the BankID app.
On a phone it shows an Open BankID button that opens the BankID app on the same device.
The login only starts when the panel asks for it. That matters because BankID cancels a login the app hasn't picked up within about 30 seconds. A link written out by the assistant often arrives too late; the panel avoids that. The QR code is refreshed every second, and a new login is started automatically if nobody scans within 30 seconds.
You need a client that renders MCP Apps panels, such as ChatGPT. In a client without MCP Apps support the market-data tools still work, but there is no way to log in.
Install
Requires Python 3.12+ and uv.
git clone https://github.com/truls27a/avanza-mcp.git
cd avanza-mcp
uv sync
uv run avanza-mcp --helpLocal clients (stdio)
For a client that starts the server itself, add something like this to its MCP config:
{
"mcpServers": {
"avanza": {
"command": "uv",
"args": ["run", "--directory", "/path/to/avanza-mcp", "avanza-mcp"]
}
}
}Remote clients (HTTP)
AVANZA_MCP_TOKEN="$(openssl rand -hex 32)" uv run avanza-mcp --transport http --port 8000The MCP endpoint is http://127.0.0.1:8000/mcp, and /healthz is a health check.
By default it listens on
127.0.0.1only.If
AVANZA_MCP_TOKENis set, every request must sendAuthorization: Bearer <token>.It refuses to listen on a non-loopback address without a token. The exception is
--allow-unauthenticated, meant for a private container network where the only way in is a tunnel you control.
ChatGPT needs to reach the server over the internet. Put it behind a tunnel or reverse proxy that handles authentication, and never expose an unauthenticated port.
Docker
docker build -t avanza-mcp .
docker run -d --name avanza-mcp -p 127.0.0.1:8000:8000 \
-e AVANZA_MCP_TOKEN=change-me -v avanza-mcp-data:/data avanza-mcpConfiguration
Setting | Default | |
|
|
|
|
| HTTP only |
|
| Where the session and snapshot are stored |
| unset | Bearer token required on HTTP |
| off | Allow a non-loopback HTTP address without a token |
Security
Read this before you run it.
One user per server. The server stores one Avanza session. Anyone who can call the server can read that person's accounts, holdings and transactions. Run your own instance and keep it private.
The stored session can do more than this server does. The tools are read-only, but the stored cookies are a normal Avanza web session, which can also place orders. Anyone who gets hold of the data directory can act on the account until the session ends (at most 24 hours). The directory is created
0700and the database0600. Usedisconnect_avanzato log out early.No credentials are stored. Login is BankID only; the server never sees a password or a personal identity number.
Instrument names and descriptions come from Avanza. The server tells the model to treat them as data, not instructions.
Limitations
If one BankID has several Avanza customer profiles (for example private plus a company), login fails: choosing a profile isn't supported yet.
Endpoints and response shapes are reverse-engineered and may change without notice.
License
Available Tools
11 toolsavanza_statusAvanza StatusARead-onlyIdempotent
Whether a BankID session is stored, the latest login attempt's status, and the snapshot age. Makes no Avanza call.
Inputs: no named parameters. Returns: object
bankid_login_pollBankid Login PollBRead-onlyIdempotent
Login panel only: current login status and QR code.
Inputs: no named parameters. Returns: object
bankid_login_startBankid Login StartA
Login panel only: start a BankID login, 'qr' to scan from another device or 'app' for this device.
Inputs: mode. Returns: object
connect_avanzaConnect AvanzaARead-only
Show the BankID login panel (live QR code, or a button that opens BankID on this device). The login happens in the panel; this call does not start BankID by itself.
Inputs: no named parameters. Returns: object
disconnect_avanzaDisconnect AvanzaA
Log out of Avanza and delete the stored session. The holdings snapshot is kept.
Inputs: no named parameters. Returns: object
get_accountsGet AccountsARead-onlyIdempotent
Accounts with total value and cash. Live with a session, otherwise from the snapshot.
Inputs: no named parameters. Returns: object
get_holdingsGet HoldingsARead-onlyIdempotent
Positions (volume, value, acquired value) and cash, for one account or all. Live with a session, otherwise snapshot quantities priced with live public quotes.
Inputs: account_id. Returns: object
get_instrumentGet InstrumentBRead-onlyIdempotent
Quote, key ratios, dividend and report dates for a stock or ETF; NAV, fees, returns and top holdings for a fund.
Inputs: order_book_id (required). Returns: object
get_price_historyGet Price HistoryCRead-onlyIdempotent
Closing prices over a period.
Inputs: order_book_id (required), period. Returns: object
get_transactionsGet TransactionsARead-onlyIdempotent
Transactions (trades, deposits, dividends, fees), newest first. Needs a live session.
Inputs: limit, date_to, date_from, account_id. Returns: object
search_instrumentsSearch InstrumentsBRead-onlyIdempotent
Search stocks, funds, ETFs and more by name, ticker or ISIN.
Inputs: query (required), limit, instrument_type. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
The market-data tools (get_accounts, get_holdings, get_transactions, search_instruments, get_instrument, get_price_history) are cleanly separated, but the auth cluster is muddier: avanza_status and bankid_login_poll both report login state, and connect_avanza vs bankid_login_start differ only in a subtle panel-vs-login distinction. The descriptions do explicitly disambiguate ('this call does not start BankID by itself', 'Login panel only'), which keeps it from being worse than a 3.
Mostly verb_noun (get_accounts, search_instruments, disconnect_avanza), but prefixes are inconsistent: some tools carry domain prefixes (avanza_status, bankid_login_start), others are bare verbs (connect_avanza, get_holdings), and avanza_status is a noun phrase rather than an action. Readable, but not a single predictable pattern.
Eleven tools is a sensible scope for a brokerage read/query server. Four of them are spent on the BankID auth lifecycle (status, connect, start, poll), which is slightly heavy but justified given the session-based access model.
Account, holdings, transaction, instrument and price-history reads give decent coverage of a read-only investing workflow, with a working snapshot fallback. However, there are no order/trade tools, no watchlists, and no session-refresh or order-history-by-instrument operations, leaving notable gaps for a brokerage domain.
Maintenance
Related MCP Connectors
Ask your AI about your own accounts, debts, budgets and goals. OAuth sign-in, read-only by default.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Build and backtest investing strategies from your AI assistant. Remote MCP with OAuth sign-in.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with Charles Schwab accounts through OAuth authentication, providing access to account balances, real-time market quotes, options chains, transaction history, order management, and comprehensive market data.1MIT
- AlicenseBqualityBmaintenanceProvides access to Avanza's public API for real-time Swedish stock quotes, fund information, and comprehensive market data. It enables users to perform detailed stock analysis, compare funds, and retrieve portfolio holdings through natural language.3432MIT
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server that securely connects Swedish/Nordic bank accounts to AI assistants, keeping all financial data local and encrypted.33 npmMIT

BankBridgeofficial
AlicenseNot gradedqualityBmaintenanceEnables financial data access from connected bank accounts via MCP tools, allowing natural language queries about balances, transactions, subscriptions, investments, and more, with a focus on privacy and read-only access.2MIT