- Home
- MCP servers
- Pyth Network
Pyth Network
- python
4
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"itsomsarraf-pyth-network-mcp": {
"command": "python3",
"args": [
"pyth_mcp_server.py"
]
}
}
}You can run the Pyth Network MCP Server locally to expose Pyth’s real-time price feeds through the Model Context Protocol. This server lets AI agents and autonomous systems query current prices, historical updates, TWAPs, and publisher stake caps in a straightforward, standardized way. It operates via a simple, local MCP channel and can be combined with MCP clients for natural-language queries and programmatic access.
How to use
You will run the MCP server as a local, stdio-based service and connect using an MCP client. The server provides five tools to fetch price data, perform analysis, and retrieve historical information. Use an MCP client to issue tool calls, then interpret the structured responses for your AI agents or automation workflows.
How to install
Prerequisites: You need Python 3.10 or higher and a package manager such as pip or uvx. You may also install uv for quick local runs.
# Clone the MCP server repository
git clone https://github.com/itsomsarraf/pyth-network-mcp.git
cd pyth-network-mcp
# Install dependencies (preferred)
uv sync
# or alternative installation
pip install mcp httpx
Run the server locally
Start the MCP server in stdio mode using Python. You can run it directly, or via a script provided in the project.
python3 pyth_mcp_server.py
Configure MCP client integration
To connect a client such as Claude Desktop or Cursor/Windsurf, specify the MCP server in your client’s settings so it can send and receive MCP messages.
{
"mcpServers": {
"pyth_network": {
"command": "python3",
"args": ["pyth_mcp_server.py"],
"cwd": "/absolute/path/to/pyth-network-mcp"
}
}
}
Test with the included client
There is a demo client you can run to exercise all five tools and see how responses look. Run it to verify the server is responding correctly.
python3 pyth_mcp_client.py
Notes on transport and data
The server uses stdio for transport, which is efficient for local MCP interactions with AI tools and IDE integrations. Responses are human-readable by default and binary data is typically disabled to keep outputs clean.
Security and maintenance
Keep your Python environment updated and limit access to the local machine where the MCP server runs. Regularly update dependencies such as mcp and httpx to stay aligned with the latest MCP standards and Hermes API changes.
Project structure and access patterns
The server fetches data from Pyth Hermes API on demand and remains stateless between requests. You’ll typically issue a sequence of tool calls to discover feeds, fetch current prices, and compute TWAPs for your use case.
Available tools
get_price_feeds
Search and filter price feeds by symbol or asset type to discover available feeds and their IDs.
get_latest_price_updates
Fetch the latest updates for specified price feed IDs with parsed, human-readable data.
get_price_updates_at_time
Retrieve historical price updates at or after a given timestamp for analysis or backtesting.
get_publisher_stake_caps
Obtain the most recent publisher stake caps data to understand data provider limits.
get_twap_latest
Compute the Time-Weighted Average Price for a set of feeds over a specified window.