Pyth Pro MCP Server

io.github.pyth-network由 GitHub 帳號 pyth-network 發布v0.3.2更新於 Oct 24, 2026

Real-time and historical price feeds for 500+ crypto, equities, FX, and commodities assets.

已驗證Streamable HTTP可網頁執行金融資料與分析

概覽

AI 產生的概覽

託管的 Pyth Pro MCP 伺服器,讓助理查詢 500 多個加密、股票、外匯與大宗商品價格來源的即時與歷史價格。

可以做什麼
  • 依資產類型、工具類型或期貨鏈探索並篩選可用的價格來源
  • 取得一個或多個價格來源的即時最新價格
  • 查詢某一時點的歷史價格,以及最長 60 秒視窗內的所有價格更新
  • 取得 OHLC K 線資料,用於繪圖、技術分析或回測
  • 將 ISO 8601 日期字串轉換為價格工具所需的 Unix 時間戳
適用情境
當助理需要市場資料時使用:目前報價、價格歷史、某事件前後的盤中走勢,或用於分析與回測的 K 線序列,涵蓋加密、股票、外匯與大宗商品。
執行需求
遠端 Streamable HTTP 端點,無需本機安裝;Claude Desktop 可透過 mcp-remote 橋接,需要 Node.js。價格工具需要你自己的 Pyth Pro 存取權杖,可透過 Authorization Bearer 標頭、本機 stdio 版本的 PYTH_PRO_ACCESS_TOKEN 環境變數,或每次呼叫時的 access_token 參數提供。本機另可選設價格通道、日誌層級與請求逾時變數。
安裝前請注意
價格工具需要你自己的 Pyth Pro 存取權杖;逐次傳入的權杖由助理處理,用戶端設定檔可能以明文保存權杖,請勿放入程式碼儲存庫。回傳 403 表示你的方案無權存取該價格來源。mcp-remote 是社群套件,會經手你的金鑰。在 Team 與 Enterprise 連接器中,由 Owner 設定的標頭金鑰為整個組織共用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pyth Pro MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.pyth-network%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "pyth-pro": {
      "type": "http",
      "url": "https://mcp.pyth.network/mcp"
    }
  }
}

README

Pyth Pro MCP Server

MCP server that gives AI assistants access to real-time and historical market data from Pyth — 500+ price feeds across crypto, equities, FX, commodities, and more.

Hosted at https://mcp.pyth.network/mcp

Quick Start

Each snippet sends your own Pyth Pro API key as an Authorization: Bearer header, so you set it once (see Access Token).

Claude Code

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

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.

Claude Desktop

Claude Desktop connects to remote servers as custom connectors, which can send your key as a header only where Anthropic's request-headers beta is enabled. To set the key once on any plan, bridge with mcp-remote (needs Node.js) in claude_desktop_config.json (Claude menu bar → Settings… → Developer → Edit Config):

json
{  "mcpServers": {    "pyth": {      "command": "npx",      "args": ["-y", "[email protected]", "https://mcp.pyth.network/mcp", "--header", "Authorization:${PYTH_AUTH_HEADER}"],      "env": { "PYTH_AUTH_HEADER": "Bearer YOUR_TOKEN" }    }  }}

mcp-remote is a community package, not maintained by Pyth, and it handles your key; the snippet pins the version we tested.

Or add https://mcp.pyth.network/mcp as a custom connector: on Free, Pro or Max under Customize → Connectors → Add custom connector; on Team or Enterprise an Owner adds it under Organization settings → Connectors → Add → Custom, and members click Connect under Customize → Connectors. With the request-headers beta, choose No sign-in and add an authorization header Bearer YOUR_TOKEN (on Team and Enterprise plans the Owner sets it for the whole organization, so everyone shares that key); otherwise pass the key per call.

Cursor

Add to ~/.cursor/mcp.json (global, so the key stays out of your repo):

json
{  "mcpServers": {    "pyth": {      "url": "https://mcp.pyth.network/mcp",      "headers": { "Authorization": "Bearer YOUR_TOKEN" }    }  }}

To keep the key out of the file, write "Bearer ${env:PYTH_PRO_ACCESS_TOKEN}" and set that variable in your shell profile or system environment.

VS Code

Add to ~/.copilot/mcp-config.json, a user-level file that VS Code's chat and its Agent Host sessions both read. It holds your key in plain text, so never copy it into a repository. (VS Code's ${input:...} prompt avoids that, but Agent Host sessions do not receive .vscode/mcp.json servers that use it.)

json
{  "mcpServers": {    "pyth": {      "type": "http",      "url": "https://mcp.pyth.network/mcp",      "headers": { "Authorization": "Bearer YOUR_TOKEN" },      "tools": ["*"]    }  }}

Other Clients

Any MCP client that supports Streamable HTTP: connect to https://mcp.pyth.network/mcp with the header Authorization: Bearer YOUR_TOKEN.

Tools

ToolDescriptionAuth Required
get_symbolsSearch and list price feeds; filter by asset type, instrument type or futures chainOptional (adds Pro-only feeds and an entitled flag per feed)
get_latest_priceReal-time prices for one or more feedsYes (access token)
get_historical_pricePoint-in-time price snapshotsYes (access token)
get_price_rangeEvery price update within a window of up to 60 secondsYes (access token)
get_candlestick_dataOHLC candlestick bars for charting and analysisYes (access token)
convert_date_to_timestampConvert date strings to Unix timestampsNo

Tip: Use get_symbols first to discover available feeds. Price tools accept full symbols (Crypto.BTC/USD) or bare pairs (BTC/USD). A bare pair resolves to the live spot feed when there is one, otherwise to the only remaining match (e.g. BTC/USDT → the Binance funding-rate feed); if several remain, the error lists them.

Access Token

Every user brings their own Pyth Pro access token. It is required for get_latest_price, get_historical_price, get_price_range and get_candlestick_data. get_symbols works without one, but with a token it also lists feeds visible only to Pro keys and marks each feed entitled: true/false (whether your token can query it right now). convert_date_to_timestamp never needs one.

  • Get a token: Acquire an API key
  • Give the server your token in one of three ways. A token passed on a call wins over a configured one.
    • Configure it once for the hosted server: send it as an Authorization: Bearer header from your MCP client (see Quick Start), so your assistant does not handle it on every call.
    • Configure it once for a local stdio server: set PYTH_PRO_ACCESS_TOKEN in the server's env block in your client config (see Local stdio config).
    • Per call: the access_token tool parameter. Your assistant asks for it when no token is configured. Clients that cannot send headers (e.g. Claude Desktop custom connectors without the request-headers beta) use this.
  • The server never has a key of its own: the hosted server ignores PYTH_PRO_ACCESS_TOKEN in its own environment and only uses the key each user sends.
  • A 401 means the token is invalid or expired. A 403 means the token is valid but your plan is not entitled to that feed; the error names the entitlement group required.
  • Only feeds in state stable return prices. Requested feeds that come back without a price (e.g. beta or coming_soon feeds, or a channel faster than the feed's min_channel) are listed in missing_feed_ids.

Example Queries

Try these with any connected AI assistant:

  • "What's the current price of Bitcoin?"
  • "Show me the ETH/USD price history for the last 24 hours"
  • "Compare the prices of gold and silver right now"
  • "Get daily candlestick data for AAPL over the past week"
  • "What crypto price feeds are available on Pyth?"
  • "Show every BTC/USD price update in the 30 seconds after 14:30 UTC today"
  • "Which VIX futures contracts does Pyth have?"

Local Development

For contributors working on the MCP server itself.

Build

sh
pnpm --filter @pythnetwork/mcp build

MCP Inspector

Run the inspector to interactively test tools:

sh
npx @modelcontextprotocol/inspector --cli -- pnpm --filter @pythnetwork/mcp start:stdio:dev

Local stdio config

To connect a client to a local build via stdio:

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

Environment Variables

VariableDefaultDescription
PYTH_CHANNELfixed_rate@200msDefault price channel: real_time, fixed_rate@50ms, fixed_rate@200ms or fixed_rate@1000ms
PYTH_LOG_LEVELinfoLog level (debug/info/warn/error)
PYTH_REQUEST_TIMEOUT_MS10000HTTP request timeout
PYTH_PRO_ACCESS_TOKEN—Your own token, stdio only. Ignored by the HTTP server.

Links

來源:apps/mcp/README.md,提交 709e742

工具

6

get_symbols

List Pyth Price Feeds

List available Pyth Pro price feeds. Use this FIRST to discover what feeds exist before calling get_latest_price, get_historical_price, get_price_range or get_candlestick_data (those also accept bare pairs like BTC/USD). Filter by asset_type (e.g. crypto, equity, fx, metal, commodity, interest-rate, funding-rate, kalshi) or search by name/symbol. Narrow further with instrument_type (spot, future, ...) or symbol_chain_id (all contracts of one futures chain, e.g. VX). Retired (inactive) feeds are hidden unless include_inactive is true. Returns compact feed metadata: symbol, name, description, pyth_lazer_id, asset_type, instrument_type, state, exponent, min_channel (fastest channel the feed supports), quote_currency, and where set groups (entitlement groups that gate the feed), expiration_time and symbol_chain_id (futures). Pass verbose: true for every catalog field, e.g. market_sessions (trading-hours schedules) and corporate_actions (e.g. stock splits). With an access token, the list also includes feeds visible only to Pro keys, and each feed has `entitled`: true means this key can query the feed right now. When `entitled` is false, `not_entitled_reason` says why: `not_live (...)` means the feed is in beta, not live yet, or retired, so no key can query it (NOT a plan limitation), `requires one of entitlement groups: ...` means the user's plan lacks that entitlement.

輸入參數limitqueryoffsetverboseasset_typeaccess_tokeninstrument_typesymbol_chain_idinclude_inactive

convert_date_to_timestamp

Convert Date to Timestamp

Convert a date string to Unix timestamp for use with get_historical_price, get_price_range and get_candlestick_data. Use this tool when you need to compute timestamps — do not calculate Unix timestamps manually. Accepts ISO 8601 dates (e.g. '2026-01-01', '2026-01-01T12:00:00Z'). Returns seconds, microseconds, ISO 8601, and whether the date is within the available data range (April 2025 onward).

輸入參數date_string必填

get_candlestick_data

Get Candlestick Data

Fetch OHLC candlestick bars for one symbol, for charting, technical analysis or backtesting. OHLC values are already human-readable (no exponent). Requires the user's own Pyth Pro access token. If the user configured it in their MCP client, omit `access_token`; otherwise pass it as `access_token`, and if the tool reports it missing, ask the user for it. Symbols can be full names from get_symbols (e.g. 'Crypto.BTC/USD', 'Equity.US.AAPL/USD') or bare pairs like 'BTC/USD'. A bare pair resolves to the live spot feed when there is one, otherwise to the only remaining live match; `resolved_symbols` in the response shows what each input resolved to, and an ambiguous input returns an error listing the candidates. `from` and `to` are Unix seconds only. Resolutions: 1/5/15/30/60 minutes, 120/240/360/720 (multi-hour), D (daily), W (weekly), M (monthly). At most 500 candles are returned; `truncated: true` means narrow the range or use a larger resolution. Historical data is available from April 2025 onward; do not request times before that. Price tools: get_latest_price for now, get_historical_price for one past instant, get_price_range for every update within up to 60 seconds, get_candlestick_data for OHLC bars over longer periods. Timestamp reference (Unix seconds): 2025-04-01 (earliest available) = 1743465600 2026-01-01 = 1767225600 2026-06-01 = 1780272000 Always double-check your timestamp math (year-boundary errors are common), or use convert_date_to_timestamp.

輸入參數to必填from必填symbol必填channelresolution必填access_token

get_historical_price

Get Historical Price

Get the price of one or more feeds at one past instant. Requires the user's own Pyth Pro access token. If the user configured it in their MCP client, omit `access_token`; otherwise pass it as `access_token`, and if the tool reports it missing, ask the user for it. Symbols can be full names from get_symbols (e.g. 'Crypto.BTC/USD', 'Equity.US.AAPL/USD') or bare pairs like 'BTC/USD'. A bare pair resolves to the live spot feed when there is one, otherwise to the only remaining live match; `resolved_symbols` in the response shows what each input resolved to, and an ambiguous input returns an error listing the candidates. If both price_feed_ids and symbols are provided, only price_feed_ids are used. The timestamp accepts Unix seconds, milliseconds or microseconds (auto-detected) and is rounded down to the channel rate (e.g. a multiple of 200 ms for fixed_rate@200ms). Historical data is available from April 2025 onward; do not request times before that. Requested feeds that return no price are listed in `missing_feed_ids` (e.g. beta or coming_soon feeds, or a channel faster than the feed's min_channel). Prices are integers with an exponent field: human-readable price = price * 10^exponent. Pre-computed display_* fields (display_price, display_bid, display_ask, display_confidence, display_ema_price, display_ema_confidence, display_funding_rate) apply the exponent for you. Price tools: get_latest_price for now, get_historical_price for one past instant, get_price_range for every update within up to 60 seconds, get_candlestick_data for OHLC bars over longer periods. Timestamp reference (Unix seconds): 2025-04-01 (earliest available) = 1743465600 2026-01-01 = 1767225600 2026-06-01 = 1780272000 Always double-check your timestamp math (year-boundary errors are common), or use convert_date_to_timestamp.

輸入參數channelsymbolstimestamp必填access_tokenprice_feed_ids

get_latest_price

Get Latest Price

Get the most recent real-time price for one or more feeds. Requires the user's own Pyth Pro access token. If the user configured it in their MCP client, omit `access_token`; otherwise pass it as `access_token`, and if the tool reports it missing, ask the user for it. Symbols can be full names from get_symbols (e.g. 'Crypto.BTC/USD', 'Equity.US.AAPL/USD') or bare pairs like 'BTC/USD'. A bare pair resolves to the live spot feed when there is one, otherwise to the only remaining live match; `resolved_symbols` in the response shows what each input resolved to, and an ambiguous input returns an error listing the candidates. If both price_feed_ids and symbols are provided, only price_feed_ids are used. Requested feeds that return no price are listed in `missing_feed_ids` (e.g. beta or coming_soon feeds, or a channel faster than the feed's min_channel). Prices are integers with an exponent field: human-readable price = price * 10^exponent. Pre-computed display_* fields (display_price, display_bid, display_ask, display_confidence, display_ema_price, display_ema_confidence, display_funding_rate) apply the exponent for you. Price tools: get_latest_price for now, get_historical_price for one past instant, get_price_range for every update within up to 60 seconds, get_candlestick_data for OHLC bars over longer periods.

輸入參數channelsymbolspropertiesaccess_tokenprice_feed_ids

get_price_range

Get Price Range

Get every price update for one or more feeds within a short historical window (at most 60 seconds), e.g. to see exactly how a price moved around an event. Requires the user's own Pyth Pro access token. If the user configured it in their MCP client, omit `access_token`; otherwise pass it as `access_token`, and if the tool reports it missing, ask the user for it. Symbols can be full names from get_symbols (e.g. 'Crypto.BTC/USD', 'Equity.US.AAPL/USD') or bare pairs like 'BTC/USD'. A bare pair resolves to the live spot feed when there is one, otherwise to the only remaining live match; `resolved_symbols` in the response shows what each input resolved to, and an ambiguous input returns an error listing the candidates. If both price_feed_ids and symbols are provided, only price_feed_ids are used. Rows are ordered by time and interleaved across feeds; a fixed_rate@200ms channel yields 5 rows per feed per second. When `has_more` is true, call again with `after` set to `next_cursor` and the same feeds, window and channel. Historical data is available from April 2025 onward; do not request times before that. Prices are integers with an exponent field: human-readable price = price * 10^exponent. Pre-computed display_* fields (display_price, display_bid, display_ask, display_confidence, display_ema_price, display_ema_confidence, display_funding_rate) apply the exponent for you. Price tools: get_latest_price for now, get_historical_price for one past instant, get_price_range for every update within up to 60 seconds, get_candlestick_data for OHLC bars over longer periods.

輸入參數end必填afterlimitstart必填channelsymbolsaccess_tokenprice_feed_ids

版本歷史

4
  1. v0.3.2最新Oct 23, 2026
  2. v0.3.1Oct 9, 2026
  3. v0.3.0Oct 6, 2026
  4. v0.2.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。