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 分

    请在仓库或注册中心条目中声明许可证。