Feed updates
FX.Index.USD/BRLaddedCrypto.PEARL/USDaddedEquity.Index.EWZ/USDwent liveEquity.US.ZCSH/USDaddedEquity.Index.MRVL/USDwent liveEquity.Index.AMD/USDwent liveMetal.SIZ6/USDaddedEquity.US.WBD/USDremovedEquity.Index.EWZ/USDaddedEquity.Index.QQQ/USDaddedEquity.Index.SPY/USDaddedEquity.Index.HIMS/USDaddedEquity.Index.BABA/USDaddedEquity.Index.GME/USDadded
View all
Developer Hub

MCP Server

Connect AI assistants to Pyth market data via the Model Context Protocol

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).

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_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: 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.

Next: MCP Skills

Once the server is connected, you can go beyond raw tool calls with MCP Skills — pre-built prompt templates that teach your AI assistant specific workflows:

  • Portfolio tracking — value, allocation, and P&L in one question
  • Volatility analysis — annualized vol, ATR, and risk comparison
  • FX conversion — cross-rate conversions through Pyth feeds
  • Data export — dump OHLC, snapshots, or feed catalogs as CSV/JSON
  • And more — price alerts, funding rates, cross-asset comparisons, integration guidance

Browse all 9 skills with example prompts on the MCP Skills page.

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"
      }
    }
  }
}

On this page