@covalenthq/goldrush-mcp-server 0.0.1

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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +460 -0
  3. package/dist/example-client.d.ts +2 -0
  4. package/dist/example-client.d.ts.map +1 -0
  5. package/dist/example-client.js +124 -0
  6. package/dist/example-client.js.map +1 -0
  7. package/dist/index.d.ts +4 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +5 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/resources/dynamicResources.d.ts +4 -0
  12. package/dist/resources/dynamicResources.d.ts.map +1 -0
  13. package/dist/resources/dynamicResources.js +59 -0
  14. package/dist/resources/dynamicResources.js.map +1 -0
  15. package/dist/resources/staticResources.d.ts +3 -0
  16. package/dist/resources/staticResources.d.ts.map +1 -0
  17. package/dist/resources/staticResources.js +21 -0
  18. package/dist/resources/staticResources.js.map +1 -0
  19. package/dist/server.d.ts +6 -0
  20. package/dist/server.d.ts.map +1 -0
  21. package/dist/server.js +53 -0
  22. package/dist/server.js.map +1 -0
  23. package/dist/services/AllChainsService.d.ts +4 -0
  24. package/dist/services/AllChainsService.d.ts.map +1 -0
  25. package/dist/services/AllChainsService.js +124 -0
  26. package/dist/services/AllChainsService.js.map +1 -0
  27. package/dist/services/BalanceService.d.ts +4 -0
  28. package/dist/services/BalanceService.d.ts.map +1 -0
  29. package/dist/services/BalanceService.js +228 -0
  30. package/dist/services/BalanceService.js.map +1 -0
  31. package/dist/services/BaseService.d.ts +4 -0
  32. package/dist/services/BaseService.d.ts.map +1 -0
  33. package/dist/services/BaseService.js +170 -0
  34. package/dist/services/BaseService.js.map +1 -0
  35. package/dist/services/BitcoinService.d.ts +4 -0
  36. package/dist/services/BitcoinService.d.ts.map +1 -0
  37. package/dist/services/BitcoinService.js +97 -0
  38. package/dist/services/BitcoinService.js.map +1 -0
  39. package/dist/services/NftService.d.ts +4 -0
  40. package/dist/services/NftService.d.ts.map +1 -0
  41. package/dist/services/NftService.js +70 -0
  42. package/dist/services/NftService.js.map +1 -0
  43. package/dist/services/PricingService.d.ts +4 -0
  44. package/dist/services/PricingService.d.ts.map +1 -0
  45. package/dist/services/PricingService.js +40 -0
  46. package/dist/services/PricingService.js.map +1 -0
  47. package/dist/services/SecurityService.d.ts +4 -0
  48. package/dist/services/SecurityService.d.ts.map +1 -0
  49. package/dist/services/SecurityService.js +30 -0
  50. package/dist/services/SecurityService.js.map +1 -0
  51. package/dist/services/TransactionService.d.ts +4 -0
  52. package/dist/services/TransactionService.d.ts.map +1 -0
  53. package/dist/services/TransactionService.js +150 -0
  54. package/dist/services/TransactionService.js.map +1 -0
  55. package/dist/utils/constants.d.ts +5 -0
  56. package/dist/utils/constants.d.ts.map +1 -0
  57. package/dist/utils/constants.js +21 -0
  58. package/dist/utils/constants.js.map +1 -0
  59. package/dist/utils/helpers.d.ts +2 -0
  60. package/dist/utils/helpers.d.ts.map +1 -0
  61. package/dist/utils/helpers.js +4 -0
  62. package/dist/utils/helpers.js.map +1 -0
  63. package/package.json +89 -0
package/LICENSE ADDED
@@ -0,0 +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
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,460 @@
1
+ <div align="center">
2
+
3
+ # GoldRush MCP Server
4
+
5
+ [![NPM Version](https://img.shields.io/npm/v/@covalenthq/goldrush-mcp-server)](https://www.npmjs.com/package/@covalenthq/goldrush-mcp-server)
6
+ [![NPM Downloads](https://img.shields.io/npm/dt/@covalenthq/goldrush-mcp-server)](https://www.npmjs.com/package/@covalenthq/goldrush-mcp-server)
7
+ [![GitHub license](https://img.shields.io/github/license/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/blob/main/LICENSE)
8
+ [![GitHub last commit](https://img.shields.io/github/last-commit/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/commits/master)
9
+ [![GitHub contributors](https://img.shields.io/github/contributors/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/graphs/contributors)
10
+ [![GitHub issues](https://img.shields.io/github/issues/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/issues)
11
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/pulls)
12
+
13
+ [![GitHub stars](https://img.shields.io/github/stars/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/stargazers)
14
+ [![GitHub forks](https://img.shields.io/github/forks/covalenthq/goldrush-mcp-server)](https://github.com/covalenthq/goldrush-mcp-server/network/members)
15
+
16
+ [📖 Documentation](https://goldrush.dev/docs/goldrush-mcp/)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ This project provides a [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that exposes Covalent's [GoldRush](https://www.covalenthq.com/platform) APIs as MCP resources and tools. It is implemented in TypeScript using [@modelcontextprotocol/sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk) and [@covalenthq/client-sdk](https://www.npmjs.com/package/@covalenthq/client-sdk).
23
+
24
+ ---
25
+
26
+ ## Table of Contents
27
+
28
+ - [Key Features](#key-features)
29
+ - [Getting Started](#getting-started)
30
+ - [GoldRush API key](#goldrush-api-key)
31
+ - [Usage with Claude Desktop](#usage-with-claude-desktop)
32
+ - [Usage with Claude Code CLI](#usage-with-claude-code-cli)
33
+ - [Usage with Cursor](#usage-with-cursor)
34
+ - [Usage with Windsurf](#usage-with-windsurf)
35
+ - [Programmatic Usage](#programmatic-usage)
36
+ - [Example LLM Flow](#example-llm-flow)
37
+ - [Tools](#tools)
38
+ - [Resources](#resources)
39
+ - [Development](#development)
40
+ - [Prerequisites](#prerequisites)
41
+ - [Installation](#installation)
42
+ - [Running the MCP Server](#running-the-mcp-server)
43
+ - [Example Client](#example-client)
44
+ - [Running the Tests](#running-the-tests)
45
+ - [Setting GOLDRUSH_API_KEY](#setting-goldrush_api_key)
46
+ - [File Layout](#file-layout)
47
+ - [Debugging](#debugging)
48
+ - [Contributing](#contributing)
49
+ - [Show your support](#show-your-support)
50
+ - [License](#license)
51
+
52
+ ---
53
+
54
+ ## Key Features
55
+
56
+ Model Context Protocol (MCP) is a message protocol for connecting context or tool-providing servers with LLM clients. This server allows an LLM client to:
57
+
58
+ - Call Covalent GoldRush API endpoints as MCP Tools
59
+ - Read from MCP Resources that give chain info, quote currencies, chain statuses, etc.
60
+ - Fully testable with [Vitest](https://vitest.dev/) for testing each group of tools.
61
+ - Modular architecture where each service is implemented as a separate module, making the codebase easier to maintain and extend.
62
+
63
+ ---
64
+
65
+ ## Getting Started
66
+
67
+ ### GoldRush API key
68
+
69
+ Using any of the GoldRush developer tools requires an API key.
70
+ Get yours at https://goldrush.dev/platform/auth/register/
71
+
72
+ ### Usage with Claude Desktop
73
+
74
+ Add this to your `claude_desktop_config.json`:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "goldrush": {
80
+ "command": "npx",
81
+ "args": ["-y", "@covalenthq/goldrush-mcp-server@latest"],
82
+ "env": {
83
+ "GOLDRUSH_API_KEY": "YOUR_API_KEY_HERE"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ For more details follow the official [MCP Quickstart for Claude Desktop Users](https://modelcontextprotocol.io/quickstart/user)
91
+
92
+ ### Usage with Claude Code CLI
93
+
94
+ ```
95
+ $ claude mcp add goldrush -e GOLDRUSH_API_KEY=<YOUR_API_KEY_HERE> -- npx -y @covalenthq/goldrush-mcp-server@latest
96
+ ```
97
+
98
+ For more details see [Set up Model Context Protocol (MCP)](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp)
99
+
100
+ ### Usage with Cursor
101
+
102
+ 1. Open Cursor Settings
103
+ 2. Go to Features > MCP
104
+ 3. Click + Add new global MCP server
105
+ 4. Add this to your `~/.cursor/mcp.json`:
106
+
107
+ ```json
108
+ {
109
+ "mcpServers": {
110
+ "goldrush": {
111
+ "command": "npx",
112
+ "args": ["-y", "@covalenthq/goldrush-mcp-server@latest"],
113
+ "env": {
114
+ "GOLDRUSH_API_KEY": "YOUR_API_KEY_HERE"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ For project specific configuration, add the above to a `.cursor/mcp.json` file in your project directory. This allows you to define MCP servers that are only available within that specific project.
122
+
123
+ After adding, refresh the MCP server list to see the new tools. The Composer Agent will automatically use any MCP tools that are listed under Available Tools on the MCP settings page if it determines them to be relevant. To prompt tool usage intentionally, simply tell the agent to use the tool, referring to it either by name or by description.
124
+
125
+ See [Example LLM Flow](#example-llm-flow)
126
+
127
+ ### Usage with Windsurf
128
+
129
+ Add this to your `~/.codeium/windsurf/mcp_config.json` file:
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "goldrush": {
135
+ "command": "npx",
136
+ "args": ["-y", "@covalenthq/goldrush-mcp-server@latest"],
137
+ "env": {
138
+ "GOLDRUSH_API_KEY": "YOUR_API_KEY_HERE"
139
+ }
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ ### Programmatic Usage
146
+
147
+ The server is designed to be started as a subprocess by an MCP client. For example, using the [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk):
148
+
149
+ ```typescript
150
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
151
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
152
+
153
+ const transport = new StdioClientTransport({
154
+ command: "npx",
155
+ args: ["-y", "@covalenthq/goldrush-mcp-server@latest"],
156
+ env: {"GOLDRUSH_API_KEY"="your_api_key_here"}
157
+ });
158
+
159
+ const client = new Client(
160
+ {
161
+ name: "example-client",
162
+ version: "1.0.0"
163
+ },
164
+ {
165
+ capabilities: {
166
+ tools: {}
167
+ }
168
+ }
169
+ );
170
+
171
+ await client.connect(transport);
172
+
173
+ // List tools
174
+ const resources = await client.listTools();
175
+ const tools = await client.listTools();
176
+ console.log("Available tools:", tools.tools.map(tool => tool.name).join(", "));
177
+
178
+ // Now you can call tools
179
+ const result = await client.callTool({
180
+ name: "token_balances",
181
+ arguments: {
182
+ chainName: "eth-mainnet",
183
+ address: "demo.eth",
184
+ quoteCurrency: "USD",
185
+ nft: false,
186
+ },
187
+ });
188
+ console.log("Token balances:", result.content);
189
+ ...
190
+ ```
191
+
192
+ ### Example LLM Flow
193
+
194
+ 1. An LLM-based application starts.
195
+ 2. It spawns or connects to this MCP server.
196
+ 3. The LLM decides to call a tool like `transaction_summary` to gather data about a wallet.
197
+ 4. The server calls the Covalent endpoint under the hood, returns JSON to the LLM, which then uses it in the conversation context.
198
+
199
+ ---
200
+
201
+ ## Tools
202
+
203
+ Tools are a powerful primitive in the Model Context Protocol (MCP) that enable servers to expose executable functionality to clients. Through tools, LLMs can interact with external systems, perform computations, and take actions in the real world.
204
+
205
+ 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
+
207
+ 1. `bitcoin_hd_wallet_balances`
208
+
209
+ - 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
+
211
+ 2. `bitcoin_non_hd_wallet_balances`
212
+
213
+ - 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
+
215
+ 3. `bitcoin_transactions`
216
+
217
+ - 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
+
219
+ 4. `block`
220
+
221
+ - 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
+
223
+ 5. `block_heights`
224
+
225
+ - 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
+
227
+ 6. `erc20_token_transfers`
228
+
229
+ - 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
+
231
+ 7. `gas_prices`
232
+
233
+ - 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
+
235
+ 8. `historical_portfolio_value`
236
+
237
+ - 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
+
239
+ 9. `historical_token_balances`
240
+
241
+ - 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
+
243
+ 10. `historical_token_prices`
244
+
245
+ - 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
+
247
+ 11. `log_events_by_address`
248
+
249
+ - 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
+
251
+ 12. `log_events_by_topic`
252
+
253
+ - 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
+
255
+ 13. `multichain_address_activity`
256
+
257
+ - 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
+
259
+ 14. `multichain_balances`
260
+
261
+ - 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
+
263
+ 15. `multichain_transactions`
264
+
265
+ - 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
+
267
+ 16. `native_token_balance`
268
+
269
+ - 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
+
271
+ 17. `nft_for_address`
272
+
273
+ - 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.
274
+
275
+ 18. `nft_check_ownership`
276
+
277
+ - 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.
278
+
279
+ 19. `token_approvals`
280
+
281
+ - 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.
282
+
283
+ 20. `token_balances`
284
+
285
+ - 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.
286
+
287
+ 21. `token_holders`
288
+
289
+ - 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.
290
+
291
+ 22. `transaction`
292
+
293
+ - 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.
294
+
295
+ 23. `transactions_for_address`
296
+
297
+ - 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.
298
+
299
+ 24. `transactions_for_block`
300
+
301
+ - 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.
302
+
303
+ 25. `transaction_summary`
304
+
305
+ - 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.
306
+
307
+ ---
308
+
309
+ ## Resources
310
+
311
+ Resources are a core primitive in the Model Context Protocol (MCP) that allow servers to expose data and content that can be read by clients and used as context for LLM interactions.
312
+
313
+ Resources are designed to be application-controlled, meaning that the client application can decide how and when they should be used. Different MCP clients may handle resources differently. For example:
314
+
315
+ - Claude Desktop currently requires users to explicitly select resources before they can be used
316
+ - Other clients might automatically select resources based on heuristics
317
+ - Some implementations may even allow the AI model itself to determine which resources to use
318
+
319
+ Resources exposed by the GoldRush MCP server are split into static and dynamic types:
320
+
321
+ - Static resources (`src/resources/staticResources.ts`):
322
+
323
+ - `config://supported-chains`
324
+ - `config://quote-currencies`
325
+
326
+ - Dynamic resources (`src/resources/dynamicResources.ts`):
327
+ - `status://all-chains`
328
+ - `status://chain/{chainName}`
329
+
330
+ Dynamic resources fetch real-time data from the Covalent API on each request, ensuring current information.
331
+
332
+ ---
333
+
334
+ ## Development
335
+
336
+ ### Prerequisites
337
+
338
+ - **Node.js** v18 or higher
339
+ - **npm**, **yarn**, or **pnpm**
340
+ - **GOLDRUSH_API_KEY** environment variable containing a valid GoldRush API key
341
+
342
+ ### Installation
343
+
344
+ ```bash
345
+ git clone https://github.com/covalenthq/goldrush-mcp-server.git
346
+ cd goldrush-mcp-server
347
+ npm install
348
+ ```
349
+
350
+ Then build:
351
+
352
+ ```bash
353
+ npm run build
354
+ ```
355
+
356
+ ### Running the MCP Server
357
+
358
+ ```bash
359
+ # Start the server (runs dist/index.js)
360
+ npm run start
361
+ ```
362
+
363
+ This spawns the MCP server on stdin/stdout. Typically, an MCP client will connect to the server.
364
+
365
+ ### Example Client
366
+
367
+ You can run the example client that will spawn the server as a child process via STDIO:
368
+
369
+ ```
370
+ npm run example
371
+ ```
372
+
373
+ This attempts a few Covalent calls and prints out the responses.
374
+
375
+ ### Running the Tests
376
+
377
+ ```
378
+ npm run test
379
+ ```
380
+
381
+ This runs the entire test suite covering each service.
382
+
383
+ ### Setting GOLDRUSH_API_KEY
384
+
385
+ You **must** set the `GOLDRUSH_API_KEY` environment variable to a valid key from the Covalent platform.
386
+ For example on Linux/macOS:
387
+
388
+ ```
389
+ export GOLDRUSH_API_KEY=YOUR_KEY_HERE
390
+ ```
391
+
392
+ Or on Windows:
393
+
394
+ ```
395
+ set GOLDRUSH_API_KEY=YOUR_KEY_HERE
396
+ ```
397
+
398
+ ### File Layout
399
+
400
+ ```
401
+ goldrush-mcp-server
402
+ ├── src
403
+ │ ├── index.ts # Main MCP server entry point
404
+ │ ├── services/ # Modular service implementations
405
+ │ │ ├── AllChainsService.ts # Cross-chain service tools
406
+ │ │ ├── BalanceService.ts # Balance-related tools
407
+ │ │ ├── BaseService.ts # Basic blockchain tools
408
+ │ │ ├── BitcoinService.ts # Bitcoin-specific tools
409
+ │ │ ├── NftService.ts # NFT-related tools
410
+ │ │ ├── PricingService.ts # Pricing-related tools
411
+ │ │ ├── SecurityService.ts # Security-related tools
412
+ │ │ └── TransactionService.ts# Transaction-related tools
413
+ │ ├── resources/ # Resource implementations
414
+ │ │ ├── staticResources.ts # Static configuration resources
415
+ │ │ └── dynamicResources.ts # Dynamic chain status resources
416
+ │ ├── utils/ # Utility functions and constants
417
+ │ │ ├── constants.ts # Shared constants
418
+ │ │ └── helpers.ts # Helper functions
419
+ │ └── example-client.ts # Example LLM client using STDIO transport
420
+ ├── test
421
+ │ ├── AllChainsService.test.ts
422
+ │ ├── BalanceService.test.ts
423
+ │ ├── BaseService.test.ts
424
+ │ ├── BitcoinService.test.ts
425
+ │ ├── NftService.test.ts
426
+ │ ├── PricingService.test.ts
427
+ │ ├── Resources.test.ts
428
+ │ ├── SecurityService.test.ts
429
+ │ └── TransactionService.test.ts
430
+ ├── eslint.config.mjs # ESLint configuration
431
+ ├── package.json # Project dependencies and scripts
432
+ ├── package-lock.json # Locked dependencies
433
+ ├── tsconfig.json # TypeScript configuration
434
+ ├── LICENSE # MIT license
435
+ └── README.md # Project documentation
436
+ ```
437
+
438
+ ### Debugging
439
+
440
+ #### Using Inspector
441
+
442
+ https://modelcontextprotocol.io/docs/tools/inspector
443
+
444
+ ```bash
445
+ npx @modelcontextprotocol/inspector node dist/index.js
446
+ ```
447
+
448
+ ---
449
+
450
+ ## Contributing
451
+
452
+ We welcome contributions from the community! If you have suggestions, improvements, or new spam contract addresses to add, please open an issue or submit a pull request. Feel free to check <a href="https://github.com/covalenthq/goldrush-mcp-server/issues">issues</a> page.
453
+
454
+ ## Show your support
455
+
456
+ Give a ⭐️ if this project helped you!
457
+
458
+ ## License
459
+
460
+ This project is <a href="https://github.com/covalenthq/goldrush-mcp-server/blob/main/LICENSE">MIT</a> licensed.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=example-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-client.d.ts","sourceRoot":"","sources":["../src/example-client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,124 @@
1
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
3
+ import path from "path";
4
+ async function tokenBalancesExample(client) {
5
+ console.log("\n=== token_balances Example ===");
6
+ const result = await client.callTool({
7
+ name: "token_balances",
8
+ arguments: {
9
+ chainName: "eth-mainnet",
10
+ address: "demo.eth",
11
+ quoteCurrency: "USD",
12
+ nft: false,
13
+ },
14
+ });
15
+ console.log("Token balances:", result.content);
16
+ }
17
+ async function historicalBalancesExample(client) {
18
+ console.log("\n=== historical_token_balances Example ===");
19
+ const result = await client.callTool({
20
+ name: "historical_token_balances",
21
+ arguments: {
22
+ chainName: "eth-mainnet",
23
+ address: "demo.eth",
24
+ quoteCurrency: "USD",
25
+ date: "2024-01-01",
26
+ },
27
+ });
28
+ console.log("Historical balances:", result.content);
29
+ }
30
+ async function transactionsExample(client) {
31
+ console.log("\n=== transactions_for_address Example ===");
32
+ const result = await client.callTool({
33
+ name: "transactions_for_address",
34
+ arguments: {
35
+ chainName: "eth-mainnet",
36
+ walletAddress: "demo.eth",
37
+ page: 0,
38
+ quoteCurrency: "USD",
39
+ noLogs: true,
40
+ },
41
+ });
42
+ console.log("Transactions:", result.content);
43
+ }
44
+ async function specificTransactionExample(client) {
45
+ console.log("\n=== transaction Example ===");
46
+ const result = await client.callTool({
47
+ name: "transaction",
48
+ arguments: {
49
+ chainName: "eth-mainnet",
50
+ txHash: "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
51
+ },
52
+ });
53
+ console.log("Transaction details:", result.content);
54
+ }
55
+ async function getSupportedChainsResourceExample(client) {
56
+ console.log("\n=== supported-chains Resource Example ===");
57
+ const result = await client.readResource({
58
+ uri: "config://supported-chains",
59
+ });
60
+ if (result.contents &&
61
+ result.contents.length > 0 &&
62
+ result.contents[0] &&
63
+ "text" in result.contents[0]) {
64
+ const chains = JSON.parse(result.contents[0].text);
65
+ console.log("Supported chains from resource:", chains);
66
+ }
67
+ else {
68
+ console.log("No content found in supported-chains resource");
69
+ }
70
+ }
71
+ async function getQuoteCurrenciesResourceExample(client) {
72
+ console.log("\n=== quote-currencies Resource Example ===");
73
+ const result = await client.readResource({
74
+ uri: "config://quote-currencies",
75
+ });
76
+ if (result.contents &&
77
+ result.contents.length > 0 &&
78
+ result.contents[0] &&
79
+ "text" in result.contents[0]) {
80
+ const currencies = JSON.parse(result.contents[0].text);
81
+ console.log("Supported quote currencies from resource:", currencies);
82
+ }
83
+ else {
84
+ console.log("No content found in quote-currencies resource");
85
+ }
86
+ }
87
+ async function main() {
88
+ const transport = new StdioClientTransport({
89
+ command: "node",
90
+ args: [path.resolve(process.cwd(), "dist/index.js")],
91
+ });
92
+ const client = new Client({
93
+ name: "GoldRush MCP Example Client",
94
+ version: "1.0.0",
95
+ }, {
96
+ capabilities: {
97
+ tools: {},
98
+ resources: {},
99
+ },
100
+ });
101
+ try {
102
+ await client.connect(transport);
103
+ const tools = await client.listTools();
104
+ console.log("Available tools:", tools.tools.map((tool) => tool.name).join(", "));
105
+ const resources = await client.listResources();
106
+ console.log("Available resources:", resources.resources.map((resource) => resource.name).join(", "));
107
+ await tokenBalancesExample(client);
108
+ await historicalBalancesExample(client);
109
+ await transactionsExample(client);
110
+ await specificTransactionExample(client);
111
+ await getSupportedChainsResourceExample(client);
112
+ await getQuoteCurrenciesResourceExample(client);
113
+ console.log("\nAll examples completed successfully");
114
+ }
115
+ catch (error) {
116
+ console.error("Error:", error);
117
+ }
118
+ finally {
119
+ await client.close();
120
+ console.log("Connection closed");
121
+ }
122
+ }
123
+ main().catch(console.error);
124
+ //# sourceMappingURL=example-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-client.js","sourceRoot":"","sources":["../src/example-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,KAAK,UAAU,oBAAoB,CAAC,MAAc;IAC9C,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE;YACP,SAAS,EAAE,aAAa;YACxB,OAAO,EAAE,UAAU;YACnB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,KAAK;SACb;KACJ,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,KAAK,UAAU,yBAAyB,CAAC,MAAc;IACnD,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,EAAE,2BAA2B;QACjC,SAAS,EAAE;YACP,SAAS,EAAE,aAAa;YACxB,OAAO,EAAE,UAAU;YACnB,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,YAAY;SACrB;KACJ,CAAC,C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AC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createGoldRushClient, createServer, startServer } from "./server.js";
3
+ export { createGoldRushClient, createServer, startServer };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM9E,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { createGoldRushClient, createServer, startServer } from "./server.js";
3
+ startServer().catch(console.error);
4
+ export { createGoldRushClient, createServer, startServer };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9E,WAAW,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAGnC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { GoldRushClient } from "@covalenthq/client-sdk";
2
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ export declare function addRealTimeChainStatusResources(server: McpServer, goldRushClient: GoldRushClient): void;
4
+ //# sourceMappingURL=dynamicResources.d.ts.map
@@ -0,0 +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;AAiBzE,wBAAgB,+BAA+B,CAC3C,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QAkFjC"}