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, and generate chart-ready candles, all within a single conversation.

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

Tools

CategoryToolDescription
Discoveryget_symbolsFind available feeds by query and asset type
Real-timeget_latest_priceFetch latest prices for up to 100 feeds
Historicalget_historical_priceGet point-in-time prices for up to 50 feeds
Chartingget_candlestick_dataReturn OHLC candles (up to 500 per response)

Recommended workflow: get_symbolsget_latest_price / get_historical_priceget_candlestick_data

get_latest_price requires a Pyth Pro access token passed as access_token. Get one at acquire access token guide. All other tools work without a token.

Setup

  • Endpoint: https://mcp.pyth.network/mcp
  • Transport: Streamable HTTP
  • Auth: No key required at the endpoint level

Open Settings

In Claude Desktop, open Settings → Developer → Edit Config.

Add the MCP Server

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "pyth": {
      "url": "https://mcp.pyth.network/mcp"
    }
  }
}

Restart and Verify

Restart Claude Desktop. MCP tools should appear in chat.

Add Server

claude mcp add pyth --transport http https://mcp.pyth.network/mcp

Verify

claude mcp list

Open MCP Settings

In Cursor, go to Settings → Tools & MCP → Add Custom MCP.

Add Config

{
  "mcpServers": {
    "pyth": {
      "url": "https://mcp.pyth.network/mcp"
    }
  }
}

Verify

Confirm pyth is connected in Settings → Tools & MCP.

Any MCP client that supports Streamable HTTP can connect to:

https://mcp.pyth.network/mcp

Tool Reference

get_symbols

Search and list available Pyth Pro feeds.

ParameterTypeRequiredDescription
querystringNoText search filter
asset_typestringNocrypto, fx, equity, metal, rates, commodity, funding-rate
limitnumberNoDefault 50, max 200
offsetnumberNoDefault 0

get_latest_price

Fetch latest prices for one or more feeds.

ParameterTypeRequiredDescription
access_tokenstringYesPyth Pro token
symbolsstring[]No*Full symbols like Crypto.BTC/USD
price_feed_idsnumber[]No*Feed IDs from get_symbols
channelstringNoreal_time or fixed_rate@{N}ms
propertiesstring[]NoRequested fields

* At least one of symbols or price_feed_ids is required.

  • Max combined feeds per request: 100
  • If both symbols and price_feed_ids are sent, IDs take precedence
  • Symbols must include asset-type prefix (Crypto.BTC/USD, not BTC/USD)

get_historical_price

Get prices at a single historical timestamp.

ParameterTypeRequiredDescription
symbolsstring[]No*Full symbols
price_feed_idsnumber[]No*Feed IDs
timestampnumberYesUnix seconds, milliseconds, or microseconds
channelstringNoreal_time or fixed_rate@{N}ms

* At least one of symbols or price_feed_ids is required.

  • Max feeds per request: 50
  • If both IDs and symbols are sent, IDs take precedence
  • Timestamp is normalized to microseconds and aligned down to channel interval

Historical data is available from April 2025 onward.

get_candlestick_data

Fetch OHLC candlestick data for a single feed.

ParameterTypeRequiredDescription
symbolstringYesFull symbol (e.g. Crypto.BTC/USD)
resolutionstringYes1, 5, 15, 30, 60, 120, 240, 360, 720, D, W, M
fromnumberYesStart time (Unix seconds)
tonumberYesEnd time (Unix seconds)
channelstringNoreal_time or fixed_rate@{N}ms
  • from must be earlier than to
  • Max candles returned: 500
  • Large result sets are truncated with truncated: true in the response

Troubleshooting

Invalid or expired token

  • Symptom: get_latest_price returns an auth error
  • Fix: Verify or regenerate your token and pass it as access_token

Symbol not found

  • Symptom: Lookup fails for a symbol
  • Fix: Run get_symbols first and use the exact symbol with its asset-type prefix

No historical data

  • Symptom: Historical or candle responses are empty
  • Fix: Use timestamps after April 2025 and ensure the timestamp is 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:

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

On this page