nftdata-mcp 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +242 -51
  2. package/dist/server.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,51 +1,252 @@
1
- # nftdata-mcp
1
+ # NFT Data MCP
2
2
 
3
- An MCP server that exposes the [NFT Data](https://www.nftdata.app/) API to AI clients (Claude Desktop, Cursor, etc.) as a single tool. It handles the x402 payment flow automatically.
3
+ A multichain NFT data MCP server that gives AI assistants, agents, and other MCP-compatible clients access to the [NFT Data API](https://www.nftdata.app/) through a single tool: `get_collection_data`.
4
4
 
5
- - **npm:** https://www.npmjs.com/package/nftdata-mcp
6
- - **MCP Registry:** https://registry.modelcontextprotocol.io/?q=nftdata
7
- - **NFT Data GitHub Repository:** https://github.com/Nomad07/nft-data
8
-
9
- ## Tool
5
+ Compatible with Claude Desktop and other MCP-compatible applications, AI agents, and clients, including future clients that support the Model Context Protocol (MCP).
10
6
 
11
- ### `get_collection_data`
7
+ Each API request is paid automatically at **$0.002 in USDC on Base** using the [x402 payment protocol](https://docs.x402.org/).
12
8
 
13
- Returns OpenSea collection market data in one call.
9
+ Retrieve NFT collection data across 30+ blockchain networks through the NFT Data API's OpenSea integration, including Ethereum, Base, Ink, Arc, HyperEVM, Robinhood Chain, Solana, and more.
14
10
 
15
- | Parameter | Type | Description |
16
- |--------------|--------|-----------------------------------------------------------------------------|
17
- | `collection` | string | OpenSea collection slug, from `opensea.io/collection/<slug>` (e.g. `azuki`) |
11
+ - **npm:** https://www.npmjs.com/package/nftdata-mcp
12
+ - **MCP Registry:** https://registry.modelcontextprotocol.io/?q=nftdata
13
+ - **NFT Data GitHub:** https://github.com/Nomad07/nft-data
18
14
 
19
- Returned fields: `name`, `slug`, `contracts`, `floor_price`, `floor_price_currency`, `one_day_sales`, `one_day_volume`, `seven_day_sales`, `seven_day_volume`, `thirty_day_sales`, `thirty_day_volume`, `total_sales`, `total_volume`, `num_owners`, `total_supply`, `created_date`. Volume and price currencies are given in the matching `*_currency` fields (ETH, USDC, HYPE, ...).
15
+ ---
20
16
 
21
- Each call costs **$0.002** (USDC on Base, paid via x402).
17
+ ## Prerequisites
22
18
 
23
- ## Requirements
19
+ - **Node.js 20 or newer** (required by the x402 SDK)
20
+ - **A dedicated wallet** funded with a small amount of USDC on Base mainnet
24
21
 
25
- - Node.js 20+
26
- - A wallet private key funded with a small amount of USDC on Base
22
+ > Always use a dedicated wallet with only a small balance. Never use your primary wallet or share its private key.
27
23
 
28
- > Use a dedicated wallet with only a small balance. Never use your main wallet.
24
+ ---
29
25
 
30
- ## Quick start (npx)
26
+ ## Claude Desktop setup
31
27
 
32
- Add to `claude_desktop_config.json`:
28
+ Add the following block to `claude_desktop_config.json` (usually found in `~/Library/Application Support/Claude/` on macOS or `%APPDATA%\Claude\` on Windows):
33
29
 
34
30
  ```json
35
31
  {
36
32
  "mcpServers": {
37
33
  "nftdata": {
38
34
  "command": "npx",
39
- "args": ["-y", "nftdata-mcp"],
35
+ "args": ["-y", "nftdata-mcp@1.0.2"],
40
36
  "env": {
41
- "EVM_PRIVATE_KEY": "0x..."
37
+ "EVM_PRIVATE_KEY": "YOUR_EVM_PRIVATE_KEY"
42
38
  }
43
39
  }
44
40
  }
45
41
  }
46
42
  ```
47
43
 
48
- Restart Claude Desktop, then ask for example: "What is the floor price and 7-day volume of azuki?"
44
+ Replace `YOUR_EVM_PRIVATE_KEY` with the private key of your dedicated wallet (`0x` followed by 64 hex characters). Then restart Claude Desktop.
45
+
46
+ The server communicates over **stdio** and is launched automatically by Claude Desktop. Running it by hand shows no output; it waits for an MCP client to connect.
47
+
48
+ ---
49
+
50
+ ## First query
51
+
52
+ After restarting Claude Desktop:
53
+
54
+ 1. Open a new conversation.
55
+ 2. To make sure Claude selects the right server when you have multiple MCP servers configured, start with an explicit request:
56
+
57
+ > Use the NFT Data MCP server to look up an NFT collection.
58
+
59
+ 3. When Claude asks for a collection slug, enter:
60
+
61
+ > Azuki
62
+
63
+ 4. Continue with natural follow-up questions. If Claude does not use the NFT Data server, ask it explicitly to do so.
64
+
65
+ You can also ask directly by collection name or OpenSea slug. Claude will retrieve the latest collection statistics, including floor price, sales volume, owner count, supply, and lifetime metrics. Each successful request includes a payment transaction hash and a BaseScan verification link.
66
+
67
+ ---
68
+
69
+ ## Example: Azuki collection report
70
+
71
+ The following is an example response from one query. Market data changes continuously; these values are from a specific query and are not current live data.
72
+
73
+ **Collection overview**
74
+
75
+ | Field | Value |
76
+ |---|---|
77
+ | Name | Azuki |
78
+ | Slug | `azuki` |
79
+ | Chain | Ethereum |
80
+ | Contract | `0xed5af388653567af2f388e6224dc7c4b3241c544` |
81
+ | Created | January 12, 2022 |
82
+ | Total supply | 10,000 |
83
+ | Unique owners | 4,394 |
84
+ | Floor price | 0.4933 ETH |
85
+
86
+ **Market activity**
87
+
88
+ | Period | Sales | Volume |
89
+ |---|---|---|
90
+ | 24 hours | 21 | 10.15 ETH |
91
+ | 7 days | 163 | 96.68 ETH |
92
+ | 30 days | 471 | 325.72 ETH |
93
+ | Lifetime | 93,156 | 831,992.65 ETH |
94
+
95
+ **Payment**
96
+
97
+ | Field | Value |
98
+ |---|---|
99
+ | Cost | $0.002 |
100
+ | Protocol | x402 |
101
+ | Transaction | [`0x4fb3...580f8`](https://basescan.org/tx/0x4fb35acc31a9f6841647ca2533a7f9ac7113f54364e979b8de4786bf1de580f8) |
102
+
103
+ ---
104
+
105
+ ## Customize your results
106
+
107
+ The server supplies the underlying collection data returned by the API. Claude can organize that information in the format you prefer, from a concise summary to a detailed report, tables, or comparisons. Simply ask Claude how you want the results presented. This changes the presentation, not the source values.
108
+
109
+ ---
110
+
111
+ ## Raw request and response
112
+
113
+ Claude Desktop may show the tool request and returned data through its tool-activity details (the exact label varies by client version).
114
+
115
+ **Tool request**
116
+
117
+ ```json
118
+ { "collection": "azuki" }
119
+ ```
120
+
121
+ <details>
122
+ <summary>Full raw response</summary>
123
+
124
+ ```json
125
+ {
126
+ "name": "Azuki",
127
+ "slug": "azuki",
128
+ "contracts": [
129
+ {
130
+ "address": "0xed5af388653567af2f388e6224dc7c4b3241c544",
131
+ "chain": "ethereum"
132
+ }
133
+ ],
134
+ "floor_price": 0.49328599,
135
+ "floor_price_currency": "ETH",
136
+ "one_day_sales": 21,
137
+ "one_day_volume": 10.150091000000002,
138
+ "seven_day_sales": 163,
139
+ "seven_day_volume": 96.67526161112121,
140
+ "thirty_day_sales": 471,
141
+ "thirty_day_volume": 325.72023569476767,
142
+ "total_sales": 93156,
143
+ "total_volume": 831992.6461159982,
144
+ "num_owners": 4394,
145
+ "total_supply": 10000,
146
+ "created_date": "2022-01-12",
147
+ "one_day_volume_currency": "ETH",
148
+ "seven_day_volume_currency": "ETH",
149
+ "thirty_day_volume_currency": "ETH",
150
+ "total_volume_currency": "ETH"
151
+ }
152
+ ```
153
+
154
+ Raw floating-point values have more decimal places than the rounded values in the report above.
155
+
156
+ </details>
157
+
158
+ **Payment verification**
159
+
160
+ Transaction hash: `0x4fb35acc31a9f6841647ca2533a7f9ac7113f54364e979b8de4786bf1de580f8`
161
+
162
+ Verify on BaseScan: https://basescan.org/tx/0x4fb35acc31a9f6841647ca2533a7f9ac7113f54364e979b8de4786bf1de580f8
163
+
164
+ ---
165
+
166
+ ## Data networks vs. payment network
167
+
168
+ ### Payment Protocols and Supported Networks
169
+
170
+ | Product | Payment Protocols | Payment Networks |
171
+ |---|---|---|
172
+ | NFT Data (website/API) | x402 and MPP | x402 - Base and Solana; MPP - Base |
173
+ | NFT Data (MCP server) | x402 | Base |
174
+
175
+ > **Note:** The NFT Data website/API and the NFT Data MCP server have different payment capabilities. The MCP server currently supports x402 payments on Base only; MPP support is not implemented in this package.
176
+
177
+ **Data network** refers to the blockchain where an NFT collection exists. NFT Data is a multichain service supporting NFT collections across **30+ blockchain networks** through the NFT Data API's OpenSea integration, including Ethereum, Base, Ink, Arc, HyperEVM, Robinhood Chain, and Solana, among others. OpenSea continues to expand its supported blockchain networks, so coverage may grow over time. The data network is independent of the payment network used to pay for API requests.
178
+
179
+ **Payment network** refers to the blockchain used to pay for each API request. This server pays on **Base mainnet only**, using USDC via x402, regardless of which chain the queried collection is on.
180
+
181
+ ---
182
+
183
+ ## x402 and payment verification
184
+
185
+ Each request is paid automatically using the [x402 protocol](https://docs.x402.org/) over Base mainnet. The payment flow:
186
+
187
+ 1. The server sends the API request.
188
+ 2. The API responds with HTTP 402 and a payment challenge.
189
+ 3. Before signing, the server validates the challenge:
190
+ - Scheme: `exact`
191
+ - Network: Base mainnet (`eip155:8453`)
192
+ - Token: USDC on Base (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
193
+ - Amount: exactly 2000 atomic units ($0.002)
194
+ - Recipient: `0x344143199642e87320785823c20c2df107d17534`
195
+ 4. If everything matches, the wallet signs and submits the payment.
196
+ 5. The API fulfills the request and returns the collection data along with the on-chain transaction hash.
197
+
198
+ Every successful response includes:
199
+
200
+ ```
201
+ Payment: 0x...
202
+ Verify: https://basescan.org/tx/0x...
203
+ ```
204
+
205
+ This server supports **x402 on Base only**. Solana and MPP payment methods are not implemented.
206
+
207
+ ---
208
+
209
+ ## Configuration
210
+
211
+ | Variable | Required | Default | Description |
212
+ |---|---|---|---|
213
+ | `EVM_PRIVATE_KEY` | yes | - | Private key (`0x` + 64 hex chars) of the wallet that pays for calls |
214
+ | `NFTDATA_MAX_REQUESTS` | no | `100` | Max signed payments per session. Integer 1–1000; any other value stops startup with an error |
215
+ | `NFTDATA_TIMEOUT_MS` | no | `15000` | Request timeout in milliseconds (1000–60000) |
216
+ | `NFTDATA_URL` | no | `https://www.nftdata.app/api/get-collection-data` | Accepts only the official NFT Data endpoint; anything else stops startup |
217
+
218
+ ---
219
+
220
+ ## Behavior
221
+
222
+ - Sends `POST /api/get-collection-data` with body `{"collection": "<slug>"}`.
223
+ - The slug is trimmed and lowercased, then must match `^[a-z0-9][a-z0-9_-]*$` (max 100 characters); otherwise no request is made.
224
+ - Each signed payment counts against `NFTDATA_MAX_REQUESTS`, including payments for requests that later fail or time out.
225
+ - No automatic retries: one tool call makes at most one payment attempt.
226
+ - Successful responses are cached for 5 minutes per slug. Concurrent identical calls share a single in-flight request.
227
+ - Cache hits do not include a payment transaction hash (no new payment was made).
228
+ - Returns generic errors for `400` (invalid slug), `404` (collection not found), `429` (rate limit, with retry delay), timeouts, and other failures. Server and payment details are not exposed to the MCP client.
229
+
230
+ ---
231
+
232
+ ## Troubleshooting
233
+
234
+ **Server does not appear in Claude Desktop**
235
+ Verify the `claude_desktop_config.json` path, check for JSON syntax errors, and restart Claude Desktop fully.
236
+
237
+ **`EVM_PRIVATE_KEY is missing or malformed`**
238
+ The key must be `0x` followed by exactly 64 hex characters. Check for extra whitespace or a missing `0x` prefix.
239
+
240
+ **`paid request limit ... reached`**
241
+ The session has reached `NFTDATA_MAX_REQUESTS`. Restart Claude Desktop to reset the counter, or set a higher limit.
242
+
243
+ **Request timed out**
244
+ A payment may have been signed before the timeout. The server does not retry automatically.
245
+
246
+ **Imports fail after an SDK update**
247
+ The x402 SDK changes frequently. Check the [x402 docs](https://docs.x402.org/) and the [nftdata-mcp changelog](https://github.com/Nomad07/nftdata-mcp/releases) for the latest compatible version.
248
+
249
+ ---
49
250
 
50
251
  ## Run from source
51
252
 
@@ -73,44 +274,34 @@ set EVM_PRIVATE_KEY=0x...
73
274
  npm start
74
275
  ```
75
276
 
76
- The server waits for an MCP client on stdin, so running it by hand just shows no output; it is meant to be launched by an MCP client.
277
+ To use a local checkout with Claude Desktop, set `"command": "npx"` and `"args": ["tsx", "/absolute/path/to/nftdata-mcp/server.ts"]`.
77
278
 
78
- To use a local checkout with Claude Desktop, point `args` to `["tsx", "/absolute/path/to/nftdata-mcp/server.ts"]` with `"command": "npx"`.
279
+ ---
79
280
 
80
- ## Build
281
+ ## Build and test
81
282
 
82
283
  ```bash
83
- npm run build # compiles server.ts and lib.ts to dist/
284
+ npm run build # compiles to dist/
84
285
  npm test # offline unit tests, no network and no payments
85
286
  ```
86
287
 
87
- ## Configuration
288
+ ---
88
289
 
89
- | Variable | Required | Default | Description |
90
- |------------------------|----------|---------|-------------|
91
- | `EVM_PRIVATE_KEY` | yes | – | Private key (`0x` + 64 hex chars) of the wallet that pays for calls |
92
- | `NFTDATA_MAX_REQUESTS` | no | `100` | Max signed payments per session. Integer 1–1000; any other value stops startup with an error |
93
- | `NFTDATA_TIMEOUT_MS` | no | `15000` | Request timeout in milliseconds (1000–60000) |
94
- | `NFTDATA_URL` | no | `https://www.nftdata.app/api/get-collection-data` | Accepts only the official NFT Data endpoint (`www.nftdata.app` or `nftdata.app`); anything else stops startup |
290
+ ## Links
95
291
 
96
- ## Behavior
292
+ - [NFT Data website](https://www.nftdata.app/)
293
+ - [NFT Data API docs](https://www.nftdata.app/docs)
294
+ - [NFT Data OpenAPI spec](https://www.nftdata.app/openapi.json)
295
+ - [x402 protocol docs](https://docs.x402.org/)
296
+ - [BaseScan](https://basescan.org/)
297
+ - [nftdata-mcp on npm](https://www.npmjs.com/package/nftdata-mcp)
298
+ - [nftdata-mcp in the MCP Registry](https://registry.modelcontextprotocol.io/?q=nftdata)
97
299
 
98
- - Sends `POST /api/get-collection-data` with body `{"collection": "<slug>"}`.
99
- - The slug is trimmed and lowercased, then must match `^[a-z0-9][a-z0-9_-]*$` (max 100 characters); otherwise no request is made.
100
- - Only Base mainnet (`eip155:8453`) is registered with the x402 client. Before signing, every payment challenge is checked: scheme `exact`, network Base mainnet, token USDC on Base, amount exactly 2000 atomic units ($0.002), and recipient (must be `0x344143199642e87320785823c20c2df107d17534`). Anything else is refused without signing.
101
- - Each signed payment counts against `NFTDATA_MAX_REQUESTS`, including payments for requests that later fail or time out.
102
- - No automatic retries: one tool call makes at most one payment attempt.
103
- - Caches successful responses for 5 minutes per slug. Concurrent identical calls share a single in-flight request.
104
- - Returns generic errors for `400` (invalid slug), `404` (collection not found), `429` (rate limit, with `Retry-After`), timeouts and other failures; server and payment details are not passed to the MCP client.
300
+ ---
105
301
 
106
302
  ## Limitations
107
303
 
108
- - Only x402 on Base is supported. Solana and MPP payment methods are not implemented in this wrapper.
109
- - The expected recipient address is hardcoded in `lib.ts`. If the NFT Data payout address ever changes, update `OFFICIAL_PAY_TO` and release a new version.
110
- - The payment hook (`server.ts`) depends on the installed `@x402/*` SDK and is not covered by the offline tests.
111
- - The x402 client libraries change quickly; if imports fail, check the current [x402 docs](https://docs.x402.org/).
112
-
113
- ## API reference
114
-
115
- - OpenAPI: https://www.nftdata.app/openapi.json
116
- - Docs: https://www.nftdata.app/docs
304
+ - Only x402 on Base mainnet is supported for payments. Solana and MPP are not implemented.
305
+ - The expected recipient address is hardcoded. If the NFT Data payout address changes, update `OFFICIAL_PAY_TO` in `lib.ts` and release a new version.
306
+ - The payment hook depends on the installed `@x402/*` SDK and is not covered by the offline unit tests.
307
+ - The x402 SDK changes quickly. If imports fail, check the [x402 docs](https://docs.x402.org/).
package/dist/server.js CHANGED
@@ -103,7 +103,7 @@ async function load(slug) {
103
103
  }
104
104
  }
105
105
  const fetcher = new CachedFetcher(load);
106
- const server = new McpServer({ name: "nftdata", version: "1.0.0" });
106
+ const server = new McpServer({ name: "nftdata", version: "1.0.2" });
107
107
  server.tool("get_collection_data", "Get OpenSea NFT collection market data in one call: name, contracts, floor price, " +
108
108
  "1/7/30-day and lifetime sales and volume, unique owners, total supply, creation date. " +
109
109
  "Costs $0.002 per call (x402). " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nftdata-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for the NFT Data API: OpenSea collection market data, paid per call via x402",
5
5
  "mcpName": "io.github.Nomad07/nftdata-mcp",
6
6
  "type": "module",