Avanza MCP Server
Read-only Avanza market-data MCP server for instrument discovery and research, plus optional experimental BankID-based account read access.
Search stocks, funds, ETFs, certificates, warrants, and futures/forwards by name, ticker, ISIN, or order-book ID.
Retrieve stock quotes, charts, order books, marketplace status, recent trades, broker summaries, ownership, short-selling, dividends, ratios, and company financials.
Retrieve fund info, ESG/sustainability metrics, chart periods, descriptions, holdings, country/sector allocations, and fund performance data.
Filter and inspect certificates, ETFs, warrants, and futures/forwards with info, extended details, and filter options.
Access market-maker charts, OHLC data, and additional ownership/short-selling history.
Optionally enable experimental local BankID auth to read accounts, holdings, transactions, credit info, portfolio insights, active orders, deals, stop-loss orders, watchlists, alerts, offers, news, forum posts, and insider transactions.
All tools are read-only: no order placement, editing, or cancellation.
Built-in prompts/resources support stock analysis, fund comparison, dividend screening, usage docs, and quick-start workflows.
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 Server Show me the top holdings and performance for the Avanza Global fund"
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 Server
New: Avanza Desk is a fast, keyboard-first trading terminal for your Avanza account, with built-in agent support. Free and open source. Check it out →
Want to use Avanza with your own coding agents? Consider the Avanza CLI with agent skills instead. It may be a better fit for agent workflows.
Read-only access to Avanza market and optional account data from your MCP client. Public tools require no Avanza account.
Disclaimer
This is an unofficial API client/MCP Server. Not affiliated with Avanza Bank AB. The underlying API can be taken down or changed without warning at any point in time.
The author of this software is not responsible for any indirect damages (foreseeable or unforeseeable), such as, if necessary, loss or alteration of or fraudulent access to data, accidental transmission of viruses or of any other harmful element, loss of profits or opportunities, the cost of replacement goods and services or the attitude and behavior of a third party.
Related MCP server: Stock Ticker MCP Server
Features
Stocks, funds, ETFs, certificates, warrants and futures/forwards.
Quotes, charts, financial ratios, dividends, order books and ownership data.
Fund performance, fees, holdings, sustainability and research prompts.
Optional local BankID authentication for read-only accounts, holdings and activity.
Setup
Requires uv and Python 3.12+. Local clients launch the server over stdio.
Both use this configuration:
{
"mcpServers": {
"avanza": {
"command": "uvx",
"args": ["avanza-mcp"]
}
}
}Claude Desktop: open Settings > Developer > Edit Config, merge the configuration, then fully restart Claude Desktop.
Cursor: add it to
.cursor/mcp.jsonin your project, or~/.cursor/mcp.jsonglobally. Enable the server in Cursor's MCP settings.
Run in your project:
claude mcp add avanza -- uvx avanza-mcpUse /mcp in Claude Code to check the connection.
Add to .vscode/mcp.json, or open MCP: Open User Configuration for global setup:
{
"servers": {
"avanza": {
"type": "stdio",
"command": "uvx",
"args": ["avanza-mcp"]
}
}
}Run MCP: List Servers, start avanza, and enable its tools in agent chat.
Add to your project's opencode.json or global ~/.config/opencode/opencode.json:
{
"mcp": {
"avanza": {
"type": "local",
"command": ["uvx", "avanza-mcp"],
"enabled": true
}
}
}From a source checkout:
uv sync
uv run fastmcp run src/avanza_mcp/__init__.py:mcp --transport httpConnect HTTP clients to http://localhost:8000/mcp. ChatGPT requires a remotely reachable HTTPS deployment; add its /mcp URL using ChatGPT's developer-mode setup.
This project does not provide a hosted endpoint. Configure access controls before exposing your server publicly.
Install with uv add avanza-mcp, then use FastMCP's in-process client:
import asyncio
from fastmcp import Client
from avanza_mcp import mcp
async def main():
async with Client(mcp) as client:
result = await client.call_tool(
"search_instruments", {"query": "Volvo", "instrument_type": "stock"}
)
print(result.structured_content)
asyncio.run(main())If a desktop client cannot find uvx, use its absolute executable path. See DEVELOPMENT.md for running from source and tests.
Experimental Account Access
BankID authentication and account tools are experimental and rely on undocumented Avanza APIs that may change without notice. Review the privacy notes below before enabling them.
Authenticated access is disabled by default. Enable it by adding AVANZA_MCP_AUTH=1 to the local MCP server environment. For example, OpenCode uses:
{
"mcp": {
"avanza": {
"type": "local",
"command": ["uvx", "avanza-mcp"],
"environment": {"AVANZA_MCP_AUTH": "1"},
"enabled": true
}
}
}Restart OpenCode after changing its configuration.
Authentication Flow
A temporary page opens on
127.0.0.1and asks for consent.After approval, scan the locally rendered QR code with BankID.
Avanza verifies the session and enables the experimental tools.
No Avanza password is requested in the browser or chat. Existing market-data tools automatically use the valid session when one is available; no duplicate authenticated market tools are added.
Session Data
Verified session cookies and the Avanza security token are stored in the operating system's native credential store and revalidated on startup:
macOS Keychain
Windows Credential Manager
Linux Secret Service, which must be installed, unlocked and available over D-Bus
Credentials are not stored in project files, browser storage, logs, or MCP results. Account responses are not cached by this project.
Avanza controls session duration through the account's website setting. See How long can I stay logged in? to change it.
Use disconnect_avanza to remove the local credential and attempt remote logout.
Account tool results may be sent to the configured model provider and saved in conversation history.
Tools
The default 34-tool catalog is read-only. Search first to obtain an order_book_id; history tools expose pagination. Data is latest available, not guaranteed live.
Category | Tool | Description |
Search |
| Find instruments by name, ticker or ISIN |
Search |
| Match an exact ID within search candidates |
Stocks |
| Company, listing, fundamentals and quote |
Stocks |
| Latest price and trading volume |
Stocks |
| Historical OHLC price points |
Stocks |
| A named financial-ratio history |
Stocks |
| A named dividend metric by financial year |
Stocks |
| A named annual or quarterly financial metric |
Market |
| Bid/ask depth |
Market |
| Trading hours and market status |
Market |
| Recent trade snapshot |
Market |
| Broker buy/sell activity |
Funds |
| NAV, performance, fees and fund information |
Funds |
| ESG and sustainability metrics |
Funds |
| Historical fund chart points |
Funds |
| Available performance periods |
Funds |
| Investment strategy and category |
Funds |
| Country, sector and top-holding allocations |
Certificates |
| Filter and list certificates |
Certificates |
| Certificate information |
Certificates |
| Extended certificate details |
Warrants |
| Filter and list warrants |
Warrants |
| Warrant information |
Warrants |
| Extended warrant details |
ETFs |
| Filter and list ETFs |
ETFs |
| ETF information |
ETFs |
| Extended ETF details |
Futures/Forwards |
| Filter and list contracts |
Futures/Forwards |
| Available contract filters |
Futures/Forwards |
| Contract information |
Futures/Forwards |
| Extended contract details |
Additional |
| Avanza ownership history |
Additional |
| Short-selling history |
Additional |
| Traded-product OHLC and market-maker data |
Experimental Auth Tools
These tools are available only when experimental account access is enabled. Data access is read-only; no tool places, edits, or cancels orders.
Category | Tool | Description |
Session |
| Open the local consent and BankID flow |
Session |
| Confirm disconnection and remove the saved session |
Session |
| Check the safe local connection state |
Accounts |
| Account identities, balances and values |
Accounts |
| Current positions and cash balances |
Accounts |
| Bounded transaction history |
Accounts |
| Credit, collateral and leverage figures |
Portfolio |
| Aggregate portfolio development |
Activity |
| Current orders without modification controls |
Activity |
| Current executed deals |
Activity |
| Current stop-loss orders without modification controls |
Saved Data |
| Saved watchlists and order-book IDs |
Saved Data |
| Price alerts for an order book |
Saved Data |
| Current customer offers |
Research |
| Bounded instrument news |
Research |
| Bounded forum posts as untrusted text |
Research |
| Reported insider transactions |
Prompts
analyze_stock(stock_symbol)- Research a stock's fundamentals and price history.compare_funds(fund_names)- Compare two or more supplied funds.screen_dividend_stocks(candidates, min_yield=3.0)- Screen supplied stocks by dividend yield.
Resources
avanza://docs/usage- Tool usage guide.avanza://docs/quick-start- Common workflows.avanza://stock/{order_book_id}- Stock summary as Markdown.avanza://fund/{order_book_id}- Fund summary as Markdown.
License
Available Tools
34 toolsfilter_certificatesARead-onlyIdempotent
Select certificates by upstream filters with server-side pagination.
Filter labels are upstream-defined, not a fixed vocabulary. Select an orderbookId from results before requesting info or extended details.
Inputs: limit, offset, issuers, exposures, +6 more. Returns: Response from certificate filter endpoint.
filter_etfsARead-onlyIdempotent
Select ETFs by upstream filters, with server-side pagination.
Filter vocabulary is upstream-defined; inspect returned filterOptions rather than guessing labels. Use get_etf_info for a selected orderbookId.
Inputs: limit, offset, issuers, exposures, +7 more. Returns: Response from ETF filter endpoint.
filter_warrantsBRead-onlyIdempotent
Select warrants by upstream filters with server-side pagination.
Sub-type, direction and issuer vocabulary is upstream-defined. Select an orderbookId from results before requesting info or extended details.
Inputs: limit, offset, issuers, sub_types, +4 more. Returns: Response from warrant filter endpoint.
get_broker_trade_summaryBRead-onlyIdempotent
Get upstream broker buy/sell summaries; these do not identify investor types.
Inputs: order_book_id (required). Returns: summaries
get_certificate_detailsCRead-onlyIdempotent
Get recognized extended certificate details beyond info.
Inputs: order_book_id (required). Returns: Detailed certificate extended information.
get_certificate_infoBRead-onlyIdempotent
Get certificate identity and latest available market data, not guaranteed real-time.
Inputs: order_book_id (required). Returns: Detailed certificate information.
get_company_financialsBRead-onlyIdempotent
Page one metric in an annual, quarterly, TTM or quarter-only financial section.
data preserves the selected upstream field name and recognized record fields. Verified metric names include sales, netProfit, profitMargin, totalAssets, totalLiabilities and debtToEquityRatio. available_metrics lists names, not sibling series. Missing sections are omitted, not fabricated. No unit conversions are made.
Inputs: metric (required), order_book_id (required), limit, offset, +1 more. Returns: One named metric in one selected section, without sibling series or summaries.
get_dividendsARead-onlyIdempotent
Page one dividendsByYear metric: dividendPerShare, directYieldRatio or dividendPayoutRatio.
data preserves the upstream section name. Missing data is omitted, not an empty history. Records contain financialYear, reportType, value and optional date, not inferred ex/payment dates. available_metrics lists names only; sibling series are excluded. Units and scales are upstream-defined.
Inputs: metric (required), order_book_id (required), limit, offset. Returns: One named metric in one selected section, without sibling series or summaries.
get_etf_detailsARead-onlyIdempotent
Get extended ETF details beyond info. Detail fields are upstream-defined and flexible.
Inputs: order_book_id (required). Returns: Detailed ETF extended information.
get_etf_infoARead-onlyIdempotent
Get ETF identity, listing and latest available quote; not guaranteed real-time.
Inputs: order_book_id (required). Returns: Detailed ETF information.
get_fund_chartARead-onlyIdempotent
Get a page of raw fund dataSerie points in source order, without aggregation.
x/y values retain upstream meaning; y is not assumed to be NAV or a return. Offset/limit slice the chosen period; dates describe the full source period.
Inputs: order_book_id (required), limit, offset, time_period. Returns: data, pagination
get_fund_chart_periodsARead-onlyIdempotent
Get available fund performance periods, rather than individual chart points.
startDate is the source period start date. change retains its upstream scale; do not assume it uses the same scale as fund-guide development fields.
Inputs: order_book_id (required). Returns: periods
get_fund_descriptionBRead-onlyIdempotent
Get the fund's investment description and category explanation.
Inputs: order_book_id (required). Returns: Fund description and category information.
get_fund_holdingsARead-onlyIdempotent
Get reported country, sector and holding allocations, not a complete position ledger.
portfolioDate is the source portfolio date, not retrieval time. Missing dates are not inferred. Missing allocations are null; reported empty arrays stay []. Allocation values are returned without unit conversion.
Inputs: order_book_id (required). Returns: portfolioDate, sectorChartData, countryChartData, holdingChartData
get_fund_infoARead-onlyIdempotent
Get fund identity, latest available NAV, fees, risk and allocations.
Missing currency and tradeability remain unknown. Not guaranteed real-time. Use get_fund_holdings for allocations only, get_fund_chart for raw history.
Inputs: order_book_id (required). Returns: Fund guide fields; fees and development retain source scales and basis.
get_fund_sustainabilityARead-onlyIdempotent
Get latest available fund ESG and sustainability data, not a real-time assessment.
Inputs: order_book_id (required). Returns: Fund sustainability and ESG metrics.
get_future_forward_detailsCRead-onlyIdempotent
Get recognized extended contract details beyond info.
Inputs: order_book_id (required). Returns: Detailed future/forward extended information.
get_future_forward_filter_optionsARead-onlyIdempotent
Get current upstream filter options before selecting futures/forwards.
Option names and values retain their upstream vocabulary.
Inputs: no named parameters. Returns: endDates, optionTypes, callIndicators, underlyingInstruments
get_future_forward_infoCRead-onlyIdempotent
Get contract identity and latest available market data, not guaranteed real-time.
Inputs: order_book_id (required). Returns: Detailed future/forward information.
get_instrument_by_order_book_idARead-onlyIdempotent
Match an exact order_book_id among at most 50 search candidates.
Search is not authoritative: failure to match does not prove the ID is invalid. Never substitutes the first or a similarly named search result.
Inputs: order_book_id (required). Returns: Curated instrument identity; presentation and highlighting are excluded.
get_marketmaker_chartARead-onlyIdempotent
Get raw OHLC and market-maker data for traded products, not stock/fund charts.
Both arrays are independently sliced with the same offset/limit in source order; their metadata counts are separate. No point alignment, aggregation or unit conversion is inferred. Upstream fields are under data, separate from wrapper pagination keys. Not guaranteed real-time.
Inputs: order_book_id (required), limit, offset, time_period. Returns: data, pagination, marketMakerPagination
get_marketplace_infoBRead-onlyIdempotent
Get latest available marketplace status and trading hours.
Inputs: order_book_id (required). Returns: Marketplace status and trading hours.
get_number_of_ownersBRead-onlyIdempotent
Page Avanza ownersPoints in source order and preserve the full historySummary.
data contains upstream fields, not a fabricated top-level owner count. Summary fields describe the full source history, not this page. Not market-wide ownership.
Inputs: order_book_id (required), limit, offset. Returns: data, pagination
get_orderbookARead-onlyIdempotent
Get latest available buy/sell depth; empty levels are valid. Not guaranteed real-time.
Inputs: order_book_id (required). Returns: Order book depth showing buy and sell orders.
get_recent_tradesBRead-onlyIdempotent
Page through the latest available trade snapshot in upstream order.
Not a complete trade history or guaranteed real-time feed. Separate page requests may observe a changed snapshot; total is the current source count.
Inputs: order_book_id (required), limit, offset. Returns: trades, pagination
get_short_sellingARead-onlyIdempotent
Page shortSellingHistory in source order; timestamp/ratio values are not converted.
data preserves upstream fields. A page is not the full history or a latest-value summary. Offset zero is the beginning of source order, not necessarily newest.
Inputs: order_book_id (required), limit, offset. Returns: data, pagination
get_stock_analysisARead-onlyIdempotent
Get one named metric within a ratio section, paginated in source order.
Select annual, quarterly, quarter-over-quarter, TTM, or company annual ratios. For dividends or financial statements use the dedicated tools. The selected section and metric names are retained inside data; absent fields are omitted. Example metric: priceEarningsRatio for stock ratios, earningsPerShare for company ratios. available_metrics lists the selected section's names. Sibling series and keyRatios summary sections are intentionally excluded, not aggregated. Units and record details are upstream-defined; no normalization is applied.
Inputs: metric (required), order_book_id (required), limit, offset, +1 more. Returns: One named metric in one selected section, without sibling series or summaries.
get_stock_chartARead-onlyIdempotent
Get a page of raw stock OHLC points in source order, without aggregation.
Offset/limit slice the selected period, not a date range. Metadata describes the full upstream period. Upstream fields live under data, isolated from wrapper pagination keys. Latest available data is not guaranteed real-time.
Inputs: order_book_id (required), limit, offset, time_period. Returns: data, pagination
get_stock_infoARead-onlyIdempotent
Get stock identity, listing, company, ratios and latest available quote.
Use search_instruments to select an order_book_id. For pricing only, prefer get_stock_quote. Data is not guaranteed real-time.
Inputs: order_book_id (required). Returns: Complete stock information from Avanza API.
get_stock_quoteARead-onlyIdempotent
Get latest available stock prices and trading data, without company details.
Not guaranteed real-time; inspect isRealTime and upstream timestamps. Null is unknown; zero is a reported value.
Inputs: order_book_id (required). Returns: Latest available stock quote data; inspect isRealTime and source timestamps.
get_warrant_detailsCRead-onlyIdempotent
Get recognized extended warrant details beyond info.
Inputs: order_book_id (required). Returns: Detailed warrant extended information.
get_warrant_infoARead-onlyIdempotent
Get warrant identity and latest available market data, not guaranteed real-time.
Inputs: order_book_id (required). Returns: Detailed warrant information.
list_futures_forwardsBRead-onlyIdempotent
Select futures/forwards with server-side pagination and ISO YYYY-MM-DD end dates.
Use get_future_forward_filter_options for current filter vocabulary. The Matrix results include recognized contract, option, filter, and pagination fields.
Inputs: limit, offset, end_dates, sort_field, +3 more. Returns: Response from futures/forwards matrix endpoint.
search_instrumentsARead-onlyIdempotent
Search names, tickers or ISINs and return compact instrument identities.
Select by name, type, exchange, ISIN and currency, not rank alone. One page of at most 50 candidates is examined, with stock/fund filtering upstream; other types are filtered locally. All excludes FAQ, unknown types and invalid IDs. Type/ID filtering precedes limit. totalNumberOfHits counts valid matching candidates before limit, not a full filtered universe. candidatesExamined includes discarded hits; upstreamTotalNumberOfHits is before local filtering. No additional pages are fetched. Search is not an authoritative ID registry.
Inputs: query (required), limit, instrument_type. Returns: hits, returned, searchQuery, totalNumberOfHits, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Tools are largely distinct by resource (stock, fund, ETF, warrant, certificate, future/forward) and action (info, details, chart, filter, list). However, info vs details pairs for the same instrument type and overlapping fund/stock data tools (e.g., get_stock_info vs get_stock_quote) create minor ambiguity that descriptions mostly resolve.
All tool names use consistent snake_case with verb-first patterns (get_, filter_, list_, search_). The naming is predictable and readable across the set.
34 tools is excessive for the apparent scope; many info/details pairs and separate filter tools for each instrument type could be consolidated via parameters, reducing the count significantly.
The surface covers many data aspects for stocks, funds, ETFs, certificates, warrants, and futures/forwards, but lacks tools for other common asset classes (e.g., options, bonds, indices) and news/events, leaving some gaps for a comprehensive financial data server.
Maintenance
Related MCP Connectors
Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.
Fetch current stock prices and key data for symbols across global markets. Look up companies like…
Yahoo Finance stock quotes and multi-ticker comparison as agent tools.
Global stock and UCITS ETF research. Free: 700 successful MCP tool calls per rolling 30 days. Pro: CHF 5/month or CHF 50/year for higher usage. Screen stocks, compare fund costs and holdings, and inspect company risks. No account or API key for public research. Plans: https://bull-run.org/pricing. Connect your Bullrun account through OAuth to use Pro.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time stock quotes, historical price data, financial news, and multi-stock comparisons using Yahoo Finance data. Enables users to access comprehensive financial market information through natural language queries.1,737 npm1MIT
- -licenseNot gradedqualityDmaintenanceProvides real-time and historical stock market data through the Alpha Vantage API. Enables users to get current stock prices and retrieve historical stock data for any major stock symbol via natural language queries.-
- FlicenseNot gradedqualityDmaintenanceProvides real-time access to financial market data including stock quotes, company information, cryptocurrency exchange rates, historical options chains, and time series data through the Alpha Vantage API.-
- AlicenseCqualityDmaintenanceProvides access to real-time and historical stock market data through the Alpha Vantage API, enabling financial analysis and market data queries through natural language.10054 PyPI74Apache 2.0