Market Pi-RatesBeta

Documentation

Connect it, and
ask away.

What the connector is, what it can reach and how to plug it into whatever you use. Ten minutes, most of which is reading.

What this actually is

MCP — Model Context Protocol — is the socket an AI assistant plugs into to reach something outside itself. This one is plugged into a warehouse of company fundamentals that we capture every single day. You connect it once, and from then on your assistant can look things up while you talk to it.

Once

You paste one command into your AI client. It stores the endpoint and your token, and that is the last time you think about plumbing.

Every time

You ask a question the way you would ask a colleague — in plain language, no query syntax, no metric codes to memorise.

In seconds

Your assistant picks the right tool, queries the warehouse and answers with real numbers — not a guess, and not something it half-remembers from training.

Works with Claude Code, Claude Desktop and any other client that speaks MCP. Nothing to install, nothing running on your machine — the warehouse lives here and answers over HTTPS.

Things people actually ask it

These are not canned reports. They are questions, asked normally, that the connector can answer because it has every company and every metric in front of it.

Find me the cheapest company by P/E in the entire universe with a return on equity above 15%

Reads every company across the five markets and hands back the short list. One question, twenty-three thousand companies looked at.

screen
Compare ASML, TSMC and Applied Materials on margins, returns and valuation

Side by side on the metrics you name, taken from the same capture — so you are comparing like with like, not three different dates.

compare
Is a P/E of 18 expensive for this sector, or normal?

Median, mean and extremes for that metric across the sector, so a number stops being abstract.

sector_stats
How has this company's valuation moved since we started tracking it?

The metric's whole series, capture by capture. The history is ours and grows every day; nobody can reconstruct it after the fact.

metric_history
Who reports earnings in the next two weeks?

The calendar across the whole universe, so the week does not surprise you.

upcoming_earnings
Give me the weekly price series for these tickers

Candles going back, ready to plot or to feed into whatever you are building.

price_history
Fourteen tools in total. Your assistant picks the right one on its own — you never name them. They are listed further down if you want to know exactly what it can reach.

Quick start

One address for everything. Paste it into your client, sign in with Google, and you are in: your app keeps the credential and you never copy a secret anywhere.

https://themarketpirates.com/mcp
Claude Web and app · copies the address Cursor One-click install VS Code One-click install

Claude, on the web and in the app

Settings → Connectors → Add. Give it any name and paste that address: Claude detects the sign-in on its own. Press Connect, sign in with Google and accept the terms. What you connect on the web shows up in the desktop app too — same account.

Claude Code

One line, then /mcp to sign in through your browser.

# --scope user: disponible en todos tus proyectos de esa maquina
claude mcp add --transport http --scope user \
  market-pirates https://themarketpirates.com/mcp

Cursor, VS Code and any other client

The same address and the same sign-in. The server speaks MCP over streamable HTTP, replies as an event stream — send Accept: application/json, text/event-stream — and implements protocol revision 2026-07-28.

Servers and unattended jobs

A job that runs on its own cannot open a browser or sign in with Google, so there a fixed token is the way, sent in a header. Get one from your account.

curl -sS -X POST https://themarketpirates.com/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json, text/event-stream"
A token is a key, not an address. Whoever holds it gets in as you, on your plan. Never paste it into a chat — not even into one with an assistant — a screenshot or a repository: keep it like a password. Connecting your Claude or your editor needs none.
Once connected, just ask. "Which European companies have an ROE above 25% and gross margin above 60%?" or "Show me Harmony Biosciences' margin history." The client picks the tools; the list is below if you want to call them directly.

Access

There are two ways in, and the first is the one almost everyone should use. By signing in: your client asks for permission, you sign in with Google, and it keeps a credential of its own that you never see; you can disconnect one app without touching the others. With a token: for what runs unattended. Without one or the other the server answers 401 and nothing else.

Getting a token

Tokens are handed out directly by Market Pi-Rates. They are 64 characters, carry no expiry, and are compared in constant time — a wrong token tells an attacker nothing about the right one.

Keeping it safe

Treat it like a password: never in a repository, a screenshot or a shared document. If one leaks, ask for a new one; replacing it takes under a minute and the old one dies instantly.

What it can do

Read data. Nothing else. The service has no write path at all: the warehouse is opened read-only and the process cannot reach anything beyond it.

Check your token

Paste it below to confirm it works from wherever you are. It is used for that one request and never stored, logged or sent anywhere else.

Tools

Thirteen read-only tools. Percentages are stored as fractions — a 15% ROE is 0.15 — and metric keys are exact strings, so call list_metrics before filtering on anything.

ToolArgumentsWhat you get
data_coverage What the warehouse holds and how fresh it is: markets, snapshots, companies, metrics, price coverage. Start here.
list_metricscategoria The metric dictionary: exact key, label, unit and origin. Origin separates captured figures from the ones we compute (margins, ROIC, multiples, reinvestment, expected growth).
list_snapshotslimite, universo Recent captures with row and column counts — useful to confirm a market landed today.
search_companiestexto, limite Find a company by ticker or name.
get_companyticker, exchange Full latest-known profile, metric by metric. A ticker alone is ambiguous across venues, so on a clash it returns the candidates instead of guessing.
comparetickers, metricas Several companies side by side on the same metrics.
metric_historyticker, metrica, limite, exchange One metric through time, snapshot by snapshot. This is what a screener cannot give you: it only ever shows today.
screenfiltros, mostrar, ordenar_por, limite, universo, sector Filter the universe with SQL conditions over metric keys, e.g. ["roe > 0.25", "margen_bruto > 0.5"]. Deterministic ordering: same question, same list.
sector_statsmetrica, universo Median, mean and range of a metric per sector — the context that tells you whether a P/E of 18 is cheap.
upcoming_earningsdias Who reports in the next N days.
price_historyticker, exchange, limite Weekly candles, up to three years by default and far longer on request.
etoro_linktickers Which eToro instrument each company maps to, whether it is tradable, and how confident the match is.
sql_queryconsulta, limite A read-only SELECT over the warehouse for anything the tools above do not cover.
my_plan What your connection reaches: rows per answer, daily limits, and whether computed ratios, history and free-form SQL are included. Ask "what does my plan include?" and the assistant answers from here.

Calling one directly

# initialize first: the session id comes back in a response header
curl -sS -X POST https://themarketpirates.com/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"screen","arguments":{
         "filtros":["roe > 0.3","margen_bruto > 0.6"],"limite":5}}}'

The data

Five markets, daily

United States, Europe, Japan, Hong Kong and Australia, captured every weekday morning. Coverage skews to primary listings, so a company appears once rather than in every venue it trades in.

History that accumulates

Every capture is stored and never rewritten, so the warehouse answers what was known on a given day — no hindsight, and companies that later delisted are still in the old snapshots.

Computed, not just collected

Alongside reported figures there are ratios we derive ourselves: margins, ROIC, enterprise multiples, DuPont breakdown, reinvestment and expected growth. The dictionary marks which is which.

Prices and instruments

Weekly candles going back years, plus the mapping between each company and its tradable instrument, because a ticker in a database and a ticker you can buy are not the same thing.

What is not here. Portfolios, positions, orders, research notes and the Market Pi-Rates scoring method live on separate infrastructure that this service cannot reach. This connector serves data, never decisions.

Troubleshooting

What you seeWhat it means
401Missing or wrong token. Check the header reads Authorization: Bearer <token>, with one space and no quotes around the token.
421 Invalid Host headerThe request arrived under a hostname the server does not recognise, which is its DNS-rebinding protection. Use the endpoint exactly as written above; if you put your own proxy in front, its hostname has to be declared on the server.
400 after a first successful callThe session id was dropped. Read Mcp-Session-Id from the initialize response and send it back on every later request — the header name is case-insensitive, but some clients compare it literally.
Empty or unparsable bodyResponses are server-sent events. Send Accept: application/json, text/event-stream and read the data: lines.
503 or a stalled callThe warehouse is being replaced by the morning upload. It takes seconds; retry.
Certificate complaintsThe certificate is a standard public one, renewed automatically. If only one tool objects, that tool is carrying an outdated list of certificate authorities.

Service status

GET /salud answers {"estado":"vivo"} without a token, and GET /resumen returns counts and freshness — handy for a monitor, and neither exposes any data.