@covalenthq/goldrush-mcp-server 0.0.2 → 0.0.3
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.
- package/LICENSE +20 -20
- package/README.md +86 -47
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/dynamicResources.d.ts.map +1 -1
- package/dist/resources/dynamicResources.js +11 -4
- package/dist/resources/dynamicResources.js.map +1 -1
- package/dist/resources/staticResources.d.ts.map +1 -1
- package/dist/resources/staticResources.js +12 -4
- package/dist/resources/staticResources.js.map +1 -1
- package/dist/server.d.ts +11 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +211 -13
- package/dist/server.js.map +1 -1
- package/dist/services/AllChainsService.d.ts.map +1 -1
- package/dist/services/AllChainsService.js +59 -16
- package/dist/services/AllChainsService.js.map +1 -1
- package/dist/services/BalanceService.d.ts.map +1 -1
- package/dist/services/BalanceService.js +141 -38
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts.map +1 -1
- package/dist/services/BaseService.js +85 -23
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/BitcoinService.d.ts.map +1 -1
- package/dist/services/BitcoinService.js +23 -7
- package/dist/services/BitcoinService.js.map +1 -1
- package/dist/services/NftService.d.ts.map +1 -1
- package/dist/services/NftService.js +38 -10
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts.map +1 -1
- package/dist/services/PricingService.js +27 -9
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts.map +1 -1
- package/dist/services/SecurityService.js +6 -2
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts.map +1 -1
- package/dist/services/TransactionService.js +72 -22
- package/dist/services/TransactionService.js.map +1 -1
- package/package.json +18 -14
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Covalent
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Covalent
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -57,6 +57,8 @@ Model Context Protocol (MCP) is a message protocol for connecting context or too
|
|
|
57
57
|
|
|
58
58
|
- Call Covalent GoldRush API endpoints as MCP Tools
|
|
59
59
|
- Read from MCP Resources that give chain info, quote currencies, chain statuses, etc.
|
|
60
|
+
- **Flexible Transport Support**: Unified server supporting both STDIO and HTTP transports
|
|
61
|
+
- **Command-line Interface**: Easy configuration via CLI arguments
|
|
60
62
|
- Fully testable with [Vitest](https://vitest.dev/) for testing each group of tools.
|
|
61
63
|
- Modular architecture where each service is implemented as a separate module, making the codebase easier to maintain and extend.
|
|
62
64
|
|
|
@@ -144,38 +146,41 @@ Add this to your `~/.codeium/windsurf/mcp_config.json` file:
|
|
|
144
146
|
|
|
145
147
|
### Programmatic Usage
|
|
146
148
|
|
|
147
|
-
The server
|
|
149
|
+
The server supports both STDIO and HTTP transports for different integration scenarios:
|
|
150
|
+
|
|
151
|
+
#### STDIO Transport (Recommended for MCP Clients)
|
|
148
152
|
|
|
149
153
|
```typescript
|
|
150
154
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
151
155
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
152
156
|
|
|
153
157
|
const transport = new StdioClientTransport({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
command: "npx",
|
|
159
|
+
args: ["-y", "@covalenthq/goldrush-mcp-server@latest"],
|
|
160
|
+
env: { GOLDRUSH_API_KEY: "your_api_key_here" },
|
|
157
161
|
});
|
|
158
162
|
|
|
159
163
|
const client = new Client(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
{
|
|
165
|
+
name: "example-client",
|
|
166
|
+
version: "1.0.0",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
capabilities: {
|
|
170
|
+
tools: {},
|
|
171
|
+
},
|
|
167
172
|
}
|
|
168
|
-
}
|
|
169
173
|
);
|
|
170
174
|
|
|
171
175
|
await client.connect(transport);
|
|
172
176
|
|
|
173
|
-
// List tools
|
|
174
|
-
const resources = await client.listTools();
|
|
177
|
+
// List tools and call them
|
|
175
178
|
const tools = await client.listTools();
|
|
176
|
-
console.log(
|
|
179
|
+
console.log(
|
|
180
|
+
"Available tools:",
|
|
181
|
+
tools.tools.map((tool) => tool.name).join(", ")
|
|
182
|
+
);
|
|
177
183
|
|
|
178
|
-
// Now you can call tools
|
|
179
184
|
const result = await client.callTool({
|
|
180
185
|
name: "token_balances",
|
|
181
186
|
arguments: {
|
|
@@ -186,7 +191,42 @@ const result = await client.callTool({
|
|
|
186
191
|
},
|
|
187
192
|
});
|
|
188
193
|
console.log("Token balances:", result.content);
|
|
189
|
-
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### HTTP Transport (For Web Integrations)
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Start the HTTP server
|
|
200
|
+
node dist/index.js --transport http --port 3000
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Then make HTTP requests:
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
const response = await fetch("http://localhost:3000/mcp", {
|
|
207
|
+
method: "POST",
|
|
208
|
+
headers: {
|
|
209
|
+
"Content-Type": "application/json",
|
|
210
|
+
Authorization: "Bearer YOUR_GOLDRUSH_API_KEY",
|
|
211
|
+
},
|
|
212
|
+
body: JSON.stringify({
|
|
213
|
+
jsonrpc: "2.0",
|
|
214
|
+
id: 1,
|
|
215
|
+
method: "tools/call",
|
|
216
|
+
params: {
|
|
217
|
+
name: "token_balances",
|
|
218
|
+
arguments: {
|
|
219
|
+
chainName: "eth-mainnet",
|
|
220
|
+
address: "0xfC43f5F9dd45258b3AFf31Bdbe6561D97e8B71de",
|
|
221
|
+
quoteCurrency: "USD",
|
|
222
|
+
nft: false,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
}),
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
const result = await response.json();
|
|
229
|
+
console.log("Token balances:", result);
|
|
190
230
|
```
|
|
191
231
|
|
|
192
232
|
### Example LLM Flow
|
|
@@ -205,107 +245,81 @@ Tools are a powerful primitive in the Model Context Protocol (MCP) that enable s
|
|
|
205
245
|
Tools are designed to be model-controlled, meaning that tools are exposed from servers to clients with the intention of the AI model being able to automatically invoke them (with a human in the loop to grant approval).
|
|
206
246
|
|
|
207
247
|
1. `bitcoin_hd_wallet_balances`
|
|
208
|
-
|
|
209
248
|
- Fetch balances for each active child address derived from a Bitcoin HD wallet. This tool provides detailed balance data for Bitcoin wallets identified by an xpub key. Required: walletAddress - The xpub key of the HD wallet. Optional: quoteCurrency - The currency for price conversion (USD, EUR, etc). Returns complete balance details including total balance, available balance, and transaction history summary.
|
|
210
249
|
|
|
211
250
|
2. `bitcoin_non_hd_wallet_balances`
|
|
212
|
-
|
|
213
251
|
- Fetch Bitcoin balance for a non-HD address. Response includes spot prices and other metadata. This tool provides detailed balance data for regular Bitcoin addresses. Required: walletAddress - The Bitcoin address to query. Optional: quoteCurrency - The currency for price conversion (USD, EUR, etc). Returns complete balance details including total balance, available balance, and transaction count.
|
|
214
252
|
|
|
215
253
|
3. `bitcoin_transactions`
|
|
216
|
-
|
|
217
254
|
- Fetch transactions for a specific Bitcoin address with full transaction details. Required: address - The Bitcoin address to query. Optional: pageSize - Number of results per page (default 100), pageNumber - Page number (default 0). Returns a paginated list of transactions with timestamps, amounts, inputs, outputs, and fees.
|
|
218
255
|
|
|
219
256
|
4. `block`
|
|
220
|
-
|
|
221
257
|
- Commonly used to fetch and render a single block for a block explorer. Requires chainName (blockchain network) and blockHeight (block number). Returns comprehensive block data including timestamp, transaction count, size, miner information, and other blockchain-specific details.
|
|
222
258
|
|
|
223
259
|
5. `block_heights`
|
|
224
|
-
|
|
225
260
|
- Commonly used to get all the block heights within a particular date range. Requires chainName (blockchain network), startDate (YYYY-MM-DD format), and endDate (YYYY-MM-DD or 'latest'). Optional pagination parameters include pageSize (default 10) and pageNumber (default 0). Returns block heights, timestamps, and related data for blocks within the specified date range, useful for historical analysis and time-based blockchain queries.
|
|
226
261
|
|
|
227
262
|
6. `erc20_token_transfers`
|
|
228
|
-
|
|
229
263
|
- Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address. Required: chainName (blockchain network), walletAddress (wallet address). Optional: quoteCurrency for value conversion, contractAddress to filter by specific token, startingBlock/endingBlock to set range, pageSize (default 10) and pageNumber (default 0). Returns token transfer events with timestamps, values, and transaction details.
|
|
230
264
|
|
|
231
265
|
7. `gas_prices`
|
|
232
|
-
|
|
233
266
|
- Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times. Requires chainName (blockchain network) and eventType (erc20, nativetokens, or uniswapv3). Optional parameter quoteCurrency allows conversion to different currencies (USD, EUR, etc). Returns estimated gas prices for low, medium, and high priority transactions for the specified event type.
|
|
234
267
|
|
|
235
268
|
8. `historical_portfolio_value`
|
|
236
|
-
|
|
237
269
|
- Commonly used to render a daily portfolio balance for an address broken down by the token. Required: chainName (blockchain network), walletAddress (wallet address). Optional: quoteCurrency for value conversion, days (timeframe to analyze, default 7). Returns portfolio value time series data showing value changes over the specified timeframe.
|
|
238
270
|
|
|
239
271
|
9. `historical_token_balances`
|
|
240
|
-
|
|
241
272
|
- Commonly used to fetch the historical native and fungible (ERC20) tokens held by an address at a given block height or date. Required: chainName (blockchain network), address (wallet address). Optional: quoteCurrency for value conversion, blockHeight or date to specify point in time, nft (include NFTs, default false), noNftFetch, noSpam, and noNftAssetMetadata (all default true). Returns token balances as they existed at the specified historical point.
|
|
242
273
|
|
|
243
274
|
10. `historical_token_prices`
|
|
244
|
-
|
|
245
275
|
- Commonly used to get historic prices of a token between date ranges. Supports native tokens. Required: chainName (blockchain network), quoteCurrency (price currency), contractAddress (token contract), from (start date YYYY-MM-DD), to (end date YYYY-MM-DD). Optional: pricesAtAsc (set to true for chronological ascending order, default is false for descending order). Returns historical token prices for the specified time range.
|
|
246
276
|
|
|
247
277
|
11. `log_events_by_address`
|
|
248
|
-
|
|
249
278
|
- Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions. Requires chainName (blockchain network) and contractAddress (the address emitting events). Optional parameters include block range (startingBlock, endingBlock) and pagination settings (pageSize default 10, pageNumber default 0). Returns decoded event logs for the specified contract, useful for monitoring specific smart contract activity and analyzing on-chain events.
|
|
250
279
|
|
|
251
280
|
12. `log_events_by_topic`
|
|
252
|
-
|
|
253
281
|
- Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain. Requires chainName (blockchain network) and topicHash (the event signature hash). Optional parameters include block range (startingBlock, endingBlock), secondaryTopics for filtering by additional parameters, and pagination settings (pageSize default 10, pageNumber default 0). Returns decoded event logs matching the specified topic hash, ideal for tracking specific event types across multiple contracts on a blockchain.
|
|
254
282
|
|
|
255
283
|
13. `multichain_address_activity`
|
|
256
|
-
|
|
257
284
|
- Gets a summary of wallet activity across all supported blockchains. Requires walletAddress. Optional parameter testnets (default false) determines whether to include testnet activity. Returns a comprehensive summary of chain activity including transaction counts, first/last activity timestamps, and activity status across all networks.
|
|
258
285
|
|
|
259
286
|
14. `multichain_balances`
|
|
260
|
-
|
|
261
287
|
- Gets token balances for a wallet address across multiple blockchains. Requires walletAddress. Optional parameters include chains array to specify networks, quoteCurrency for value conversion, limit (default 10), pagination (before), and cutoffTimestamp to filter by time. Use this to get a comprehensive view of token holdings across different blockchains.
|
|
262
288
|
|
|
263
289
|
15. `multichain_transactions`
|
|
264
|
-
|
|
265
290
|
- Gets transactions for multiple wallet addresses across multiple blockchains. Requires addresses array. Optional parameters include chains array, pagination (before/after), limit (default 10), quoteCurrency for value conversion, and options to include logs (withLogs, withDecodedLogs). Use this to analyze transaction history across different networks simultaneously.
|
|
266
291
|
|
|
267
292
|
16. `native_token_balance`
|
|
268
|
-
|
|
269
293
|
- Get the native token balance (ETH, BNB, MATIC, etc.) for a specified wallet address on a blockchain. Required: chainName (blockchain network) and walletAddress. Optional: quoteCurrency for value conversion and blockHeight for historical queries. Returns detailed balance information including formatted amounts and USD values.
|
|
270
294
|
|
|
271
295
|
17. `nft_check_ownership`
|
|
272
|
-
|
|
273
296
|
- Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection. Required: chainName (blockchain network), walletAddress (wallet address), collectionContract (NFT collection). Optional: traitsFilter (filter by trait types), valuesFilter (filter by trait values). Returns ownership status and matching NFTs if owned.
|
|
274
297
|
|
|
275
298
|
18. `nft_for_address`
|
|
276
|
-
|
|
277
299
|
- Commonly used to get all NFTs owned by a specific wallet address on a blockchain. Useful for NFT portfolio viewers. Required: chainName (blockchain network), walletAddress (wallet address). Optional: noSpam (exclude spam NFTs, default true), noNftAssetMetadata (exclude detailed metadata, default false), withUncached (include uncached items, default false). Returns a comprehensive list of all NFTs owned by the specified wallet.
|
|
278
300
|
|
|
279
301
|
19. `pool_spot_prices`
|
|
280
|
-
|
|
281
302
|
- Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks. Required: chainName (blockchain network), contractAddress (pool contract address). Optional: quoteCurrency (price currency) for value conversion. Returns spot token pair prices with pool details and token metadata.
|
|
282
303
|
|
|
283
304
|
20. `token_approvals`
|
|
284
|
-
|
|
285
305
|
- Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet's assets. Required: chainName (blockchain network, e.g. eth-mainnet or 1), walletAddress (wallet address, supports ENS, RNS, Lens Handle, or Unstoppable Domain). Returns a list of ERC20 token approvals and their associated security risk levels.
|
|
286
306
|
|
|
287
307
|
21. `token_balances`
|
|
288
|
-
|
|
289
308
|
- Commonly used to fetch the native and fungible (ERC20) tokens held by an address. Required: chainName (blockchain network), address (wallet address). Optional: quoteCurrency for value conversion, nft (include NFTs, default false), noNftFetch, noSpam, and noNftAssetMetadata (all default true) to control data returned. Returns detailed token balance information including spot prices and metadata.
|
|
290
309
|
|
|
291
310
|
22. `token_holders`
|
|
292
|
-
|
|
293
311
|
- Used to get a paginated list of current or historical token holders for a specified ERC20 or ERC721 token. Required: chainName (blockchain network), tokenAddress (token contract address). Optional: blockHeight or date for historical data, pageSize and pageNumber for pagination. Returns list of addresses holding the token with balance amounts and ownership percentages.
|
|
294
312
|
|
|
295
313
|
23. `transaction`
|
|
296
|
-
|
|
297
314
|
- Commonly used to fetch and render a single transaction including its decoded log events. Required: chainName (blockchain network), txHash (transaction hash). Optional: quoteCurrency (currency to convert to, USD by default), noLogs (exclude event logs, true by default), withInternal (include internal transactions, false by default), withState (include state changes, false by default), withInputData (include input data, false by default). Tracing features (withInternal, withState, withInputData) supported on the following chains: eth-mainnet. Returns comprehensive details about the specified transaction.
|
|
298
315
|
|
|
299
316
|
24. `transaction_summary`
|
|
300
|
-
|
|
301
317
|
- Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Required: chainName (blockchain network), walletAddress (wallet address). Optional: quoteCurrency, withGas (include gas usage statistics). Returns summary of transaction activity for the specified wallet.
|
|
302
318
|
|
|
303
319
|
25. `transactions_for_address`
|
|
304
|
-
|
|
305
320
|
- Commonly used to fetch and render the most recent transactions involving an address. Required: chainName (blockchain network), walletAddress (wallet address), page (page number). Optional: quoteCurrency, noLogs, blockSignedAtAsc (chronological order). Returns transactions for the specified page of results.
|
|
306
321
|
|
|
307
322
|
26. `transactions_for_block`
|
|
308
|
-
|
|
309
323
|
- Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions. Required: chainName (blockchain network), blockHeight (block number or latest). Optional: quoteCurrency, noLogs (exclude event logs). Returns all transactions from the specified block.
|
|
310
324
|
|
|
311
325
|
---
|
|
@@ -323,7 +337,6 @@ Resources are designed to be application-controlled, meaning that the client app
|
|
|
323
337
|
Resources exposed by the GoldRush MCP server are split into static and dynamic types:
|
|
324
338
|
|
|
325
339
|
- Static resources (`src/resources/staticResources.ts`):
|
|
326
|
-
|
|
327
340
|
- `config://supported-chains`
|
|
328
341
|
- `config://quote-currencies`
|
|
329
342
|
|
|
@@ -359,12 +372,36 @@ npm run build
|
|
|
359
372
|
|
|
360
373
|
### Running the MCP Server
|
|
361
374
|
|
|
375
|
+
The server supports multiple transport options:
|
|
376
|
+
|
|
362
377
|
```bash
|
|
363
|
-
# Start
|
|
378
|
+
# Start with default STDIO transport (recommended for MCP clients)
|
|
364
379
|
npm run start
|
|
380
|
+
|
|
381
|
+
# Or explicitly specify STDIO transport
|
|
382
|
+
npm run start:stdio
|
|
383
|
+
|
|
384
|
+
# Start with HTTP transport on port 3000
|
|
385
|
+
npm run start:http
|
|
386
|
+
|
|
387
|
+
# Custom configuration with CLI arguments
|
|
388
|
+
node dist/index.js --transport http --port 8080
|
|
389
|
+
node dist/index.js --transport stdio --api-key YOUR_KEY_HERE
|
|
365
390
|
```
|
|
366
391
|
|
|
367
|
-
|
|
392
|
+
#### Transport Options
|
|
393
|
+
|
|
394
|
+
- **STDIO (default)**: Direct MCP protocol communication via stdin/stdout - ideal for MCP clients like Claude Desktop
|
|
395
|
+
- **HTTP**: RESTful HTTP server with `/mcp` endpoint - useful for web integrations
|
|
396
|
+
|
|
397
|
+
#### Command Line Arguments
|
|
398
|
+
|
|
399
|
+
- `--transport`, `-t`: Choose transport type (`stdio` or `http`)
|
|
400
|
+
- `--port`, `-p`: Set HTTP port (default: 3000)
|
|
401
|
+
- `--api-key`, `-k`: Provide API key directly
|
|
402
|
+
- `--help`, `-h`: Show usage information
|
|
403
|
+
|
|
404
|
+
STDIO transport spawns the MCP server on stdin/stdout where MCP clients can connect directly. HTTP transport starts a server that accepts POST requests to `/mcp` with Bearer token authentication.
|
|
368
405
|
|
|
369
406
|
### Example Client
|
|
370
407
|
|
|
@@ -404,7 +441,9 @@ set GOLDRUSH_API_KEY=YOUR_KEY_HERE
|
|
|
404
441
|
```
|
|
405
442
|
goldrush-mcp-server
|
|
406
443
|
├── src
|
|
407
|
-
│ ├── index.ts # Main
|
|
444
|
+
│ ├── index.ts # Main entry point with CLI parsing
|
|
445
|
+
│ ├── server.ts # Unified server with STDIO and HTTP transports
|
|
446
|
+
│ ├── server-stdio.ts # Legacy STDIO-only server (backup)
|
|
408
447
|
│ ├── services/ # Modular service implementations
|
|
409
448
|
│ │ ├── AllChainsService.ts # Cross-chain service tools
|
|
410
449
|
│ │ ├── BalanceService.ts # Balance-related tools
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { createGoldRushClient, createServer, startServer };
|
|
2
|
+
import { parseArgsAndStart } from "./server.js";
|
|
3
|
+
parseArgsAndStart();
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,iBAAiB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicResources.d.ts","sourceRoot":"","sources":["../../src/resources/dynamicResources.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamicResources.d.ts","sourceRoot":"","sources":["../../src/resources/dynamicResources.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBzE,wBAAgB,+BAA+B,CAC3C,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QA4FjC"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { stringifyWithBigInt } from "../utils/helpers.js";
|
|
2
2
|
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
export function addRealTimeChainStatusResources(server, goldRushClient) {
|
|
4
|
-
server.
|
|
4
|
+
server.registerResource("all-chains-status", "status://all-chains", {
|
|
5
|
+
title: "All Chains Status",
|
|
6
|
+
description: "All chains status",
|
|
7
|
+
mimeType: "application/json",
|
|
8
|
+
}, async () => {
|
|
5
9
|
const response = await goldRushClient.BaseService.getAllChainStatus();
|
|
6
10
|
return {
|
|
7
11
|
contents: [
|
|
8
12
|
{
|
|
9
|
-
uri:
|
|
13
|
+
uri: "status://all-chains",
|
|
10
14
|
text: stringifyWithBigInt(response.data),
|
|
11
15
|
},
|
|
12
16
|
],
|
|
13
17
|
};
|
|
14
18
|
});
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
server.resource("chain-status", new ResourceTemplate("status://chain/{chainName}", { list: undefined }), {
|
|
20
|
+
title: "Chain Status",
|
|
21
|
+
description: "Chain status",
|
|
22
|
+
mimeType: "application/json",
|
|
23
|
+
}, async (uri, { chainName }) => {
|
|
17
24
|
const response = await goldRushClient.BaseService.getAllChainStatus();
|
|
18
25
|
const data = response.data;
|
|
19
26
|
if (!data || !data.items) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicResources.js","sourceRoot":"","sources":["../../src/resources/dynamicResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamicResources.js","sourceRoot":"","sources":["../../src/resources/dynamicResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAiB3E,MAAM,UAAU,+BAA+B,CAC3C,MAAiB,EACjB,cAA8B;IAG9B,MAAM,CAAC,gBAAgB,CACnB,mBAAmB,EACnB,qBAAqB,EACrB;QACI,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,mBAAmB;QAChC,QAAQ,EAAE,kBAAkB;KAC/B,EACD,KAAK,IAAiC,EAAE;QAEpC,MAAM,QAAQ,GACV,MAAM,cAAc,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;QACzD,OAAO;YACH,QAAQ,EAAE;gBACN;oBACI,GAAG,EAAE,qBAAqB;oBAC1B,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC;iBAC3C;aACJ;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;IAEF,MAAM,CAAC,QAAQ,CACX,cAAc,EACd,IAAI,gBAAgB,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACvE;QACI,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,cAAc;QAC3B,QAAQ,EAAE,kBAAkB;KAC/B,EACD,KAAK,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,EAA+B,EAAE;QAEtD,MAAM,QAAQ,GACV,MAAM,cAAc,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;QACzD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACvB,OAAO;gBACH,QAAQ,EAAE;oBACN;wBACI,GAAG,EAAE,GAAG,CAAC,IAAI;wBACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAChB,EAAE,KAAK,EAAE,8BAA8B,EAAE,EACzC,IAAI,EACJ,CAAC,CACJ;qBACJ;iBACJ;aACJ,CAAC;QACN,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAE/B,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE;YAItC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC;YAChB,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBAC5B,OAAO,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,OAAO;gBACH,QAAQ,EAAE;oBACN;wBACI,GAAG,EAAE,GAAG,CAAC,IAAI;wBACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAChB,EAAE,KAAK,EAAE,wBAAwB,SAAS,EAAE,EAAE,EAC9C,IAAI,EACJ,CAAC,CACJ;qBACJ;iBACJ;aACJ,CAAC;QACN,CAAC;QACD,OAAO;YACH,QAAQ,EAAE;gBACN;oBACI,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,IAAI,EAAE,mBAAmB,CAAC,WAAW,CAAC;iBACzC;aACJ;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticResources.d.ts","sourceRoot":"","sources":["../../src/resources/staticResources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"staticResources.d.ts","sourceRoot":"","sources":["../../src/resources/staticResources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QA8CnD"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { validQuoteValues } from "../utils/constants.js";
|
|
2
2
|
import { ChainName } from "@covalenthq/client-sdk";
|
|
3
3
|
export function addStaticResources(server) {
|
|
4
|
-
server.resource("supported-chains", "config://supported-chains",
|
|
4
|
+
server.resource("supported-chains", "config://supported-chains", {
|
|
5
|
+
title: "Supported Chains",
|
|
6
|
+
description: "List of supported chain names",
|
|
7
|
+
mimeType: "application/json",
|
|
8
|
+
}, async () => ({
|
|
5
9
|
contents: [
|
|
6
10
|
{
|
|
7
|
-
uri:
|
|
11
|
+
uri: "config://supported-chains",
|
|
8
12
|
text: JSON.stringify(Object.values(ChainName), null, 2),
|
|
9
13
|
},
|
|
10
14
|
],
|
|
11
15
|
}));
|
|
12
|
-
server.
|
|
16
|
+
server.registerResource("quote-currencies", "config://quote-currencies", {
|
|
17
|
+
title: "Quote Currencies",
|
|
18
|
+
description: "List of supported quote currencies",
|
|
19
|
+
mimeType: "application/json",
|
|
20
|
+
}, async () => ({
|
|
13
21
|
contents: [
|
|
14
22
|
{
|
|
15
|
-
uri:
|
|
23
|
+
uri: "config://quote-currencies",
|
|
16
24
|
text: JSON.stringify(Object.values(validQuoteValues), null, 2),
|
|
17
25
|
},
|
|
18
26
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticResources.js","sourceRoot":"","sources":["../../src/resources/staticResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"staticResources.js","sourceRoot":"","sources":["../../src/resources/staticResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAanD,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAIhD,MAAM,CAAC,QAAQ,CACX,kBAAkB,EAClB,2BAA2B,EAC3B;QACI,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,+BAA+B;QAC5C,QAAQ,EAAE,kBAAkB;KAC/B,EACD,KAAK,IAAiC,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE;YACN;gBACI,GAAG,EAAE,2BAA2B;gBAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;aAC1D;SACJ;KACJ,CAAC,CACL,CAAC;IAKF,MAAM,CAAC,gBAAgB,CACnB,kBAAkB,EAClB,2BAA2B,EAC3B;QACI,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,oCAAoC;QACjD,QAAQ,EAAE,kBAAkB;KAC/B,EACD,KAAK,IAAiC,EAAE,CAAC,CAAC;QACtC,QAAQ,EAAE;YACN;gBACI,GAAG,EAAE,2BAA2B;gBAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAChB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAC/B,IAAI,EACJ,CAAC,CACJ;aACJ;SACJ;KACJ,CAAC,CACL,CAAC;AACN,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { GoldRushClient } from "@covalenthq/client-sdk";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
3
|
+
type TransportType = "stdio" | "http";
|
|
4
|
+
export declare function createGoldRushClient(apiKey?: string): GoldRushClient;
|
|
5
|
+
export declare function createServer(apiKey?: string): McpServer;
|
|
6
|
+
export declare function startStdioServer(apiKey?: string): Promise<void>;
|
|
7
|
+
export declare function startHttpServer(port?: number): void;
|
|
8
|
+
export declare function startServer(transportType?: TransportType, options?: {
|
|
9
|
+
port?: number;
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
export declare function parseArgsAndStart(): void;
|
|
13
|
+
export {};
|
|
6
14
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAQtC,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,kBAQnD;AAKD,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,aAwB3C;AAKD,wBAAsB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,iBASrD;AAKD,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAqB,QAoH1D;AAKD,wBAAsB,WAAW,CAC7B,aAAa,GAAE,aAAuB,EACtC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,iBAcnD;AAKD,wBAAgB,iBAAiB,SA8FhC"}
|