Ask an AI assistant "what is the BTC funding rate right now?" and you get one of two answers: a polite refusal, or a confident number from its training data that is weeks or months old. Funding rates change every settlement window, so neither answer is useful.
The fix is not a better prompt. It is giving the assistant a tool it can call. That is exactly what the Model Context Protocol (MCP) is for: a standard way for Claude, Cursor, ChatGPT and other clients to discover and call outside tools while you chat.
This post walks through connecting a hosted crypto-derivatives MCP server to Claude Code, Claude Desktop and Cursor, which tools to use for funding questions, and then opens the hood with about 60 lines of plain Python that speak MCP directly, so you can see what your assistant is actually doing.
What you get
The server here is ByKaranteli's (https://mcp.bykaranteli.com, also published on npm as bykaranteli-mcp and on the official MCP Registry as com.bykaranteli/mcp). It exposes 74 tools over the same JSON API the website uses. For funding, the useful ones are:
| Tool | Answers |
|---|---|
get_funding_heatmap | Current funding rate per symbol for the ~30 most traded USDT-margined perps, with 24h open interest and price change. Optional symbol. |
get_funding_arbitrage | Funding for the same perp across venues, with gross and net annualized spread for 12 major perps. Optional symbol. |
get_top_movers | Four top-10 lists in one call, including the most extreme funding right now. |
get_series | History of one recorded metric (for example funding, or funding_agg weighted by open interest across venues) for one perp, on a bar period you choose. |
get_pressure_scores | A 0-100 stress score per symbol built from funding, open interest deltas and basis, with a plain-language reason. |
You don't pick these yourself. The assistant reads each tool's description and chooses. Your job is only to connect the server.
Step 1: a key, or a sign-in
Every tool call needs an account. Two options:
- Sign in (OAuth). claude.ai, ChatGPT, Claude Code, Cursor and VS Code can connect by signing in once on bykaranteli.com. Nothing to copy.
- A key. Claude Desktop, your own scripts and any client without sign-in use a key that starts with
bk_. A free key comes with any verified account and carries 15,000 calls a month at 30 a minute, shared between the MCP server and the REST API.
Listing the tools works without either, which is handy for the debugging script later.
Step 2: connect your client
These commands and config blocks come straight from the provider's connect guide.
Claude Code, hosted with sign-in:
claude mcp add --transport http bykaranteli https://mcp.bykaranteli.com Then type /mcp inside Claude Code, pick bykaranteli and choose Authenticate. A browser window opens; sign in and press Allow.
Claude Code, local package with a key (needs Node.js):
claude mcp add bykaranteli -e BYKARANTELI_API_KEY=bk_...your key... -- npx -y bykaranteli-mcp Claude Desktop (Settings, Developer, Edit config), in claude_desktop_config.json:
{ "mcpServers": { "bykaranteli": { "command": "npx", "args": ["-y", "bykaranteli-mcp"], "env": { "BYKARANTELI_API_KEY": "bk_...your key..." } } } } Restart Claude Desktop after saving.
Cursor, in mcp.json (Settings, MCP, Add), the hosted endpoint with a key in the header:
{ "mcpServers": { "bykaranteli": { "url": "https://mcp.bykaranteli.com/mcp", "headers": { "Authorization": "Bearer bk_...your key..." } } } } Cursor also has a one-click "Add to Cursor" button on the guide page that fills in the hosted server and lets you sign in instead of pasting a key.
Step 3: ask in plain words
Once connected, these prompts map cleanly onto the tools above:
- "Which perps have the most negative funding right now?" (
get_funding_heatmaporget_top_movers) - "What is ETH funding, and how did open interest change in the last 24 hours?" (
get_funding_heatmapwithsymbol) - "Where is the widest funding spread for SOL across exchanges, net of fees?" (
get_funding_arbitrage) - "Chart BTC funding over the last two weeks on 8h bars." (
get_series)
Every market answer carries a provenance block (venues, full or sampled coverage, freshness), so you can ask the assistant "where does that number come from?" and get a real answer instead of a guess.
One expectation to set: the tools return readings, not advice. A strongly negative funding rate says shorts are paying longs at that moment; it is not a forecast. A well-behaved assistant will say the same.
Under the hood: MCP in plain Python
When something misbehaves (a client that "connects" but never calls a tool, say), it helps to talk to the server yourself. The hosted endpoint speaks MCP's Streamable HTTP transport: JSON-RPC 2.0 over POST, where the server may reply with plain JSON or a short Server-Sent Events stream. Here is a minimal client with only requests:
"""Talk to the hosted ByKaranteli MCP server with plain HTTP (no SDK).""" import json import os import sys import requests URL = "https://mcp.bykaranteli.com/mcp" class MCP: def __init__(self, key=None): self.s = requests.Session() self.h = { "Content-Type": "application/json", "Accept": "application/json, text/event-stream", } if key: self.h["Authorization"] = f"Bearer {key}" self.n = 0 info = self.rpc("initialize", { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "funding-demo", "version": "0.1"}, }) self.h["MCP-Protocol-Version"] = info["protocolVersion"] self.notify("notifications/initialized") self.server = info["serverInfo"] def _post(self, body): r = self.s.post(URL, json=body, headers=self.h, timeout=30) if r.status_code == 401: msg = r.json().get("error_description", "401") sys.exit("401: " + msg.splitlines()[0]) r.raise_for_status() if sid := r.headers.get("mcp-session-id"): self.h["Mcp-Session-Id"] = sid return r def notify(self, method): self._post({"jsonrpc": "2.0", "method": method}) def rpc(self, method, params=None): self.n += 1 r = self._post({"jsonrpc": "2.0", "id": self.n, "method": method, "params": params or {}}) if "text/event-stream" in r.headers.get("content-type", ""): data = [l[5:] for l in r.text.splitlines() if l.startswith("data:")] msg = json.loads(data[-1]) else: msg = r.json() if "error" in msg: raise RuntimeError(msg["error"]) return msg["result"] def tools(self): return self.rpc("tools/list")["tools"] def call(self, name, **args): res = self.rpc("tools/call", {"name": name, "arguments": args}) text = "\n".join(c["text"] for c in res["content"] if c["type"] == "text") return res.get("isError", False), text if __name__ == "__main__": mcp = MCP(os.environ.get("BYK_API_KEY")) print("server:", mcp.server["name"], mcp.server["version"]) tools = mcp.tools() print(len(tools), "tools") for t in tools: if "funding" in t["name"]: print(f" {t['name']:<24} {t['description'][:70]}...") err, text = mcp.call("get_funding_heatmap", symbol="BTC") print("isError:", err) print(text[:800]) Run it once without a key, and you see the handshake and tool list succeed while the actual call is refused:
server: bykaranteli 1.1.12 74 tools get_funding_heatmap Call this when the user asks for the full current funding table across... get_funding_arbitrage Call this when the user asks about funding arbitrage, funding rate dif... 401: ByKaranteli MCP: this tool call needs an account key or an OAuth sign-in and this connection sent none. That split is deliberate: any client can discover what the server offers, but reading data takes an account. The 401 also carries a WWW-Authenticate header pointing at the server's OAuth protected-resource metadata, which is how Claude and Cursor know to open a sign-in window instead of just failing. If your assistant shows "this tool call needs an account key", that is the message you just saw.
Set the key and run it again to get the BTC row back as text:
export BYK_API_KEY="bk_..." python byk_mcp.py Note the variable names: the npm package reads BYKARANTELI_API_KEY, while this script reads BYK_API_KEY. Use whichever you like in your own code, just keep the key out of the source file.
The same numbers without an assistant
The tool is a thin layer over a REST endpoint, GET /api/public/heatmap, so a script that doesn't need a model can skip MCP entirely:
import os import requests key = os.environ["BYK_API_KEY"] data = requests.get( "https://bykaranteli.com/api/public/heatmap", headers={"Authorization": f"Bearer {key}"}, timeout=20, ).json() print(f"Funding snapshot {data['generatedAt']} ({len(data['rows'])} perps)") print(f"{'symbol':<12}{'funding %':>11}{'OI 24h':>9}{'px 24h':>9}") for r in sorted(data["rows"], key=lambda r: abs(r["fundingRatePct"]), reverse=True)[:8]: print(f"{r['symbol']:<12}{r['fundingRatePct']:>+11.4f}{r['oi24hPct']:>+8.1f}%{r['priceChange24hPct']:>+8.1f}%") neg = [r["symbol"] for r in data["rows"] if r["fundingRatePct"] < 0] print("negative funding:", ", ".join(neg) or "none") fundingRatePct is the rate per settlement interval, in percent; oi24hPct and priceChange24hPct are 24h changes. A snapshot from today, trimmed:
Funding snapshot 2026-12-01T11:03:05.799Z (29 perps) symbol funding % OI 24h px 24h ATOMUSDT -0.0207 -0.7% +1.8% APTUSDT -0.0204 -0.3% +3.5% TRXUSDT -0.0108 +2.6% -2.1% ETHUSDT +0.0100 +5.6% +3.0% SOLUSDT +0.0100 +1.6% +3.0% BTCUSDT +0.0080 +3.6% +2.8% Most rows sit near the common 0.01% baseline; the interesting ones are the outliers in either direction, which is exactly what the "most extreme funding" prompt surfaces. The live, colour-coded version is at bykaranteli.com/heatmap.
A note on limits
A free key is meant for evaluation and personal use: trying the tools in your assistant, a notebook, a personal script. An agent that polls around the clock, a bot or a shared dashboard is what the paid plans are for. Each response carries x-ratelimit-* and x-quota-* headers, so your code can see where it stands before it hits a 429.
Wrap-up
Three things to take away. An assistant only knows live market data if you hand it a tool, and MCP makes that a one-line config. Funding questions map onto a handful of tools (get_funding_heatmap, get_funding_arbitrage, get_top_movers, get_series), and the assistant picks between them from their descriptions. And when a connector misbehaves, 60 lines of requests will show you the handshake, the tool list and the exact error your client is seeing.
Get a free API key → https://bykaranteli.com/register?next=%2Fdashboard%2Fapi&utm_source=devto&utm_medium=referral&utm_campaign=funding-mcp
Full endpoint and tool list: bykaranteli.com/developers.
Drafted with AI assistance, reviewed against the live API docs. This post describes a data API; nothing here is investment advice.
