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
| Category | Tool | Description |
|---|---|---|
| Discovery | get_symbols | Find available feeds by query and asset type |
| Real-time | get_latest_price | Fetch latest prices for up to 100 feeds |
| Historical | get_historical_price | Get point-in-time prices for up to 50 feeds |
| Charting | get_candlestick_data | Return OHLC candles (up to 500 per response) |
Recommended workflow: get_symbols → get_latest_price / get_historical_price → get_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/mcpVerify
claude mcp listOpen 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Text search filter |
asset_type | string | No | crypto, fx, equity, metal, rates, commodity, funding-rate |
limit | number | No | Default 50, max 200 |
offset | number | No | Default 0 |
get_latest_price
Fetch latest prices for one or more feeds.
| Parameter | Type | Required | Description |
|---|---|---|---|
access_token | string | Yes | Pyth Pro token |
symbols | string[] | No* | Full symbols like Crypto.BTC/USD |
price_feed_ids | number[] | No* | Feed IDs from get_symbols |
channel | string | No | real_time or fixed_rate@{N}ms |
properties | string[] | No | Requested fields |
* At least one of symbols or price_feed_ids is required.
- Max combined feeds per request:
100 - If both
symbolsandprice_feed_idsare sent, IDs take precedence - Symbols must include asset-type prefix (
Crypto.BTC/USD, notBTC/USD)
get_historical_price
Get prices at a single historical timestamp.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | string[] | No* | Full symbols |
price_feed_ids | number[] | No* | Feed IDs |
timestamp | number | Yes | Unix seconds, milliseconds, or microseconds |
channel | string | No | real_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.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Full symbol (e.g. Crypto.BTC/USD) |
resolution | string | Yes | 1, 5, 15, 30, 60, 120, 240, 360, 720, D, W, M |
from | number | Yes | Start time (Unix seconds) |
to | number | Yes | End time (Unix seconds) |
channel | string | No | real_time or fixed_rate@{N}ms |
frommust be earlier thanto- Max candles returned:
500 - Large result sets are truncated with
truncated: truein the response
Troubleshooting
Invalid or expired token
- Symptom:
get_latest_pricereturns 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_symbolsfirst 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 buildThen 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>"
}
}
}
}