Connect Claude or ChatGPT to crypto data with MCP
Give Claude or ChatGPT real crypto price history through MCP: the settings, a first question to ask, and a measured Bitcoin example.
To give Claude or ChatGPT real crypto price history, connect it to a data tool through MCP. With Comparand, you add the server address https://api.comparand.xyz/mcp and your API key, and the AI can then fetch real price bars instead of guessing. With real bars it can answer measured questions: on hourly Binance BTCUSDT prices from September 2019 to October 2026, price was higher 24 hours later in 51.88% of 62,335 cases, but only 49.30% after assumed fees.
For a comparison of crypto MCP servers, see Best crypto MCP server?.
Why does an AI need a tool for crypto prices?
A chat AI learned from text up to some date. It does not know today's price, and it may mix up exchanges, contracts or dates while sounding sure. Without a tool, it can make up a number that looks real.
Vague questions make this worse. "What does Bitcoin usually do next?" leaves out the exchange, the contract, the time ahead and which dates count as history.
In our example, BTCUSDT means Bitcoin priced in USDT on Binance. USDT is a crypto coin built to track the US dollar. We used the perpetual contract, or perp: a futures contract that never expires. Other Bitcoin markets need their own results.
What does MCP actually add?
MCP stands for Model Context Protocol. It is a standard way for AI apps to use outside tools. You ask a question, the AI calls a tool, the tool returns data, and the AI explains it.
With Comparand, the AI can request price bars. A bar records the open, high, low and close price over a set time. It can also check live Hyperliquid market labels, look up a public Hyperliquid wallet, or search for past charts shaped like today's.
Getting prices and doing math on them are separate steps. The tool returns the data. The AI does any counting. So ask the AI to say which numbers came from the tool and which it worked out itself. To compare other data sources, see crypto data APIs compared.
How do I connect Claude or ChatGPT through MCP?
Start with the connection instructions. They show a one-line command for Claude Code and a config block for other MCP apps.
- Get a key. Choose a plan or pay as you go (PAYG) on the pricing page. An API key is a secret code your app sends with every call. The welcome page shows it once, so save it then.
- Add the server. Use the address https://api.comparand.xyz/mcp and pick streamable HTTP as the connection type.
- Add your key. A header is a named piece of information sent with each request. Your app must send a header called Authorization with the value Bearer, a space, then your key.
- Test it. Ask: "Call the usage tool and show my credit balance." This tool is free. If you see your balance, you are connected.
For Claude Code, the docs give one command that does steps 2 and 3. Replace YOUR_API_KEY with your key:
claude mcp add --transport http comparand https://api.comparand.xyz/mcp --header "Authorization: Bearer YOUR_API_KEY"
Not every app can send a custom header. If yours cannot, adding the address alone will not work; use an MCP app that can. Keep the key in the app's private settings, never in a public chat or shared file.
Comparand is in open beta: open to everyone, with real billing, and things may still change.
What should a useful first history question ask?
A good question names the market, the dates, the time ahead and the math. For example:
"Check which dates are available for Binance BTCUSDT perp. Use venue_bars to get completed hourly bars from 8 September 2019 to 20 October 2026 UTC. From each hourly close, measure the change to the close 24 hours later. Skip any stretch with missing hours. Show the number of cases, the share that rose, the median move, and the 10th and 90th percentile moves. Then repeat with a fee of 0.05% to enter and 0.05% to exit."
UTC is a shared world clock, so dates mean the same thing everywhere. The median is the middle result after sorting from lowest to highest. The 10th percentile is the move that only 1 in 10 cases did worse than.
Seven years of hourly bars is a lot of data. The AI has to fetch it in pieces and do the math itself, so this works best in an app that can run code, like Claude Code. If the AI cannot finish, it should say which part is missing rather than guess.
What did the measured Bitcoin example show?
These are our measured results for hourly Binance BTCUSDT perp prices from 8 September 2019, 17:00 UTC, to 20 October 2026, 00:00 UTC.
| Time ahead | Cases | Price rose | Median move | Rose after fees | Median after fees |
|---|---|---|---|---|---|
| 12 hours | 62,347 | 51.30% | +0.03% | 47.32% | -0.07% |
| 24 hours | 62,335 | 51.88% | +0.07% | 49.30% | -0.03% |
| 48 hours | 62,311 | 52.23% | +0.15% | 50.75% | +0.05% |
The spread matters more than the middle. Over 24 hours, 1 in 10 cases fell more than 3.07%, and 1 in 10 rose more than 3.49%. A median gain of 0.07% is tiny next to those swings.
The market matters too. On Coinbase's BTC-USD spot market, over a longer stretch from July 2015 to October 2026, 52.98% of 24-hour cases rose, and 50.49% after the same fees. A different market and different dates gave a different answer.
For the 24-hour row, a careful plain-English answer from your AI would be:
"Price rose a little more often than it fell. But the typical rise was so small that, after the assumed fees, fewer than half of cases ended positive. This is the past, not a forecast."
"Price rose" and "the move covered fees" are different questions. These results do not show a way to make money. The cases also overlap: a start at 1:00 and a start at 2:00 share 23 of their 24 hours. So 62,335 cases are not 62,335 separate tests.
A takeaway you can use in your own research: when your AI reports any "share that rose", ask for the same number after fees and for the 10th and 90th percentiles. If the result flips or the swings dwarf the median, the headline number is weaker than it looks. For more, see why past crypto moves are not a forecast.
How we measured this
We used recorded hourly closing prices for Binance BTCUSDT perp and Coinbase BTC-USD spot over the dates above. From every hourly close, we measured the percent change to the close 12, 24 and 48 hours later. We kept only stretches with no missing hours; a move of exactly zero counted as not up. The fee version assumes 0.05% to enter and 0.05% to exit a trade that gains when price rises. It leaves out funding payments, the gap between buy and sell prices, and price slips when an order fills.
Try this in Comparand
Once connected, try these and check what comes back:
- Connect through MCP. Add https://api.comparand.xyz/mcp with streamable HTTP and your key in the Authorization header, as shown in the docs. Your AI app can then call every Comparand tool.
- Check your account. "Call usage and show this month's usage and credit balance." You get your key's usage and remaining credits for the current UTC month. Free.
- Check that live data is fresh. "Call hl_labels_live for BTC and show the newest labels and their time." Labels describe Hyperliquid market conditions minute by minute. If the data is more than 120 seconds old, you get a live_stale error instead, and the refused call is not billed. Ask the AI to tell you when that happens rather than use old data.
- Look up a public wallet. "Use hl_wallet for this Hyperliquid address and show its fills." A fill is a completed trade. The tool reads fills, account state or open orders live from Hyperliquid's public API. Each lookup costs $0.03 from credits.
Every answer carries a record of its data sources and what the call cost. Ask the AI to keep those in its reply. You can also try 3 coins free in your browser. That page runs a chart search, which compares a coin only with its own past on the same exchange and shows what followed each chart analog. Those are single past cases, not the all-hours count above, and they are past cases, not a forecast.
The short version
- Without a data tool, a chat AI guesses prices; MCP lets it fetch real ones.
- Connect with the server address, streamable HTTP and an Authorization header holding your key.
- Name the market, exchange, bar size, dates and time ahead in your question.
- In our Binance Bitcoin test, price rose over 24 hours in 51.88% of cases, but only 49.30% after assumed fees.
- Always ask for results after fees and for the spread, not just the share that rose.
Questions people ask
What is MCP for crypto data?
MCP (Model Context Protocol) is a standard way for an AI app to call outside tools. With a crypto data MCP server connected, the AI can fetch real price bars instead of guessing prices from memory.
What settings does the Comparand MCP connection need?
Use the server address https://api.comparand.xyz/mcp with streamable HTTP. Your app must send a header called Authorization on every call, with the value Bearer, a space, then your API key.
Does every Claude or ChatGPT app support this setup?
Not always. Comparand's docs give a one-line Claude Code command and a general MCP config block. Your app must be able to add a remote MCP server and send the Authorization header, so check its connection settings.
Does Comparand charge when live data is too old?
No. If live Hyperliquid labels are more than 120 seconds old, the call is refused with a live_stale error, and a refused call is not billed.
How often did Bitcoin rise over the next 24 hours?
On hourly Binance BTCUSDT perpetual prices from September 2019 to October 2026, price was higher 24 hours later in 51.88% of 62,335 cases. After an assumed 0.05% fee on each side, only 49.30% were positive. This describes the past; it is not a forecast.