Pyth MCP logo

Pyth MCP

Access Pyth Hermes prices, feed metadata, history, caching, and bounded live streams through MCP or a CLI.

Install Pyth MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "pyth-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pyth-mcp"
      ],
      "env": {
        "PYTH_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env PYTH_API_KEY=YOUR_VALUE_HERE --transport stdio pyth-mcp -- npx -y pyth-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y pyth-mcp

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The pyth-mcp MCP server connects AI clients to Pyth Network Hermes for current oracle prices, feed metadata, session history, and bounded live updates. Its seven MCP tools cover single and batch quotes, catalog search, feed resolution, streaming, and connectivity checks. Price responses include exact decimal values, confidence intervals, EMA data, publish times, and staleness details, with per-feed TTL caching and stale fallbacks. Reach for it when an agent needs crypto, equity, or other Pyth-supported market data without building a Hermes client.

Use cases

  • Retrieve current BTC, ETH, or other Pyth-supported prices for an agent
  • Search the Hermes catalog for feeds by symbol or asset type
  • Track price changes and threshold crossings with CLI watch mode
  • Inspect recent in-session quotes or stream bounded live updates

Key features

  • Single and batch Pyth Hermes price retrieval
  • Confidence intervals, EMA values, and staleness metadata
  • Feed resolution and searchable catalog access
  • Per-feed TTL caching with disk persistence
  • Session price history and bounded streaming
  • MCP stdio server and command-line interface

Tools7

What Pyth MCP lets your agent do. Expand a tool for its parameters.

Self-reported~134 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

5/5 checks healthy over the last 21d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 3d ago via OSV.dev · pyth-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads420Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed7Callable tools this server registers over MCP.

How Pyth MCP works

What pyth-mcp does

pyth-mcp exposes Pyth Network Hermes price feeds through an MCP stdio server and a command-line interface. It can retrieve one quote or a batch of up to 100 feeds, search the Hermes catalog, resolve symbols and feed IDs, inspect prices collected during the current session, and stream updates for a bounded period.

Quote data includes the raw integer value, exact decimal representation, exponent, confidence interval, EMA price, publish time, and staleness indicators. Built-in mappings cover BTC/USD, ETH/USD, SOL/USD, USDC/USD, and USDT/USD; other assets can be found through catalog search or addressed with a full symbol or 64-character hexadecimal feed ID.

The project uses Node.js built-ins only and provides TypeScript declarations for its programmatic API. It is intended for agents or applications that need structured market data from Pyth rather than a general-purpose trading or portfolio system.

How it works

The MCP process communicates over newline-delimited JSON-RPC 2.0 on standard input and output. It negotiates supported MCP protocol versions and keeps stdout reserved for protocol messages. The server accepts closed tool schemas, so invalid inputs receive JSON-RPC invalid-parameter errors.

Latest prices use independent per-feed cache entries. The default price-cache lifetime is 30 seconds, while catalog results default to a one-hour lifetime. Cache data is stored on disk under .pyth-mcp/; unreadable cache files are quarantined and rebuilt. The cache also prunes expired data and observes entry and size limits.

Fresh quotes fetched during a process session are added to bounded in-memory ring buffers. Price history is returned newest last and is not persisted to disk. If a refresh fails, the client can use the last known quote with an explicit stale marker. Requests have bounded timeouts and retries, including handling for HTTP 429 responses and their Retry-After values.

Setup and configuration

Install the package with npm and run the MCP process with:

Terminal
npm install pyth-mcp
npx -y pyth-mcp

An MCP client can launch it with the pyth-mcp command and no account setup. Docker users can build the included image and run it interactively; the container starts the stdio server directly.

The implementation requires Node.js 20 or newer. PYTH_ROOT selects the project root when no CLI --root option is supplied. Other configuration variables include PYTH_BASE_URL, PYTH_TIMEOUT_MS, PYTH_CACHE_TTL_MS, PYTH_CATALOG_TTL_MS, and PYTH_RETRIES. Set PYTH_API_KEY before retrieving live price updates where the Hermes service requires authentication. The key is sent as a bearer token and is redacted from CLI and public configuration output.

Tools and capabilities

  • pyth_get_price retrieves one latest quote with confidence, EMA, publish-time, and staleness information.
  • pyth_get_prices fetches up to 100 feeds, with separate cache handling and per-feed errors.
  • pyth_get_price_history returns the current session's bounded history for one feed.
  • pyth_list_feeds searches the Hermes catalog, with optional asset-type and result-limit filters.
  • pyth_resolve_feed maps a symbol or feed ID to canonical feed metadata.
  • pyth_stream_prices emits live updates for as many as 100 feeds during a bounded interval.
  • pyth_ping performs a small live Hermes request to check reachability.

The CLI adds commands for initialization, catalog searches, single or batch price retrieval, history, watch loops, configuration, and MCP startup. Watch mode can poll at an interval, emit JSON, continue after transient failures, and report alerts when a configured threshold is crossed.

Limitations and notes

Session history exists only in memory and is lost when the process ends. A quote is marked stale when its oracle update is more than 60 seconds old; allowing stale data can return the last known history value after a failed refresh. Batch price requests can contain both successful quotes and individual errors, but fail when none of the requested feeds can be returned.

Hermes access is public in the default configuration, but live price retrieval may require an API key under current service policy. Catalog entries that cannot be parsed are skipped and reported rather than stopping the whole catalog request. The server is focused on Pyth feed access and does not provide order execution or trading operations.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Pyth MCP

pyth-mcp is an MCP server that connects AI clients to Pyth Network Hermes. Its main tools retrieve single or batch prices, search and resolve feed metadata, return in-session price history, stream bounded live updates, and check Hermes reachability. Results include confidence, EMA, publish time, and staleness data.

Install it with npm or launch it through an MCP client using `npx -y pyth-mcp`. The server requires Node.js 20 or newer and communicates over stdio. Docker is also supported by building the included image and running it interactively.

Yes, pyth-mcp works with Cursor because it supports MCP stdio connections. Add a server entry that runs `npx` with `-y` and `pyth-mcp`, then use the available price, catalog, history, resolution, streaming, and ping tools.

Live price retrieval may require `PYTH_API_KEY` under the current Hermes API policy. The key is optional in the default configuration, sent only as a bearer token, and redacted from CLI and public configuration output.

pyth-mcp caches latest prices independently per feed and stores cache state on disk under `.pyth-mcp/`. The default price TTL is 30 seconds, while catalog results default to one hour. A zero price TTL disables cache reads and writes for that request.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPyth MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pyth-mcp?style=directory)](https://allmcps.com/mcp/pyth-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/pyth-mcp"><img src="https://allmcps.com/api/badge/pyth-mcp?style=directory" alt="Pyth MCP on AllMCPs" /></a>