Documentation
What the connector is, what it can reach and how to plug it into whatever you use. Ten minutes, most of which is reading.
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.
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.
You ask a question the way you would ask a colleague — in plain language, no query syntax, no metric codes to memorise.
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.
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.
screenCompare 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.
compareIs 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_statsHow 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_historyWho reports earnings in the next two weeks?
The calendar across the whole universe, so the week does not surprise you.
upcoming_earningsGive me the weekly price series for these tickers
Candles going back, ready to plot or to feed into whatever you are building.
price_historyOne 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
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.
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
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.
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"
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.
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.
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.
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.
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.
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.
| Tool | Arguments | What you get |
|---|---|---|
data_coverage | — | What the warehouse holds and how fresh it is: markets, snapshots, companies, metrics, price coverage. Start here. |
list_metrics | categoria |
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_snapshots | limite, universo |
Recent captures with row and column counts — useful to confirm a market landed today. |
search_companies | texto, limite |
Find a company by ticker or name. |
get_company | ticker, 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. |
compare | tickers, metricas |
Several companies side by side on the same metrics. |
metric_history | ticker, metrica, limite, exchange |
One metric through time, snapshot by snapshot. This is what a screener cannot give you: it only ever shows today. |
screen | filtros, 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_stats | metrica, universo |
Median, mean and range of a metric per sector — the context that tells you whether a P/E of 18 is cheap. |
upcoming_earnings | dias |
Who reports in the next N days. |
price_history | ticker, exchange, limite |
Weekly candles, up to three years by default and far longer on request. |
etoro_link | tickers |
Which eToro instrument each company maps to, whether it is tradable, and how confident the match is. |
sql_query | consulta, 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. |
# 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}}}'
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.
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.
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.
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 you see | What it means |
|---|---|
401 | Missing or wrong token. Check the header reads
Authorization: Bearer <token>, with one space and no quotes around the token. |
421 Invalid Host header | The 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 call | The 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 body | Responses are server-sent events.
Send Accept: application/json, text/event-stream and read the
data: lines. |
503 or a stalled call | The warehouse is being replaced by the morning upload. It takes seconds; retry. |
| Certificate complaints | The certificate is a standard public one, renewed automatically. If only one tool objects, that tool is carrying an outdated list of certificate authorities. |
GET /salud answers {"estado":"vivo"} without a token, and
GET /resumen returns counts and freshness — handy for a monitor, and neither
exposes any data.