AI Agent Integration

MCP API

Connect any AI agent to Satoshi Price Index data through the Model Context Protocol (MCP). Read-only access to BLS price data converted to Bitcoin satoshis with full source provenance and freshness tracking.

Public read-only endpoint • No authentication required

Endpoint

The MCP server uses Streamable HTTP transport. Connect your MCP client to this endpoint:

POST https://www.satoshipriceindex.xyz/api/mcp

This endpoint implements the Model Context Protocol over HTTP. Use an MCP SDK client to connect.

Available Tools

The MCP server provides six read-only tools for querying Satoshi Price Index data:

get_current_bitcoin_rate

Returns the current live Bitcoin/USD exchange rate from WhatsOnChain. Provides real-time BSV/USD quote with provider timestamp, freshness determination based on quote age, and explicit semantics about timestamp meaning.

No parameters required

get_historical_bitcoin_rate

Returns historical monthly average Bitcoin/USD rate from CoinGecko. Provides BSV/USD monthly average for a specific period (not current quote), with observation period and freshness based on data age.

period_date (optional): YYYY-MM format (defaults to most recent)

get_item_price_in_sats

Get the price of a BLS CPI item in Bitcoin satoshis for a specific period. Returns USD price, conversion rate, satoshi price, and full provenance including observation dates and sources.

series_code (required): BLS APU series code (e.g., "APU0000708111")
period_date (optional): YYYY-MM-DD format (defaults to most recent)

get_item_history

Get historical prices for a CPI item over a date range. Returns time series of USD prices, satoshi prices, and monthly changes with full provenance for each period. Supports bounded results (max 120 months).

series_code (required): BLS APU series code
from_date (optional): YYYY-MM format
to_date (optional): YYYY-MM format
limit (optional): Max periods (default: 120, max: 120)

list_available_items

List all available CPI series with their codes, names, categories, and emoji identifiers. Use this to discover series codes for other tools.

category (optional): Filter by category
active_only (optional): Only active series (default: true)

calculate_period_change

Calculate absolute and percentage change in satoshi price between two periods. Returns baseline and current values with respective conversion rates, plus change calculations. Handles zero/missing baseline explicitly.

series_code (required): BLS APU series code
baseline_date (required): YYYY-MM format
current_date (optional): YYYY-MM format (defaults to most recent)

Connection Example

Connect using an official MCP SDK client. Example using the TypeScript SDK:

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';

const client = new Client({
  name: 'my-agent',
  version: '1.0.0',
}, {
  capabilities: {},
});

const endpoint = 'https://www.satoshipriceindex.xyz/api/mcp';
const transport = new StreamableHTTPClientTransport(new URL(endpoint));

await client.connect(transport);

// List available tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: 'get_current_bitcoin_rate',
  arguments: {},
});

Data Coverage & Semantics

CPI Data

U.S. Bureau of Labor Statistics Average Price Data (APU series). Each series represents a specific consumer good or service with a real unit (e.g., one gallon of milk, one dozen eggs). Prices are monthly observations in USD.

Bitcoin Prices

Current: Live BSV/USD from WhatsOnChain API for real-time quotes.
Historical: Daily BSV/USD observations from CoinGecko, averaged by calendar month. Monthly averages are derived from complete daily price data for historical analysis.

Conversion Formula

satoshis = (USD_price × 100,000,000) ÷ USD_per_coin

All conversions use finite, non-negative USD amounts and strictly positive, finite exchange rates. Decimal arithmetic with explicit rounding at output. Invalid or missing rates make conversion unavailable.

Provenance & Timestamps

Every response separates item source/observation date from rate source/pair/quote date. fetched_at is the API request time. response_as_of is the data snapshot time. Cache times are not quote times; unknown quote times remain unknown.

Freshness

Each response includes freshness status: fresh, stale, or unknown, plus age in days. CPI data typically releases ~2 months after observation period. Data older than expected is marked stale.

Asset Identity

Machine-readable metadata explicitly identifies the asset as BSV (Bitcoin SV) with provider coingecko and pair BSV/USD. Public documentation uses "Bitcoin" for accessibility while preserving technical accuracy in API responses.

Limitations

  • Read-only: This API provides data queries only. No write operations are supported.
  • Data lag: CPI data releases approximately 2 months after the observation period. Bitcoin price data is historical (monthly averages).
  • Rate semantics: Current rate is live WhatsOnChain BSV/USD quote; historical rates are CoinGecko monthly averages. Snapshot rate lineage in get_item_price_in_sats is marked as unknown.
  • Result limits: Historical queries are bounded to 120 months maximum to ensure reasonable response sizes.
  • Missing data: Not all series have data for all periods. Tools return explicit errors for missing data rather than inventing values.
  • Asset specification: This index tracks BSV (Bitcoin SV) prices, not BTC. The asset is clearly identified in all API responses.

Example Series Codes

Common BLS APU series codes for querying prices:

APU0000708111
🥚 Eggs, grade A large (per dozen)
APU0000704111
🥓 Bacon, sliced (per lb)
APU0000702111
🍞 Bread, white (per lb)
APU0000709112
🥛 Milk, whole (per gallon)
APU0000717311
☕ Coffee, ground roast (per lb)
APU000074714
⛽ Gasoline, unleaded regular (per gallon)

Use list_available_items to discover all available series codes.

This MCP API is provided free of charge for AI agents and research. No authentication is required. Rate limits may apply to prevent abuse. For questions or issues, please file a bug report on the project repository.

BLS does not endorse analyses derived after data retrieval. This is an independent educational project.

Crafted by Ceboruco Studios