mcp-etf-holdings
An MCP server that provides live Yahoo Finance ETF data and research tools.
Look up ETF metadata: name, category, AUM, expense ratio, yield, NAV/price, and returns.
Compare multiple ETFs side by side in one table.
Get an ETF's top holdings with portfolio weights.
Reverse-search which ETFs hold a given stock, optionally against a custom ETF list.
Summarize stock exposure across ETFs with weight, expense ratio, and AUM to find cheapest/largest exposure.
Search for ETFs by name, theme, or category.
Resolve company or fund names to ticker symbols.
Use prompt templates for ETF deep dives, fund comparisons, stock exposure, portfolio overlap checks, and theme exploration.
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., "@mcp-etf-holdings Compare SPY, VOO and IVV on expense ratio and 5-year return"
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.
mcp-etf-holdings
An MCP server for ETF data. Ask which funds hold a stock, compare fees, or pull top holdings. Data comes live from Yahoo Finance. No API key.
What you can ask
Ask Claude | Tool it calls |
"Which ETFs hold NVDA?" |
|
"What's the cheapest ETF for Nvidia exposure?" |
|
"Compare SPY, VOO, QQQ and SCHD" |
|
"What are SPY's top holdings?" |
|
"What is QQQ's expense ratio and AUM?" |
|
"Find me semiconductor ETFs" |
|
"What's the ticker for Berkshire Hathaway?" |
|
Search by company name or ticker symbol. "Which ETFs hold Nvidia?" works the same as "Which ETFs hold NVDA?". Ask about several funds at once and you get one comparison table.
Related MCP server: Stock Assistant MCP Server
Requirements
Python 3.11+
An MCP client: Claude Code, Claude Desktop, VS Code, Cursor, or Antigravity
uv, which runs the server without a manual install
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shSetup
You don't need to install the server first. Every config below launches it on demand with
uvx, in its own isolated environment.
To put it on your PATH instead, run pip install mcp-etf-holdings, then swap
uvx mcp-etf-holdings for a plain mcp-etf-holdings in any config below.
Claude Code
claude mcp add etf-holdings -- uvx mcp-etf-holdingsClaude Desktop
Open your config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the server:
{ "mcpServers": { "etf-holdings": { "command": "uvx", "args": ["mcp-etf-holdings"] } } }Quit Claude Desktop and reopen it. Closing the window is not enough.
VS Code
Create
.vscode/mcp.jsonin your workspace. For a global config, run MCP: Open User Configuration instead.Add the server. VS Code uses the key
servers, notmcpServers:{ "servers": { "etf-holdings": { "type": "stdio", "command": "uvx", "args": ["mcp-etf-holdings"] } } }Restart VS Code.
Cursor
Use the same JSON as Claude Desktop. Put it in .cursor/mcp.json for one project, or
~/.cursor/mcp.json for all of them. Restart Cursor.
Antigravity
Antigravity reads mcpServers from mcp_config.json. Put it in
~/.gemini/config/mcp_config.json for all projects, or <workspace>/.agents/mcp_config.json
for one:
{
"mcpServers": {
"etf-holdings": {
"command": "uvx",
"args": ["mcp-etf-holdings"]
}
}
}In the IDE you can open it from the agent panel: MCP Servers → Manage MCP Servers → View raw config.
Or install it as a plugin from a checkout of this repo (the plugin is just the same
config plus a manifest, in antigravity/etf-holdings):
agy plugin install /path/to/mcp-etf-holdings/antigravity/etf-holdingsFor the IDE, copy that folder into .agents/plugins/ (one workspace) or
~/.gemini/config/plugins/ (all workspaces).
To use the opt-in HTTP transport instead, Antigravity names the URL field serverUrl:
{"mcpServers": {"etf-holdings": {"serverUrl": "http://127.0.0.1:8000/mcp"}}}.
Verify it works
Ask your client each of these:
"Which ETFs hold NVDA?" — calls
find_etfs_holding_stock"Compare SPY, QQQ and VTI" — calls
compare_etfs, returns one table"Which ETFs hold Nvidia?" — resolves the name to
NVDAand says so
If you get real numbers back, you're done.
Example prompts
Copy any of these into a client that has the server connected.
Compare funds
Compare SPY, VOO, IVV and SPLG — they all track the S&P 500, so which is cheapest?
Compare QQQ, VGT, XLK and SMH on expense ratio and 5-year return.
Search by name or ticker
Which ETFs hold Nvidia?
What's the ticker for Berkshire Hathaway?
Find me the Vanguard total stock market fund and show its top holdings.
Find the cheapest exposure to a stock
What's the cheapest ETF to get exposure to Nvidia?
I want AMD exposure without buying the stock directly. What are my options, and what do they cost?
Check a portfolio for overlap
I own VOO, QQQ and VGT. Am I doubling up?
Show me every holding that appears in more than one of SPY, SCHD and DGRO.
Discover funds by theme
Find semiconductor ETFs and compare the three biggest.
What dividend ETFs exist, and which has the highest yield?
Research one fund
Give me a deep dive on SCHD.
How concentrated is QQQ? What share of it is the top 5 positions?
Prompt templates
The server registers five prompt templates. Claude Desktop and Claude Code show them as slash-commands, so you don't have to write the prompt yourself.
Template | Argument | What it does |
|
| Costs, size, returns, and a concentration read on one fund |
|
| Side-by-side table plus a cost and return comparison |
|
| Ranks the ETFs holding a stock by weight and cost |
|
| Finds positions duplicated across the funds you hold |
|
| Finds funds for a theme and compares the leaders |
Tool reference
Tools that return more than one row format the result as a markdown table.
etf_info(ticker)
Metadata for one ETF. For two or more funds, use compare_etfs.
ticker(string) — ETF symbol, e.g."SPY"
Returns name, category, AUM, expense ratio, dividend yield, NAV/price, and YTD / 3-yr / 5-yr returns.
compare_etfs(tickers)
Compares several ETFs in one table.
tickers(array of strings) — e.g.["SPY", "QQQ", "VTI", "SCHD"]. Case-insensitive and de-duplicated. Capped at 10 funds per call.
Returns Ticker, Name, Category, AUM, Expense, Yield, YTD, 3-Yr, 5-Yr. A ticker with no data still gets a row, plus a note naming it, so one typo doesn't discard the rest.
etf_holdings(ticker)
Top holdings of an ETF with portfolio weights.
ticker(string) — ETF symbol, e.g."QQQ"
Returns a ranked table of symbol, name, and weight %.
find_etfs_holding_stock(stock_ticker, limit, custom_etf_universe)
Reverse lookup. Finds which ETFs hold a given stock in their disclosed top positions.
stock_ticker(string) — a ticker like"NVDA"or a company name like"Nvidia". Names are resolved to a ticker, and the output says which one it used.limit(int, default 20) — capped at 50custom_etf_universe(JSON string, optional) — search a specific list instead of the default universe, e.g.'["SPY","QQQ","XLK"]'
Returns matching ETFs sorted by the stock's weight, highest first.
Only top holdings are checked, roughly 10–15 positions per ETF. A stock held outside those positions will not appear.
stock_exposure_summary(stock, limit)
The same reverse lookup, joined with each fund's cost and size. Use it for "what's the cheapest or largest way to hold this stock?".
stock(string) — ticker or company name, e.g."NVDA"or"Nvidia"limit(int, default 10) — capped at 25
Returns ETF, Name, Weight, Rank, Expense, AUM, sorted by weight in the stock.
lookup_symbol(query, limit, asset_type)
Resolves a company or fund name to its ticker symbol.
query(string) — e.g."Nvidia"or"Vanguard total stock market"limit(int, default 10) — capped at 25asset_type(string, default"any") —"any","stock", or"etf"
Returns Symbol, Name, Type, Exchange.
search_etfs(query, limit)
Finds ETFs by name, theme, or category.
query(string) — e.g."semiconductor"or"dividend"limit(int, default 10) — capped at 25
Returns matching ETF tickers with names and exchanges. To resolve a stock name instead
of finding funds, use lookup_symbol.
From source
For development, or to run without waiting on a release:
git clone https://github.com/vlearner/mcp-etf-holdings.git
cd mcp-etf-holdings
uv syncWithout uv:
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"The repo ships a .vscode/mcp.json pointed at your working tree, so VS Code picks up
local changes with no extra setup. Point other clients at:
{
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/mcp-etf-holdings", "mcp-etf-holdings"]
}Check that the server starts:
uv run mcp-etf-holdingsIt will sit silent, waiting for JSON-RPC on stdin. That is correct for a stdio MCP server.
To poke at the protocol by hand:
npx @modelcontextprotocol/inspector uv run mcp-etf-holdingsHTTP transport (optional)
stdio is the default and what every editor config above uses. To serve over streamable HTTP instead:
uv run mcp-etf-holdings --transport http # http://127.0.0.1:8000/mcp
uv run mcp-etf-holdings --transport http --port 9000Point a client at it with { "type": "http", "url": "http://127.0.0.1:8000/mcp" }
(VS Code, under servers). MCP_TRANSPORT, MCP_HOST and MCP_PORT set the same options.
It binds to loopback by default and has no authentication. Binding elsewhere is refused unless
you pass --allow-insecure (or set MCP_ALLOW_INSECURE=1); put an authenticating proxy in
front before exposing it beyond your machine.
Try it in Docker
A sample Dockerfile builds the server from this checkout:
docker build -t mcp-etf-holdings .
docker run --rm -e MCP_ALLOW_INSECURE=1 -p 127.0.0.1:8000:8000 mcp-etf-holdingsMCP_ALLOW_INSECURE=1 is required because the container binds all interfaces. Keep the
127.0.0.1: in the port mapping: it is what stops the container from being
reachable by other machines on your network. The server logs a no-authentication warning
inside the container; that is expected. This is for trying the feature, not a hosting recipe.
Tests
uv run pytest -qThe suite is fully offline. Both yf.Ticker and yf.Search are mocked, the latter by an
autouse fixture, so no test can reach Yahoo by accident.
For coverage:
uv run pytest -q --cov=mcp_etf_holdings --cov-report=term-missingLayout
src/mcp_etf_holdings/
server.py ← FastMCP entry point, 7 tools
prompts.py ← prompt templates, exposed as client slash-commands
fetcher.py ← async wrappers around yfinance + 24h TTL cache
formatting.py ← markdown tables and shared number formatting
top_etfs.py ← ~365 ETF tickers scanned for reverse lookups
__main__.py ← enables `python -m mcp_etf_holdings`
tests/ ← pytest suite, fully offline
.vscode/mcp.json ← VS Code config pointing at the working tree
pyproject.tomlDependencies: mcp (protocol SDK), yfinance (data), pandas (holdings frames),
httpx (transport).
Troubleshooting
Symptom | Fix |
| Install uv, then restart your editor so it picks up the new |
Server missing from the client | Editors read MCP config only at startup. Fully quit and reopen. Check the client's MCP logs for the launch error. |
Works in a terminal, not in the editor | GUI apps often don't inherit your shell |
Tool calls return "No data found" | Check the symbol is real. Yahoo rate-limits sometimes, so wait and retry. |
Python version error on install | Needs 3.11+. Check with |
Limits
Worth knowing before you trust a number:
Only the top ~10–15 positions per ETF are published. Anything derived from holdings — reverse lookups, exposure summaries, overlap checks — is a floor, not the full picture.
The default universe is ~365 funds. A stock held only in small or niche ETFs may not turn up.
Responses are cached in memory for 24h. Override with
ETF_CACHE_TTL_SECONDS.Data is fetched live from Yahoo Finance. No API key, but Yahoo's terms and rate limits apply. See NOTICE for attribution.
Contributing
PRs welcome. The most useful contribution is expanding the ETF universe in top_etfs.py.
Wider coverage means better reverse-lookup results in niche sectors and international
markets.
Open an issue first for larger changes.
Disclaimer
Not affiliated with Yahoo Finance, yfinance, or any financial institution. Data is retrieved from Yahoo Finance at runtime and is subject to availability and their terms of service. This is not financial advice.
Available Tools
7 toolscompare_etfsA
Compare several ETFs side by side in a single table: name, category, AUM, expense ratio, dividend yield, and YTD / 3-yr / 5-yr returns.
Use this whenever the user mentions more than one ETF — it is one call instead of several etf_info calls, and the result is already tabular.
Inputs: tickers (required). Returns: result
etf_holdingsB
Return the top holdings of an ETF with their portfolio weight percentages.
Inputs: ticker (required). Returns: result
etf_infoA
Return metadata for a single ETF: name, category, AUM, expense ratio, NAV, and trailing returns.
For two or more ETFs, use compare_etfs instead — it returns one table.
Inputs: ticker (required). Returns: result
find_etfs_holding_stockA
Reverse-lookup: find ETFs (from a ~365-ETF universe or a custom list) that hold a given stock in their disclosed top holdings.
Results are sorted by the stock's weight in each ETF, highest first. For a version that also reports each ETF's expense ratio and size, use stock_exposure_summary.
Inputs: stock_ticker (required), limit, custom_etf_universe. Returns: result
lookup_symbolA
Resolve a company or fund name to its ticker symbol.
Call this first whenever the user names a company instead of giving a ticker — "Which ETFs hold Nvidia?" needs NVDA. Covers stocks and ETFs; use asset_type='stock' to exclude funds from the results.
Inputs: query (required), limit, asset_type. Returns: result
search_etfsA
Search for ETFs by name, theme, or category using Yahoo Finance search.
Returns matching ETF tickers with their full names and exchanges. Useful for discovering ETFs to pass to etf_info, compare_etfs, etf_holdings, or find_etfs_holding_stock.
To resolve a stock or company name rather than find ETFs, use lookup_symbol.
Inputs: query (required), limit. Returns: result
stock_exposure_summaryA
Find the ETFs that give exposure to a stock, with each fund's weight in that stock alongside its expense ratio and AUM.
Answers "what is the cheapest / largest ETF for exposure to X?" — the weight column shows how much exposure you get, expense ratio what it costs.
Inputs: stock (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes: etf_info vs compare_etfs is well-differentiated by the single-vs-multiple guidance, and search_etfs vs lookup_symbol target different lookup types. The main overlap is find_etfs_holding_stock and stock_exposure_summary, which both find ETFs holding a stock, but the descriptions explicitly clarify the difference (extra expense ratio/AUM and sorting).
All names use snake_case, but the patterns vary: etf_info (noun_noun), compare_etfs (verb_noun), etf_holdings (noun_noun), find_etfs_holding_stock (verb_noun_noun), stock_exposure_summary (noun_noun_noun), search_etfs (verb_noun), lookup_symbol (verb_noun). The inconsistency in verb-first vs noun-first and use of prefixes/suffixes makes it mixed but still readable.
Seven tools is well-scoped for an ETF holdings and exposure analysis server. Each tool covers a distinct operation (metadata, comparison, holdings, reverse lookup, exposure summary, search, symbol resolution) without obvious redundancy or bloat.
The surface covers the core workflows well: ETF discovery, metadata, comparison, holdings, reverse holdings lookup, and exposure analysis with cost/size. Minor gaps exist (e.g., no full holdings beyond top positions, no historical performance beyond trailing returns), but these are likely outside the server's stated scope and can be worked around.
Maintenance
Related MCP Connectors
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.
Stock, ETF, index and crypto quotes, fundamentals and price history from Yahoo Finance.
Real-time Yahoo Finance stock/crypto quotes & options, Google Trends, News & Reddit/HN sentiment.
Global prices, fundamentals and holdings data for stocks, ETFs and funds, built for AI agents.
12
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time stock market data through Yahoo Finance without requiring an API key. Get quotes, historical data, company information, financial statements, and ticker search capabilities.-
- FlicenseNot gradedqualityDmaintenanceProvides real-time stock data, historical analysis, and stock comparisons using the Yahoo Finance API.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform live stock and portfolio research using Yahoo Finance data, including quotes, fundamentals, price history, news, portfolio analysis, and ticker comparisons.-
- AlicenseAqualityBmaintenanceFree stock, ETF & crypto analysis for AI agents: 10-point score, descriptive verdict and all key metrics for any ticker. Remote MCP server (Streamable HTTP, no auth, nothing to install) at https://www.stoxlyonline.com/api/mcp, plus a stdio server (server.js) for platforms that run MCP servers as a local process. Rate limit: 30 tool calls per IP per hour. Docs: https://www.stoxlyonline.com/mcp2MIT