Repository navigation
fix(mcp): link the live API key page and fix client setup in the README #4061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+217
−160
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ebd4c02
fix(mcp): link the live API key page and fix client setup in the README
aditya520 a8e3e4b
chore(mcp): bump version to 0.3.1
aditya520 e53d0b3
docs(mcp): bring PLAN.md in line with client-configured keys
aditya520 8612e07
docs(mcp): update PLAN.md tool reference and package details
aditya520 58a152e
docs(mcp): say which price tools return missing_feed_ids
aditya520 b6f2fab
docs(mcp): correct the Cursor, Claude Desktop and VS Code setup
aditya520 f3b4014
docs(mcp): add --scope user to the Claude Code setup command
aditya520 c66ae69
docs(mcp): give Team and Enterprise their own connector path
aditya520 8a4a454
docs(mcp): default the Claude Code setup to local scope
aditya520 ad8b991
chore(greenlight): auto-approve the MCP server app
aditya520 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,47 +6,73 @@ 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](#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 | ||
|
|
||
| Add to your `claude_desktop_config.json`: | ||
| 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`](https://www.npmjs.com/package/mcp-remote) (needs Node.js) in `claude_desktop_config.json` (Claude menu bar → **Settings… → Developer → Edit Config**): | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "pyth": { | ||
| "url": "https://mcp.pyth.network/mcp" | ||
| "command": "npx", | ||
| "args": ["-y", "mcp-remote@0.14.3", "https://mcp.pyth.network/mcp", "--header", "Authorization:${PYTH_AUTH_HEADER}"], | ||
| "env": { "PYTH_AUTH_HEADER": "Bearer YOUR_TOKEN" } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Claude Code | ||
| `mcp-remote` is a community package, not maintained by Pyth, and it handles your key; the snippet pins the version we tested. | ||
|
|
||
| ```sh | ||
| claude mcp add pyth --transport http https://mcp.pyth.network/mcp | ||
| ``` | ||
| 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](https://claude.com/docs/connectors/custom/add-unlisted#authenticate-with-request-headers), 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` in your project: | ||
| Add to `~/.cursor/mcp.json` (global, so the key stays out of your repo): | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "pyth": { | ||
| "url": "https://mcp.pyth.network/mcp" | ||
| "url": "https://mcp.pyth.network/mcp", | ||
| "headers": { "Authorization": "Bearer YOUR_TOKEN" } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Windsurf / Other Clients | ||
| 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. | ||
|
|
||
| Any MCP client that supports StreamableHTTP can connect using the URL: | ||
| ### 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" }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "tools": ["*"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| https://mcp.pyth.network/mcp | ||
| ``` | ||
|
|
||
| ### Other Clients | ||
|
|
||
| Any MCP client that supports Streamable HTTP: connect to `https://mcp.pyth.network/mcp` with the header `Authorization: Bearer YOUR_TOKEN`. | ||
|
|
||
| ## Tools | ||
|
|
||
|
|
@@ -65,13 +91,11 @@ https://mcp.pyth.network/mcp | |
|
|
||
| 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 at [pyth.network/pricing](https://pyth.network/pricing) | ||
| - Get a token: [Acquire an API key](https://docs.pyth.network/price-feeds/pro/acquire-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, so your assistant does not handle it on every call. | ||
| - Claude Code: `claude mcp add pyth --transport http https://mcp.pyth.network/mcp --header "Authorization: Bearer YOUR_TOKEN"` | ||
| - Cursor / VS Code / Windsurf: add `"headers": { "Authorization": "Bearer YOUR_TOKEN" }` next to `"url"` in the server entry. | ||
| - **Configure it once for the hosted server**: send it as an `Authorization: Bearer` header from your MCP client (see [Quick Start](#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](#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) use this. | ||
| - **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`. | ||
|
|
@@ -134,6 +158,6 @@ To connect a client to a local build via stdio: | |
| ## Links | ||
|
|
||
| - [Pyth Pro Documentation](https://docs.pyth.network/price-feeds/pro) | ||
| - [Get an Access Token](https://docs.pyth.network/price-feeds/pro/acquire-access-token) | ||
| - [Get an API Key](https://docs.pyth.network/price-feeds/pro/acquire-api-key) | ||
| - [Pricing](https://pyth.network/pricing) | ||
| - [GitHub Repository](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/mcp) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Auto-approval covers MCP runtime changes
The
apps/mcp/**entry also covers future changes to server code and configuration. Confirm that both belong in the self-authorized merge category.Was this helpful? React with 👍 or 👎 to provide feedback.