Bitcoin metrics for AI agents

Connect Claude, ChatGPT, Codex, VS Code or any MCP-compatible AI to +200 Bitcoin on-chain and market metrics via the Model Context Protocol.

+200 metrics
13 categories
7 tools
Streamable HTTP

Quick Install

The fastest way to add the BGapi MCP server — one command configures your client automatically:

With token
Without token
npx add-mcp "https://mcp.bitcoin-data.com/add-mcp?token=YOUR_TOKEN"
npx add-mcp https://mcp.bitcoin-data.com/add-mcp

1 Connect from Claude (claude.ai and Claude Desktop)

Remote MCP servers are added as a custom connector; the same connector works in claude.ai, Claude Desktop and the mobile apps:

With token
Without token
https://mcp.bitcoin-data.com/mcp?token=YOUR_TOKEN

If your connector dialog shows a Request headers section, you can use the plain URL and add the header x-bgapi-token with your token instead. Keep the URL private: anyone who has it can use your token.

https://mcp.bitcoin-data.com/mcp

On Team and Enterprise plans an organization owner has to add the connector first.

2 Connect from Claude Code

Add via the CLI (recommended) or add the server to .mcp.json in your project:

With token (CLI)
With token (.mcp.json)
Without token
claude mcp add --transport http bgapi https://mcp.bitcoin-data.com/mcp \
  --header "x-bgapi-token: YOUR_TOKEN"

Add --scope user to make it available in all your projects.

// .mcp.json (project root)

{
  "mcpServers": {
    "bgapi": {
      "type": "http",
      "url": "https://mcp.bitcoin-data.com/mcp",
      "headers": {
        "x-bgapi-token": "${BGAPI_TOKEN}"
      }
    }
  }
}

${BGAPI_TOKEN} is read from your environment, so the token doesn't end up in the repository.

claude mcp add --transport http bgapi https://mcp.bitcoin-data.com/mcp

Run /mcp inside Claude Code to check the bgapi server is connected.

3 Connect from OpenAI Codex

Works for the Codex CLI and the Codex IDE extension (both read ~/.codex/config.toml):

With token (CLI)
With token (config.toml)
Without token
# 1. Put your token in an environment variable (add it to your shell profile)
export BGAPI_TOKEN="YOUR_TOKEN"

# 2. Register the server; Codex sends it as "Authorization: Bearer"
codex mcp add bgapi --url https://mcp.bitcoin-data.com/mcp --bearer-token-env-var BGAPI_TOKEN
# ~/.codex/config.toml  (Windows: %USERPROFILE%\.codex\config.toml)

[mcp_servers.bgapi]
url = "https://mcp.bitcoin-data.com/mcp"
http_headers = { "x-bgapi-token" = "YOUR_TOKEN" }
codex mcp add bgapi --url https://mcp.bitcoin-data.com/mcp

Run codex mcp list (or type /mcp inside Codex) to confirm the bgapi server is loaded.

4 Connect from ChatGPT

ChatGPT connects to remote MCP servers through Developer mode (Plus, Pro, Business, Enterprise and Edu plans; on workspaces an admin may need to enable it):

With token
Without token
https://mcp.bitcoin-data.com/mcp?token=YOUR_TOKEN

ChatGPT can't send custom headers, so the token goes in the URL. Keep it private: anyone who has it can use your token.

https://mcp.bitcoin-data.com/mcp

5 Connect from VS Code (GitHub Copilot)

Add the server to .vscode/mcp.json in your workspace, or run MCP: Open User Configuration from the Command Palette to make it available in every workspace:

With token
Without token
{
  "inputs": [
    {
      "type": "promptString",
      "id": "bgapi-token",
      "description": "BGeometrics API token",
      "password": true
    }
  ],
  "servers": {
    "bgapi": {
      "type": "http",
      "url": "https://mcp.bitcoin-data.com/mcp",
      "headers": {
        "x-bgapi-token": "${input:bgapi-token}"
      }
    }
  }
}

VS Code asks for your token the first time the server starts and stores it securely.

{
  "servers": {
    "bgapi": {
      "type": "http",
      "url": "https://mcp.bitcoin-data.com/mcp"
    }
  }
}

Click Start above the server entry, then open Copilot Chat in Agent mode and check the tools list for bgapi.

6 Connect from any MCP client

The server supports the Streamable HTTP transport. Send your token in the x-bgapi-token header (or Authorization: Bearer, or ?token= in the URL):

# Endpoint
POST https://mcp.bitcoin-data.com/mcp
# Header
x-bgapi-token: YOUR_TOKEN
# Initialize a session and call get latest
SESSION_ID=$(curl -s -i -X POST https://mcp.bitcoin-data.com/mcp \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -H "x-bgapi-token: YOUR_TOKEN" \
    -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' \
    | grep -i "mcp-session-id" | tr -d '\r' | awk '{print $2}')

echo "Session: $SESSION_ID"

curl -s -X POST https://mcp.bitcoin-data.com/mcp \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -H "mcp-session-id: $SESSION_ID" \
    -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_latest","arguments":{"metrics":["btc-price","mvrv","nupl"]}},"id":2}'

The token is read when the session is created, so it only needs to be sent with the initialize request.

Connect with your API token

Set up the MCP server with your own BGeometrics API token, so requests count against your plan. Connecting without a token still works for now, but it is temporary and will be discontinued: set up your token now and nothing will break when that happens.

  1. Copy your token from your profile. No token yet? Choose a plan.
  2. Pick your AI client above and use the With token tab, replacing YOUR_TOKEN.
  3. Check that your token works: a wrong or expired token doesn't show an error.

Treat your token like a password. When a client only takes a URL (ChatGPT, Claude connectors), the token is part of that URL: don't share it or paste it in public places. If it leaks, use Regenerate Token in your profile and update your client with the new one.

Available Tools

Seven tools that let AI agents discover, query, and compare any Bitcoin metric.

list_metrics

Browse all available metrics by category. 13 categories covering price, on-chain, mining, derivatives, and more.

search_metrics

Search metrics by keyword across names, descriptions, slugs, and field names.

get_metric

Retrieve time-series data for any metric. Supports date ranges, pagination, and last-N queries.

get_latest

Get the most recent value for up to 10 metrics at once. Perfect for quick lookups.

compare_metrics

Compare up to 5 metrics side-by-side, aligned by date over a common range.

get_market_overview

Instant Bitcoin market snapshot: price, market cap, MVRV, NUPL, hashrate, and technicals.

subscribe

Self-subscribe for higher rate limits via Lightning Network payment.

Metric Categories

+200 metrics organized into 13 categories:

market on-chain supply mining exchange holders addresses derivatives macro altcoins stocks valuation coin-days-destroyed

Use list_metrics with a category to explore, or search_metrics with any keyword.

Setup: how the token is sent

Each client above has a With token tab (shown first) and a Without token tab (temporary). Replace YOUR_TOKEN with the token from your profile.

Depending on the client, the token is sent in one of these ways; the instructions already use the right one:

Already connected without a token? Remove the old bgapi / BGeometrics entry from your client and add it again with the With token instructions.

Check that your token works

A wrong or expired token doesn't produce an error: the data just comes back delayed. After connecting, ask your AI assistant:

With a valid token the date is today or yesterday. If it is about 7 days old, the token is not valid:

To confirm your client is actually sending the token, look at the server entry in your client's settings: it must include your token (in the URL, or in the x-bgapi-token / Authorization header). Connections without a token keep working for now, so they won't show any difference until tokenless access is discontinued.

Rate Limits

Rate limits depend on the plan linked to your token:

TierRequests / hourRequests / day
Advanced200300
Premium5001,000
Premium+1,0002,000
Business6,00010,000
ProfessionalCustom — contact us

Use the subscribe tool to upgrade your tier directly from the AI chat via Lightning Network, or see full plan details and pricing at portal.bgeometrics.com/pricing.

Example Prompts

Once connected, ask your AI assistant questions like: