I Asked Claude to Rank the S&P 500
Originally published on medium.com

“I asked ChatGPT to pick my next 10-bagger” is a genre now. You’ve seen the screenshots: a chat window, a confident list of tickers, zero explanation of where the numbers came from.
Most of the time there are no numbers. The model is just pattern-matching on stock names it remembers from training data, dressed up as analysis.
I wanted to see what happens when you remove that shortcut. So I connected Claude directly to a live market data provider through MCP and asked it to screen the S&P 500 universe using real fundamentals and price momentum, not memory.
This is what it picked, and more importantly, how it picked it.
Why Asking an LLM to Rank Stocks Usually Fails
Ask any general-purpose chatbot to rank stocks and it will answer. That’s the problem.
It doesn’t say “I don’t have live data.” It doesn’t say “my training data ends months ago.” It just produces a plausible-sounding list, usually the same five or six mega-caps everyone already knows.
There are three reasons this breaks down:
- The model’s knowledge is frozen at training time, so prices, earnings, and market caps are stale by definition.
- Without tool access, there’s no fundamentals feed to reason over, only whatever text patterns it absorbed about companies being “strong” or “innovative.”
- The output looks structured (a numbered list, bold tickers) which makes it feel more rigorous than it is.
A ranking with no data behind it isn’t a ranking. It’s a guess wearing a suit.
The Model Was Never the Bottleneck
Here’s the reframe: Claude ranking stocks badly isn’t a reasoning problem. It’s an access problem.
Give the same model a live fundamentals feed and a screener, and the reasoning step barely changes. What changes is what it’s reasoning over.
An LLM is only as good an analyst as the data pipe you hand it.
Giving Claude a Real Data Feed via MCP
MCP (Model Context Protocol) lets Claude call external tools directly during a conversation, the same way it would call a calculator or a code interpreter. Instead of guessing what Apple’s market cap is, it queries an API and gets the actual number back.
For this experiment, I connected Claude to EODHD through their MCP server. That gives Claude direct access to:
- A stock screener with fundamental and technical filters (market cap, sector, P/E, momentum signals)
- Bulk fundamentals across an entire exchange in one call
- Per-ticker financials, valuation, and analyst data
No scraping, no stale CSV, no “as of my last update.” Just live numbers Claude can query mid-conversation.
Rank real stocks with real data, not model memory EODHD gives you a fundamentals and screener API built for exactly this kind of workflow. → Get started with EODHD
Setting Up the EODHD Connector (No Code Required)
This part takes about two minutes and you never leave the Claude settings screen.
- Open Settings → Connectors in Claude.
- Find EODHD in the connector directory and hit Connect. It’s a hosted MCP endpoint, so there’s nothing to install locally.
- Authorize it with your EODHD API token, the same one you’d use for the REST API.
- Under Tool permissions, decide how each tool behaves: Allow (runs automatically), Ask (confirms before every call), or Deny.
- Set
stock_screener,get_bulk_fundamentals, andget_fundamentals_datato Allow. Those three are what Claude actually needs for a ranking task, and you don't want a confirmation popup on every single screen.
That’s the whole setup. From there you just talk to Claude normally.

What Claude Actually Queried
I gave Claude one instruction: screen large-cap, US-listed stocks by 5-day price momentum, filter for market caps above $50B, and explain the top picks using their fundamentals.
Claude called stock_screener directly, no code from me. Here's the equivalent REST call if you want to reproduce it outside the chat:
import requests
API_TOKEN = "YOUR_EODHD_API_TOKEN"
response = requests.get(
"https://eodhd.com/api/screener",
params={
"api_token": API_TOKEN,
"filters": '[["exchange","=","US"],["market_capitalization",">",50000000000]]',
"sort": "refund_5d_p.desc",
"limit": 10,
"fmt": "json",
},
)
for stock in response.json()["data"]:
print(stock["code"], stock["name"], stock["refund_5d_p"], "%")
refund_5d_p is the 5-day percentage return. Sorting by it surfaces momentum instead of just size, which is what turns a static list of mega-caps into an actual ranking.
The Ranking Claude Produced
Pulled live, September 2026, large-cap US stocks (market cap above $50B) ranked by 5-day return:

A quick honesty check before going further: this screen pulls from the broader US large-cap universe, not a literal “S&P 500 constituents only” filter, since that index membership list isn’t something the screener exposes directly. A couple of names that show up in the raw feed (MicroStrategy, some ADRs) aren’t current S&P 500 members and I filtered those out of the final five. Worth knowing if you rerun this yourself.
Here’s Claude’s reasoning for the top three, based on the fundamentals it pulled, not on vibes:
Dell Technologies. Momentum here tracks server demand tied to AI infrastructure buildouts. Claude flagged the EPS of $17.19 against a market cap of $339B as reasonable relative to the sector’s other hardware names, not stretched.
Sandisk. The move coincides with a memory and storage pricing cycle. Claude noted the earnings-per-share figure of $73.78 stood out sharply against peers in the same screen, worth double-checking against the next earnings print rather than taking at face value.
Bloom Energy. The reframe Claude offered was that this isn’t a “clean energy story,” it’s a data center power story. Fuel cells for on-site power generation are getting bid up alongside AI infrastructure spend, not environmental sentiment.
Notice what’s missing: no mention of “strong brand” or “innovative culture.” Every claim ties back to a number that came from the screener.
Where This Breaks If You Try It Yourself
I hit three walls running this, and all three were data problems, not Claude problems.
Cross-exchange duplicates. My first pass filtered by sector only, no exchange. The result was a mess: NVIDIA showed up as a separate row for the US listing, the Toronto CDR, the Frankfurt listing, a Brazilian BDR, and an Israeli line, each with a different market cap because each was priced in a different currency and share ratio. If you don’t pin exchange = "US" explicitly, half your "top 10" ends up being the same three companies wearing different tickers.
Momentum isn’t quality. A stock up 18% in five days can mean genuine re-rating, or it can mean it just reported earnings and got squeezed. The screener will hand you both with equal confidence. Pair momentum filters with something that anchors reality, EPS, dividend history, sector, before you let a ranking stand on its own.
Index membership isn’t in the feed. As I mentioned above, “S&P 500 constituent” isn’t a screener field. Market cap and exchange get you close, but you still have to eyeball the output for names that technically qualify by size and sector but aren’t in the index (MicroStrategy is the obvious one here, treated by some data feeds as tech-adjacent by market cap alone).
A Few Rules I’d Follow Next Time
- Always filter by exchange first, sector second. It’s the single biggest source of noise in any EODHD screener call.
- Cross-check anything that moves more than 15% in a week against
get_fundamentals_databefore including it. If the earnings-per-share number looks disconnected from the sector average, that's worth a second look, not an automatic red flag, just a flag. - Timestamp everything. The table in this article is only true as of the date attached to it. Rerun the same filters next week and expect a different list, that’s a feature of momentum screens, not a bug.
- Don’t let the model’s fluent tone substitute for your own read of the numbers. Claude explained the top three picks clearly. Clear isn’t the same as correct. I’d still want the fundamentals in front of me before acting on any of it.
None of this is a knock on EODHD specifically. It’s true of any market data API: the raw feed is only as useful as the filters you apply to it. Garbage filters in, garbage ranking out, no matter how good the model summarizing it sounds.
What This Actually Proves
- A ranking is only as trustworthy as the data behind it. Claude didn’t get smarter here, it got access to numbers it didn’t have before.
- MCP turns Claude into something closer to a research assistant with a Bloomberg terminal, not an oracle that already knows the answer.
- None of this is investment advice. It’s a reproducible method. Rerun it next week and you’ll get a different table, which is the point.
FAQs
Do I need to write code to use the EODHD MCP connector? No. Connecting through Claude’s Settings → Connectors panel is entirely point-and-click. The Python example in this article is only for people who want to reproduce the query outside of Claude.
Is this list financial advice? No. It’s a momentum and fundamentals screen run at a specific point in time. Stock rankings built this way change from day to day and should be treated as a research starting point, not a recommendation to buy anything.
Does EODHD have a free tier for the screener? Yes, EODHD offers a free API tier for testing, with paid plans unlocking higher screener limits and bulk fundamentals across full exchanges.
Which data points matter most for a ranking like this? Market cap and momentum (5-day or 20-day return) narrow the universe fast. From there, EPS, dividend yield, and sector context turn a raw list into something you can actually reason about, which is exactly what the screener and fundamentals endpoints are built to surface together.
Try It With Your Own Filters
The five stocks above are a snapshot, not a forecast. Swap the filters (sector, P/E ceiling, dividend yield floor) and you’ll get a completely different top five, generated the same reproducible way.
Build your own screener-backed ranking Get an EODHD API token and connect it to Claude via MCP in under two minutes. → Start with EODHD
If you’re a fintech or API company looking to explain a technical product through content like this, not marketing fluff, feel free to connect with me: kevinmeneses.com
Looking for technical content for your company? I can help — LinkedIn · kevinmenesesgonzalez@gmail.com