Portfolio Analytics MCP
Portfolio Analytics MCP is a read-only MCP server for market data and portfolio/ETF analysis across stocks and ETFs, with European ISIN/UCITS and multi-currency support.
Look up symbols and instruments: search names, tickers or ISINs; get symbol info; resolve ISINs to Yahoo listings.
Fetch market data: price history, latest quotes, FX rates, dividends, performance/risk statistics and correlations.
Analyze ETFs by ISIN: profile and costs, country/sector/holdings exposure, performance, performance history, listings, similar ETFs, and side-by-side ETF comparison.
Analyze ETF portfolios: weighted fees, fund sizes, and combined exposure by currency, provider, index, sector, country, and holdings.
Analyze mixed stock/ETF portfolios: risk and return in a chosen currency, benchmark comparison, FX handling, portfolio weights, beta, drawdown, and per-holding risk contribution.
All tools are read-only; no API key or account is required, and personal quantities/amounts stay local.
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., "@Portfolio Analytics MCP How volatile is my 30k EUR portfolio of IE00B4L5Y983 and 10 ASML.AS?"
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.
Portfolio Analytics MCP
Ask Claude about your investments in plain language. This is an MCP server that gives Claude (or any MCP client) read-only tools for market data and portfolio analysis: prices, FX, ETF costs and exposure, and risk for a whole portfolio of stocks and ETFs, measured in your own currency.
It is built for European investors as much as US ones: it understands ISINs, UCITS ETFs listed on several exchanges, and prices quoted in pence.
What you can ask
"I hold 30k EUR of IE00B4L5Y983, 10 ASML.AS and 25 AAPL. How volatile is this portfolio, and which position contributes most to the risk?"
"Compare the costs of the iShares Core MSCI World and the Vanguard FTSE All-World. Which is cheaper and bigger?"
"How much of my ETF portfolio is in US tech stocks? Do my ETFs overlap?"
"What has VWCE returned since 2021 in euros, compared with the S&P 500?"
Claude picks the right tools, fetches the data and explains the result.
Related MCP server: Financial Risk MCP Server
What's inside
Area | What it gives you | Data source |
Portfolio | Risk and return of a mixed portfolio in one currency: volatility, drawdown, beta, risk per position | Yahoo Finance + justETF |
ETFs | Costs (TER), fund size, country/sector/stock exposure, listings, similar funds, portfolio look-through | |
Markets | Price history, quotes, FX rates, performance statistics, correlations, dividends |
20 tools in total, all read-only. No API key or account needed. See the user guide for the full list.
Quickstart
You need uv. It downloads Python 3.12, the server and its dependencies on first run, and checks for a new release each time the server starts.
1. Connect it to Claude
Claude Code:
claude mcp add finance -- uvx portfolio-analytics-mcp@latestClaude Desktop: add this to claude_desktop_config.json, then restart the
app. If it can't find uvx, use the full path that which uvx prints.
{
"mcpServers": {
"finance": {
"command": "uvx",
"args": ["portfolio-analytics-mcp@latest"]
}
}
}To stay on one version instead, use portfolio-analytics-mcp==0.2.0.
The server runs on your machine. Only symbols and ISINs go out, to Yahoo Finance and justETF; your quantities and amounts never leave it.
2. Ask a question, for example "What is the TER of IE00B4L5Y983?"
To work on the code instead, see Contributing.
Want to run it as a shared remote server instead? See Remote deployment.
Important to know
Not financial advice. The tools report data and statistics; past performance does not predict future results. Data can be delayed, incomplete or wrong, and is provided as is, without warranty.
Not affiliated with Yahoo, justETF or any fund provider. Names and trademarks belong to their owners.
Personal use only. Yahoo Finance (through the unofficial yfinance library) and justETF are third-party sites. This server makes polite, on-demand requests (rate-limited and cached) and is not meant for bulk downloads or redistributing their data. Check their terms before using it.
Quotes can be delayed by up to ~20 minutes, and Yahoo's coverage of European ETF holdings is patchy (the justETF tools fill that gap).
Learn more
User guide: every tool, example workflows, configuration, remote deployment and limitations.
Agent skill: tells an agent when and how to use the tools, and how to present results.
Contributing: development setup, tests and project layout.
License
Available Tools
20 toolsanalyze_portfolioARead-only
Analyse a list of ETFs: cost, fund size, structure and look-through exposure.
Give each position as {"isin": "...", "amount": 5000}. `amount` is the
money (any currency, used for weights and yearly cost) or a weight; give
it for every position or for none (equal weights). Use
`focus_countries` / `focus_sectors` (e.g. ["United States"],
["Technology"]) to get only those buckets. Named buckets are lower
bounds: justETF lumps the tail into "Other".
Args:
positions: List of {"isin": str, "amount": number (optional)}.
top_n: Buckets to return per breakdown when no focus is given.
focus_countries: Only return countries containing one of these names.
focus_sectors: Only return sectors containing one of these names.
refresh: Bypass the 24h cache.
Returns:
Weighted TER and yearly fees, fund size per ETF (with small-fund
flags), portfolio share by distribution/replication/domicile/
currency/provider/index, and combined exposure by country, sector
and top stocks with each ETF's contribution; or an `error`.
Inputs: positions (required), top_n, refresh, focus_sectors, +1 more.
analyze_portfolio_riskARead-only
Risk and return of a whole portfolio, measured in one base currency.
Positions can be stocks or ETFs, given by Yahoo symbol or ISIN, sized
by quantity (shares) or current value (in base currency); with
neither, positions are equally weighted. Prices are converted to the
base currency with daily FX (pence-quoted London listings handled),
put on a common calendar, and analysed. Use analyze_portfolio
(justETF) for cost and country/sector/stock look-through of ETFs.
Example positions: [{"isin": "IE00B4L5Y983", "value": 30000},
{"symbol": "ASML.AS", "quantity": 10}, {"symbol": "AAPL", "quantity": 25}]
Args:
positions: Up to 30 holdings: {symbol | isin, quantity | value}.
base_currency: ISO code of the investor's currency. Default EUR.
benchmark: Optional Yahoo symbol, e.g. "IWDA.AS" or "^GSPC".
start_date: YYYY-MM-DD. Defaults to 3 years before end_date.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest data.
interval: Return frequency. Default "1wk": daily returns across
regions (US vs Europe) understate correlation and beta because
the markets close hours apart.
method: "current_holdings" (today's units held throughout) or
"constant_weights" (rebalanced to today's weights each period).
risk_free_rate_pct: Annual risk-free rate in %, e.g. 2.0.
Returns:
Total value and weights; portfolio return, volatility,
Sharpe/Sortino/Calmar, max drawdown (dates); vs `benchmark` beta,
alpha, tracking error, information ratio; per position return,
volatility, beta and share of portfolio risk; correlation matrix;
diversification ratio; how ISINs were resolved; FX rates used;
warnings (short histories, stale quotes, bad Yahoo prices
removed). Or an error dict.
Inputs: positions (required), method, end_date, interval, +4 more.
compare_etfsARead-only
Side-by-side comparison of up to 15 ETFs by ISIN.
Args:
isins: List of ETF ISINs.
refresh: Bypass the 24h cache.
Returns:
`etfs`: one row each with cost (TER), fund size, distribution,
replication, domicile, index, currency, hedging, inception,
returns, volatility and holdings count; the `cheapest` and
`largest` ISIN; per-ISIN `errors`.
Inputs: isins (required), refresh.
get_correlationARead-only
Correlation matrix of returns between 2+ tickers (default weekly).
Exchange holidays are forward-filled and only the common window is used.
Without `base_currency`, each series is in its own currency, so FX moves
affect the result; set e.g. base_currency="EUR" to measure as a euro
investor experiences it.
Args:
tickers: 2 or more Yahoo symbols.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive).
interval: "1d", "1wk" or "1mo".
base_currency: Optional ISO code to convert all prices into first.
Returns:
The `correlation` matrix with its window and observations, plus
`missing` tickers and `warnings`; or an error dict.
Inputs: tickers (required), end_date, interval, start_date, +1 more.
get_dividendsARead-only
Dividend payments per share for a ticker, plus a trailing-12-month total.
Amounts are per share as Yahoo reports them; this can be the fund's
distribution currency rather than the listing's trading currency (e.g. a
USD-distributing ETF listed in GBP), so check before computing a yield.
Args:
ticker: Yahoo symbol.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive).
Returns:
`dividends` by date in the range with their `total` and `count`, plus
`trailing_12m_total` and `payments_last_12m`; or an error dict.
Inputs: ticker (required), end_date, start_date.
get_etf_exposureARead-only
Country, sector and top-10 holdings breakdown of one ETF (justETF).
justETF lists the largest ~10 countries and ~13 sectors; the remainder
is reported as "Other". Top holdings are limited to the top 10.
Args:
isin: ETF ISIN.
section: "countries", "sectors", "holdings" or "all".
refresh: Bypass the 24h cache.
Returns:
The requested breakdowns with weights in %, the as-of date and
warnings; or an `error`.
Inputs: isin (required), refresh, section.
get_etf_holdingsARead-only
Top holdings of an ETF with each company's % weight, from Yahoo.
Yahoo usually exposes only the top ~10 holdings; `total_pct_covered`
shows how much of the fund that is. For UCITS ETFs and portfolio-level
overlap, prefer get_etf_exposure / analyze_portfolio (justETF, by ISIN).
Args:
ticker: Yahoo symbol of the fund, e.g. "QQQ", "IWDA.AS".
Returns:
`holdings` (symbol, name, weight_pct) and `total_pct_covered`; or an
error dict.
Inputs: ticker (required).
get_etf_listingsARead-only
Exchanges where an ETF trades: currency, ticker, Bloomberg/Reuters codes.
Useful to find the ticker for a specific exchange (e.g. XETRA vs London).
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
`listings`, one per exchange; or an `error`.
Inputs: isin (required), refresh.
get_etf_performanceARead-only
Returns and risk of an ETF from justETF.
Returns are in the currency named in `currency` (EUR by default).
Past performance does not predict future results.
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
`performance`: period returns (YTD, 1m, 3m, 6m, 1y, 3y, 5y, since
inception) and calendar-year returns; `risk`: volatility (1/3/5y),
return per risk and maximum drawdown. Or an `error`.
Inputs: isin (required), refresh.
get_etf_profileARead-only
Key facts about an ETF from justETF, looked up by ISIN.
Example ISIN: IE00B4L5Y983 (iShares Core MSCI World, Acc).
Args:
isin: ETF ISIN (12 characters).
refresh: Bypass the 24h cache and re-download the page.
Returns:
Name, ticker, TER (% p.a.), fund size, distribution policy
(accumulating/distributing), replication, index, fund currency and
currency hedging, domicile, provider, inception date, number of
holdings, legal structure, tax status per country, securities
lending and a description; or an `error`.
Inputs: isin (required), refresh.
get_etf_sector_allocationARead-only
Sector allocation (% by sector) of an ETF or fund, from Yahoo.
Yahoo coverage of European UCITS ETFs is patchy: for those, prefer
get_etf_exposure (justETF, by ISIN).
Args:
ticker: Yahoo symbol of the fund, e.g. "SPY", "IWDA.AS".
Returns:
`sector_allocation_pct` by sector, largest first; or an error dict.
Inputs: ticker (required).
get_fx_ratesARead-only
Latest FX rates into a base currency (and the change since start_date).
Rate = units of base_currency per 1 unit of the currency, e.g. with base
EUR, USD -> 0.92 means 1 USD = 0.92 EUR. Minor units are accepted
("GBp" is converted as GBP / 100).
Args:
currencies: ISO codes, e.g. ["USD", "GBP", "CHF"].
base_currency: ISO code to express rates in. Default EUR.
start_date: Optional YYYY-MM-DD to also return the % change since then.
Returns:
`base_currency` and per currency `rate` and `date` (plus
`start_rate` and `change_since_start_pct` with start_date).
Inputs: currencies (required), start_date, base_currency.
get_performance_statsARead-only
Return and risk statistics per ticker, optionally vs a benchmark.
Total and annualised return (annualised only for windows >= 1 year),
annualised volatility, Sharpe, Sortino, Calmar, max drawdown with peak /
trough / recovery dates, best and worst period. With `benchmark`: beta,
alpha, correlation, tracking error and information ratio. Uses adjusted
closes (dividends reinvested). Each ticker uses its own available window,
so check `from`/`to` before comparing; for a portfolio use
analyze_portfolio_risk.
Args:
tickers: Yahoo symbols.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest value.
interval: Return frequency: "1d", "1wk" or "1mo".
base_currency: Optional ISO code to measure everything in (e.g. "EUR"
for a euro investor holding USD assets); default local currency.
risk_free_rate_pct: Annual risk-free rate in %, for Sharpe/Sortino.
benchmark: Optional Yahoo symbol to compare against, e.g. "IWDA.AS".
Returns:
`stats` per ticker (with `vs_benchmark` when given), the currency used
and any `warnings`; or an error dict.
Inputs: tickers (required), end_date, interval, benchmark, +3 more.
get_price_historyARead-only
Get historical adjusted closing prices for one or more tickers.
Prices are adjusted for splits and dividends. Series longer than 400
points are thinned evenly (first and last kept, `thinned: true`); use a
coarser interval for full data. For statistics, prefer
get_performance_stats / analyze_portfolio_risk over computing from this.
Args:
tickers: Yahoo symbols, e.g. ["AAPL", "ASML.AS", "VWCE.DE"].
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest value.
interval: "1d", "1wk" or "1mo".
base_currency: Optional ISO code (e.g. "EUR") to convert all prices
into with daily FX; default is each listing's own currency.
Returns:
Per ticker: first/last date, last price, points, `thinned` and
`prices` by date; or an error dict.
Inputs: tickers (required), end_date, interval, start_date, +1 more.
get_quoteARead-only
Latest price, previous close, day change, currency and exchange.
Data may be delayed (up to ~15-20 min). `currency` is as Yahoo reports
it: "GBp" means pence (divide by 100 for GBP).
Args:
tickers: Yahoo symbols, e.g. ["IWDA.AS", "VWRL.L", "AAPL"].
Returns:
`as_of` and per ticker price, previous close, change %, currency and
exchange (or an error entry).
Inputs: tickers (required).
get_similar_etfsARead-only
ETFs on the same index (justETF's "further ETFs") with size, TER, policy.
Good for "is there a cheaper ETF tracking the same index?".
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
The index, this ETF's TER and size, and `similar_etfs`; or an `error`.
Inputs: isin (required), refresh.
get_symbol_infoBRead-only
Name, exchange, currency, type, sector/industry and country of a ticker.
Args:
ticker: Yahoo symbol, e.g. "ASML.AS".
Returns:
The known fields (empty ones left out), or an error dict.
Inputs: ticker (required).
resolve_instrumentARead-only
ISIN -> Yahoo Finance tickers, best listing first.
Use this to go from an ISIN (broker statement, KID, justETF) to a
symbol for the Yahoo tools. ETFs are mapped from their exchange
listings on justETF (XETRA -> .DE, Euronext Amsterdam -> .AS, London
-> .L, SIX -> .SW, ...); other ISINs (e.g. single stocks) fall back to
Yahoo search. Listings in `base_currency` rank first, then the most
liquid exchanges. Venues Yahoo lacks (gettex, Tradegate) are listed
under `unmapped_listings`. If the user holds a specific listing,
use that one.
Args:
isin: 12-character ISIN, e.g. IE00B4L5Y983.
base_currency: Optional ISO code to prefer listings trading in it.
Returns:
`yahoo_candidates` best first, the `source` used and any
`unmapped_listings`; or an error dict.
Inputs: isin (required), base_currency.
search_etfARead-only
Find an ETF's ISIN from its name, ticker or index (use this first).
Accepts e.g. "iShares Core MSCI World", "IWDA", "vanguard all world acc"
or an ISIN. Returns matches with ISIN, name and tickers. Yahoo Finance is
used as a fallback for fuzzy names; hits that cannot be mapped to an ISIN
come back in `unresolved_candidates` (isin null). Accumulating vs
distributing and hedged variants look alike: if several matches are
plausible, ASK THE USER which one they hold. All other justETF tools
need the ISIN.
Args:
query: Fund name, ticker, index name or ISIN.
max_results: Maximum matches to return.
use_yahoo: Also query Yahoo Finance when the registry has no full match.
Returns:
`matches` with ISIN, name, tickers and match type; optional
`unresolved_candidates`; a `note` on what to do next.
Inputs: query (required), use_yahoo, max_results.
search_symbolARead-only
Find ticker candidates for a company/ETF name, partial ticker or ISIN.
The same security often trades on several exchanges (e.g. ASML on NASDAQ
and Euronext Amsterdam), so when more than one candidate is plausible,
ASK THE USER which listing/exchange/currency they hold. For European ETFs
by ISIN, resolve_instrument gives exchange-accurate tickers.
Args:
query: Name, ticker fragment or ISIN.
max_results: Maximum candidates (1-25).
Returns:
`candidates` (symbol, name, type, exchange, sector) and a `note`.
Inputs: query (required), max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have clearly distinct roles: justETF/ISIN tools versus Yahoo/ticker tools versus portfolio-level analytics. The main ambiguity is between ETF exposure tools (get_etf_sector_allocation, get_etf_holdings, get_etf_exposure) and between search/resolve tools (search_symbol, search_etf, resolve_instrument), but the descriptions explicitly guide correct selection. A few boundaries require reading descriptions, so not perfect but strong.
All names use consistent snake_case with predictable verb_noun or verb_resource patterns. Variations like get_, search_, compare_, analyze_ and resolve_ are semantically appropriate rather than inconsistent. No camelCase or chaotic naming.
Twenty tools is slightly heavy, but the domain is broad: ETF discovery, metadata, prices, quotes, FX, statistics, correlations, dividends, comparisons and portfolio risk. Each tool serves a distinct workflow, though a few Yahoo/justETF duplicates could be consolidated. Overall well-scoped rather than bloated.
The surface covers the main portfolio analytics lifecycle: instrument search/resolution, ETF research, market data, risk/return statistics, correlation, dividends and portfolio-level look-through and risk analysis. Minor gaps exist around portfolio persistence and full index/ETF constituent data beyond top holdings, but these are workaroundable or outside the stated analytics scope.
Maintenance
Related MCP Connectors
Read-only market research: index funds, event cards, CLOB data, fund analytics. No orders.
Query your real net worth, spending, transactions, budgets and portfolio from any MCP client.
Research US-listed companies and funds with the StockPortfolio.pro MCP server. Tools cover SEC filing-grounded financials, filing timelines, company comparisons, watchlist screens, fund profiles, and cited filing questions. Filed figures include their fiscal period and EDGAR source URL; missing filing data is returned as null. Public tools work without authentication; optional API-key or OAuth access is supported. US-listed, USD-reporting companies only. Keyless access includes 3 free AI questions per rolling 30-day window. To get more now, choose the Dev plan ($19.99/month, 200 credits) at https://www.stockportfolio.pro/register?plan=dev, then follow https://www.stockportfolio.pro/docs/api-mcp to connect with OAuth or an API key. Or wait for the free allowance to renew.
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables read-only querying of JTX Markets account and market data, including balance, positions, orders, trades, funding history, and market summaries, through natural language in MCP-compatible clients.47 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables portfolio risk assessment, sentiment analysis, and investment recommendations via MCP tools.-
- FlicenseNot gradedqualityDmaintenanceProvides real-time financial market lookups (stock quotes, volume, P/E ratios) and deterministic portfolio risk (VaR) calculations as standardized MCP endpoints for AI assistant integration.-
- FlicenseNot gradedqualityAmaintenanceEnables natural-language financial research across SEC filings, earnings transcripts, financial metrics, stock and crypto market data, stock news, and prediction markets, returning structured, source-backed answers within MCP clients.-