Feed updates
Commodities.CLLX6/USDremovedCrypto.PRL/USDwent liveCommodities.LIZ6/CNYaddedCommodities.LIX6/CNYaddedCommodities.WTIZ7/USDaddedCommodities.WTIX7/USDaddedCommodities.WTIV7/USDaddedCommodities.WTIU7/USDaddedCommodities.WTIQ7/USDaddedCommodities.WTIN7/USDaddedCommodities.WTIM7/USDaddedCommodities.WTIK7/USDaddedCommodities.WTIJ7/USDaddedCommodities.WTIH7/USDadded
View all
Developer Hub

Build with AI Agents

Steps to connect AI agents to Pyth market data with the Pyth MCP server and MCP Skills

This guide covers steps to connect AI agents to Pyth market data with the Pyth MCP server and MCP Skills.

MCP Server

The Pyth MCP server gives AI assistants direct, structured access to Pyth market data through the Model Context Protocol. You can discover feeds, fetch real-time and historical prices, replay every update in a short window, and generate chart-ready candles, all within a single conversation.

MCP endpoint: https://mcp.pyth.network/mcp — no self-hosting required.

Tools

CategoryToolDescriptionAPI key
Discoveryget_symbolsFind feeds by text, asset type, instrument type or futures chainOptional
Real-timeget_latest_priceLatest prices for up to 100 feedsYes
Historicalget_historical_pricePrices at one point in time for up to 50 feedsYes
Historicalget_price_rangeEvery price update in a window of up to 60 secondsYes
Chartingget_candlestick_dataOHLC candles for one feed (up to 500 per response)Yes
Utilityconvert_date_to_timestampConvert a date to Unix seconds and microsecondsNo

Price tools accept full symbols (Crypto.BTC/USD) or plain pairs (BTC/USD). A plain pair resolves to the live spot feed when there is one, otherwise to the only other live match. resolved_symbols in the response shows what each input resolved to.

API Key

Every user brings their own Pyth Pro API key; the hosted server has none of its own. See Acquire an API Key.

Give the server your key in one of three ways. A key passed on a call overrides a configured one.

  1. In your MCP client's configuration (recommended): your client sends the key as an Authorization: Bearer <key> header on every request. The Setup tabs below show how for each client.
  2. As an environment variable, for a local server: set PYTH_PRO_ACCESS_TOKEN in the server's env block.
  3. On each call: the access_token parameter. Your assistant asks for the key when none is configured.

Configure the key in your client rather than pasting it into chat, and keep it out of config files you commit or share.

get_symbols works without a key. With a key, it also lists feeds visible only to Pro keys and marks each feed entitled: true or false: whether your key can query that feed.

Setup

  • Endpoint: https://mcp.pyth.network/mcp
  • Transport: Streamable HTTP
  • Auth: connecting needs no key; the price tools use your key, sent as an Authorization: Bearer header

Replace YOUR_API_KEY with your Pyth Pro API key.

Add Server

claude mcp add --transport http pyth https://mcp.pyth.network/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

This adds Pyth only to the folder you run the command in. To use it in every project, add --scope user; any project you open can then call the price tools with your key.

Verify

claude mcp list

Tool Reference

Every price tool also takes an optional access_token. Leave it out when your client sends the key.

get_symbols

Search and list Pyth Pro feeds.

ParameterTypeRequiredDescription
querystringNoText filter, e.g. BTC, gold, AAPL
asset_typestringNocrypto, crypto-index, crypto-redemption-rate, fx, equity, metal, rates, interest-rate, nav, commodity, funding-rate, eco, kalshi
instrument_typestringNospot, future, perp, rate, index, nav
symbol_chain_idstringNoFutures chain, exact match (e.g. VX for all VIX futures)
include_inactivebooleanNoInclude retired feeds. Default false
verbosebooleanNoReturn every catalog field (trading schedules, market sessions, corporate actions). Default false
limitnumberNoDefault 50, max 200
offsetnumberNoDefault 0
  • Each feed has a state. Only stable feeds return prices; beta and coming_soon feeds are listed but cannot be queried yet.
  • With a key, each feed carries entitled, and the list includes feeds visible only to Pro keys.

get_latest_price

Fetch the latest prices for one or more feeds.

ParameterTypeRequiredDescription
symbolsstring[]No*BTC/USD or Crypto.BTC/USD
price_feed_idsnumber[]No*Feed IDs from get_symbols
channelstringNoreal_time, fixed_rate@50ms, fixed_rate@200ms or fixed_rate@1000ms. Default fixed_rate@200ms
propertiesstring[]NoFields to return (see below)

* At least one of symbols or price_feed_ids is required.

  • Up to 100 feeds per request. If both symbols and price_feed_ids are sent, only the IDs are used.
  • properties: price, bestBidPrice, bestAskPrice, exponent, publisherCount, confidence, fundingRate, fundingTimestamp, fundingRateInterval, marketSession, emaPrice, emaConfidence, feedUpdateTimestamp. The default is the first six plus marketSession and feedUpdateTimestamp.
  • Prices are integers with an exponent. Each response also carries display_* values (display_price, display_bid, display_ask, display_confidence, display_ema_price, display_ema_confidence, display_funding_rate) with the exponent applied.

get_historical_price

Get prices at a single historical timestamp.

ParameterTypeRequiredDescription
symbolsstring[]No*BTC/USD or Crypto.BTC/USD
price_feed_idsnumber[]No*Feed IDs
timestampnumberYesUnix seconds, milliseconds, or microseconds
channelstringNoSame values as get_latest_price

* At least one of symbols or price_feed_ids is required.

  • Up to 50 feeds per request. If both are sent, only the IDs are used.
  • The timestamp is aligned down to the channel's update interval.

Historical data is available from April 2025 onward.

get_price_range

Return every price update for one or more feeds within a short window, such as the seconds around a liquidation or a news event.

ParameterTypeRequiredDescription
symbolsstring[]No*BTC/USD or Crypto.BTC/USD
price_feed_idsnumber[]No*Feed IDs
startnumberYesWindow start: Unix seconds, milliseconds, or microseconds
endnumberYesWindow end, at most 60 seconds after start
limitnumberNoRows per page. Default 100, max 500
afterstringNonext_cursor from the previous page
channelstringNoSame values as get_latest_price

* At least one of symbols or price_feed_ids is required. Up to 50 feeds.

  • When has_more is true, call again with the same arguments and after set to next_cursor.

get_candlestick_data

Fetch OHLC candlestick data for a single feed.

ParameterTypeRequiredDescription
symbolstringYesBTC/USD or Crypto.BTC/USD
resolutionstringYes1, 5, 15, 30, 60, 120, 240, 360, 720, D, W, M
fromnumberYesStart time (Unix seconds)
tonumberYesEnd time (Unix seconds)
channelstringNoSame values as get_latest_price
  • from must be earlier than to.
  • Up to 500 candles per response; larger results come back with truncated: true.
  • For funding-rate feeds, candles chart the mark price. Use get_latest_price or get_historical_price for the funding rate itself.

convert_date_to_timestamp

Convert a date to Unix timestamps for the other tools. No key needed.

ParameterTypeRequiredDescription
date_stringstringYesISO 8601, e.g. 2026-01-01 or 2026-01-01T14:30:00Z. Dates without a timezone are read as UTC

Troubleshooting

"This tool requires your Pyth Pro access token"

  • Cause: No key reached the server.
  • Fix: Configure the key in your client (see Setup), then restart or reconnect the client. Or pass it as access_token.

Invalid or expired key

  • Cause: The server rejected the key (HTTP 401).
  • Fix: Check that the header reads exactly Authorization: Bearer <key>, or get a new key from Acquire an API Key.

Not entitled to a feed

  • Cause: Your key is valid, but your plan does not include the feed (HTTP 403). The error names the entitlement group it needs.
  • Fix: Run get_symbols with your key and pick feeds with entitled: true.

Symbol not found or ambiguous

  • Fix: Use the full symbol or a feed ID from get_symbols. For an ambiguous pair, the error lists the matching feeds.

Feed listed in missing_feed_ids

  • Cause: get_latest_price or get_historical_price returned no price for the feed. The feed is not live yet (beta or coming_soon), or the channel is faster than the feed's min_channel.
  • Fix: Check the feed's state and min_channel in get_symbols, or use a slower channel.

No historical data

  • Fix: Use timestamps from April 2025 onward, and not in the future.

Truncated candles

  • Symptom: Response includes truncated: true
  • Fix: Narrow the time range or use a larger resolution.

Local Development

Optionally run the MCP server locally:

git clone https://github.com/pyth-network/pyth-crosschain.git
cd pyth-crosschain
pnpm install
pnpm --filter @pythnetwork/mcp build

Then configure your client with stdio transport. The local server reads your key from PYTH_PRO_ACCESS_TOKEN:

{
  "mcpServers": {
    "pyth": {
      "command": "node",
      "args": ["<path-to-repo>/apps/mcp/dist/index.js"],
      "env": {
        "PYTH_PRO_ACCESS_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}

MCP Skills

MCP Skills are pre-built prompt templates that teach AI assistants specific workflows using the Pyth MCP server. Instead of figuring out which tools to call and how to combine them, you can describe what you want in natural language and the skill handles the rest.

Skills work with Claude Code and are installed alongside the MCP server. Each skill listed below includes example prompts you can try directly in your AI assistant.

Skills require the Pyth MCP server to be configured first. Every skill that fetches prices also needs your Pyth Pro API key, configured as described in MCP Server setup.

Installation

Skills are Claude Code slash commands that live in your project's .claude/skills/ directory. Each skill is a folder containing a SKILL.md file.

Prerequisites

Setup

Clone the repository

git clone https://github.com/pyth-network/pyth-crosschain.git

Copy skills to your project

Copy the skills directory into your project's .claude/ folder:

cp -r pyth-crosschain/apps/mcp/skills/ your-project/.claude/skills/

Your project structure should look like:

your-project/
└── .claude/
    └── skills/
        ├── pyth-alert-conditions/
        │   └── SKILL.md
        ├── pyth-cross-asset-comparison/
        │   └── SKILL.md
        ├── pyth-fx-converter/
        │   └── SKILL.md
        ├── ... (9 skills total)
        └── references/
            └── common.md

Use a skill

In Claude Code, invoke any skill with a slash command:

/pyth-alert-conditions Is BTC above $100k?
/pyth-fx-converter Convert 1000 EUR to JPY
/pyth-portfolio-tracker I hold 2 BTC and 50 ETH

Or simply describe what you want — Claude Code will automatically select the appropriate skill based on your question.

You can also install individual skills by copying only the specific skill folders you need. Copy references/ with them, because every skill links to references/common.md.

Available Skills

SkillCategoryDescriptionAPI Key Required
Price AlertsMarket DataOne-time price threshold and percentage change checksYes
Cross-Asset ComparisonMarket DataCompare performance across assets via normalizationYes
Volatility AnalysisMarket DataAnnualized volatility, ATR, and risk comparisonYes
FX ConverterFinancialCurrency conversion with direct pairs or USD cross ratesYes
Portfolio TrackerFinancialPortfolio value, allocation, and P&L trackingYes
Funding Rate MonitorFinancialPerpetual futures funding rates and sentimentYes
Data ExportData & IntegrationExport price data as CSV, JSON, or MarkdownYes, except feed catalog exports
Time-Series SnapshotsData & IntegrationHistorical prices at specific datesYes
Integration HelperData & IntegrationDeveloper onboarding for Pyth feeds and IDsOnly for live prices

Market Data

Price Alerts

Evaluates one-time price conditions — checks if prices are above or below thresholds, if assets have moved by a percentage, or if prices are near period highs or lows. These are point-in-time checks, not persistent alerts.

How it works: Decomposes your question into the data needed, fetches it, evaluates the condition, and answers YES or NO with supporting numbers.

What you can ask:

  • "Is BTC above $100k?"
  • "Has ETH dropped 5% today?"
  • "Is gold near its weekly high?"
  • "Has SOL changed more than 10% since June 1?"
  • "Is the BTC bid-ask spread above $10?"

Try it:

"Is gold near its weekly high?"

The assistant fetches this week's daily candles and the current price, computes the weekly high from the candle data, and tells you how close the current price is as a percentage.


Cross-Asset Comparison

Compares price performance across multiple assets by normalizing OHLC data to a common baseline. Converts absolute prices to relative performance so you can compare assets at different price scales (e.g., BTC at 97kvsGoldat97k vs Gold at 2k).

How it works: Fetches candlestick data for each asset over the same time range, divides each close by the first close (1.0 = starting point), and computes period returns.

What you can ask:

  • "Compare Bitcoin vs Gold this quarter"
  • "ETH vs SOL performance over the last 30 days"
  • "EUR/USD vs GBP/USD over the past week"
  • "Which performed better this month: BTC, ETH, or SOL?"

Try it:

"Compare Bitcoin vs Gold this quarter"

The assistant fetches daily candles for both assets, normalizes each series, and presents a side-by-side table showing that, for example, BTC returned +12.4% while Gold returned +4.2%.


Volatility Analysis

Analyzes price volatility using candlestick data. Computes annualized volatility from close-to-close returns, average true range (ATR), and daily range metrics.

How it works: Fetches candlestick data, calculates daily returns, then computes standard deviation and annualizes it (using 365 days for crypto, 252 for equities/FX).

What you can ask:

  • "How volatile is SOL?"
  • "Compare the volatility of BTC, ETH, and AAPL"
  • "What's the average daily range of gold?"
  • "Is ETH more volatile than BTC?"

Try it:

"Compare the volatility of BTC, ETH, and AAPL"

The assistant fetches 30 days of daily candles for each, computes annualized volatility and ATR, and presents a comparison table showing relative risk levels.


Financial Workflows

FX Converter

Converts currencies using Pyth FX and crypto price feeds. Supports fiat-to-fiat, crypto-to-fiat, and historical rate conversions.

How it works: The assistant uses a direct pair, such as EUR/JPY, when Pyth has one live. Otherwise it converts through USD and reads each pair's direction: EUR/USD is dollars per euro, and USD/JPY is yen per dollar.

What you can ask:

  • "Convert 1000 EUR to JPY"
  • "How much is 5 BTC in EUR?"
  • "What was the GBP/JPY rate last Friday?"
  • "Convert 500 USD to GBP"

Try it:

"Convert 1000 EUR to JPY"

The assistant finds the live EUR/JPY pair, fetches its rate (e.g., 161.19), and returns: 1000 EUR = 161,190 JPY.


Portfolio Tracker

Tracks a portfolio of assets with current prices, allocation percentages, and P&L calculations. Supports cost-basis and date-based P&L.

How it works: Discovers feeds, batches all assets into a single price call (up to 100 feeds), then computes value, allocation, and optionally compares against historical reference prices.

What you can ask:

  • "What's my portfolio worth? I hold 2 BTC, 50 ETH, and 1000 SOL"
  • "Show gold, silver, and platinum prices"
  • "How has my portfolio performed since last month?"
  • "What's the allocation breakdown of my crypto holdings?"

Try it:

"What's my portfolio worth? I hold 2 BTC, 50 ETH, and 1000 SOL"

The assistant fetches all three prices in one call and returns a table with each asset's value and your total portfolio value with allocation percentages.


Funding Rate Monitor

Monitors perpetual futures funding rates to gauge market sentiment. Positive rates indicate long-biased (bullish) markets, negative rates indicate short-biased (bearish) markets.

How it works: Discovers funding rate feeds using the funding-rate asset type, fetches current rates, and tracks how a rate has changed by sampling it with historical price snapshots.

What you can ask:

  • "What are the current BTC and ETH funding rates?"
  • "Show me all funding rates sorted by magnitude"
  • "How has the BTC funding rate changed this week?"
  • "Which assets have the highest funding rates right now?"

Try it:

"What are the current BTC and ETH funding rates?"

The assistant fetches both rates and presents them with sentiment labels — for example, BTC at +0.012% (slightly long-biased) and ETH at +0.035% (moderately long-biased).


Data & Integration

Data Export

Exports Pyth price data in CSV, JSON, or Markdown table format. Handles OHLC exports, feed catalog dumps, historical snapshots, and current price tables.

How it works: Fetches all requested data first (with pagination if needed), then formats the complete dataset. Caps exports at 1000 rows.

What you can ask:

  • "Export BTC daily OHLC for the last 30 days as CSV"
  • "Give me all crypto feeds as JSON"
  • "Show current prices for BTC, ETH, and gold as a Markdown table"
  • "Export the full feed catalog"

Try it:

"Export BTC daily OHLC for the last 30 days as CSV"

The assistant fetches daily candlestick data and formats it with headers: timestamp,open,high,low,close,volume followed by one row per day.


Time-Series Snapshots

Fetches price snapshots at specific historical timestamps. Generates timestamp series (monthly, weekly, quarterly) and retrieves prices for each date.

How it works: Generates Unix timestamps for your requested dates, then calls the historical price API once per timestamp with up to 50 feeds per call. For continuous data (more than ~20 points), suggests candlestick data instead.

What you can ask:

  • "What was BTC at the start of each month this year?"
  • "Show me ETH and SOL prices every Monday for the last 4 weeks"
  • "Get quarterly gold prices since April 2025"

Try it:

"What was BTC at the start of each month this year?"

The assistant generates timestamps for April 1, May 1, June 1, etc. (data starts April 2025), fetches each snapshot, and presents a table of monthly prices.


Integration Helper

Guides developers on integrating Pyth price feeds. Explains feed discovery, symbol formats, ID types, price exponents, and data channels.

How it works: Understands your integration context (language, chain, use case), uses feed discovery to find specific feeds, and explains the symbol/ID/exponent/channel system.

What you can ask:

  • "How do I use Pyth in my trading bot?"
  • "What's the feed ID for AAPL?"
  • "What asset types does Pyth support?"
  • "How does Pyth Pro work?"
  • "How do pricing channels work?"

Try it:

"What's the feed ID for AAPL?"

The assistant searches for AAPL and returns the symbol (Equity.US.AAPL/USD), the Pyth Pro numeric feed ID, and the exponent for price conversion.

On this page