@gala-chain/launchpad-mcp-server 1.17.6 → 1.18.0
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/CHANGELOG.md +96 -0
- package/README.md +49 -11
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +48 -16
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +2 -2
- package/dist/tools/utils/explainSdkUsage.js +7 -7
- package/dist/tools/utils/getWallet.d.ts +8 -0
- package/dist/tools/utils/getWallet.d.ts.map +1 -0
- package/dist/tools/utils/getWallet.js +27 -0
- package/dist/tools/utils/getWallet.js.map +1 -0
- package/dist/tools/utils/hasWallet.d.ts +8 -0
- package/dist/tools/utils/hasWallet.d.ts.map +1 -0
- package/dist/tools/utils/hasWallet.js +17 -0
- package/dist/tools/utils/hasWallet.js.map +1 -0
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +6 -0
- package/dist/tools/utils/index.js.map +1 -1
- package/dist/tools/utils/setWallet.d.ts +8 -0
- package/dist/tools/utils/setWallet.d.ts.map +1 -0
- package/dist/tools/utils/setWallet.js +40 -0
- package/dist/tools/utils/setWallet.js.map +1 -0
- package/docs/AI-AGENT-PATTERNS.md +555 -0
- package/docs/CONSTRAINTS-REFERENCE.md +454 -0
- package/docs/PROMPT-TOOL-MAPPING.md +352 -0
- package/docs/examples/default-values-pattern.md +240 -0
- package/docs/examples/tool-factory-pattern.md +217 -0
- package/jest.config.js +94 -0
- package/package.json +13 -4
- package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +258 -0
- package/src/__tests__/integration/poolTools.integration.test.ts +185 -0
- package/src/constants/mcpToolNames.ts +141 -0
- package/src/index.ts +19 -0
- package/src/prompts/__tests__/promptStructure.test.ts +114 -0
- package/src/prompts/__tests__/registry.test.ts +145 -0
- package/src/prompts/analysis.ts +429 -0
- package/src/prompts/index.ts +127 -0
- package/src/prompts/portfolio.ts +242 -0
- package/src/prompts/trading.ts +191 -0
- package/src/prompts/utility.ts +43 -0
- package/src/prompts/utils/workflowTemplates.ts +344 -0
- package/src/schemas/common-schemas.ts +393 -0
- package/src/scripts/test-all-prompts.ts +184 -0
- package/src/server.ts +277 -0
- package/src/tools/balance/index.ts +174 -0
- package/src/tools/creation/index.ts +182 -0
- package/src/tools/index.ts +80 -0
- package/src/tools/pools/fetchAllPools.ts +47 -0
- package/src/tools/pools/fetchAllPriceHistory.ts +119 -0
- package/src/tools/pools/fetchPoolDetails.ts +27 -0
- package/src/tools/pools/fetchPoolDetailsForCalculation.ts +22 -0
- package/src/tools/pools/fetchPools.ts +47 -0
- package/src/tools/pools/fetchPriceHistory.ts +124 -0
- package/src/tools/pools/fetchTokenDetails.ts +77 -0
- package/src/tools/pools/index.ts +284 -0
- package/src/tools/social/index.ts +64 -0
- package/src/tools/trading/index.ts +605 -0
- package/src/tools/transfers/index.ts +75 -0
- package/src/tools/utils/clearCache.ts +36 -0
- package/src/tools/utils/createWallet.ts +19 -0
- package/src/tools/utils/explainSdkUsage.ts +1420 -0
- package/src/tools/utils/getAddress.ts +12 -0
- package/src/tools/utils/getCacheInfo.ts +14 -0
- package/src/tools/utils/getConfig.ts +11 -0
- package/src/tools/utils/getEthereumAddress.ts +12 -0
- package/src/tools/utils/getUrlByTokenName.ts +12 -0
- package/src/tools/utils/getVersion.ts +25 -0
- package/src/tools/utils/getWallet.ts +25 -0
- package/src/tools/utils/hasWallet.ts +15 -0
- package/src/tools/utils/index.ts +33 -0
- package/src/tools/utils/isTokenGraduated.ts +16 -0
- package/src/tools/utils/setWallet.ts +41 -0
- package/src/types/mcp.ts +72 -0
- package/src/utils/__tests__/validation.test.ts +147 -0
- package/src/utils/constraints.ts +155 -0
- package/src/utils/default-values.ts +208 -0
- package/src/utils/error-handler.ts +69 -0
- package/src/utils/error-templates.ts +273 -0
- package/src/utils/response-formatter.ts +51 -0
- package/src/utils/tool-factory.ts +257 -0
- package/src/utils/tool-registry.ts +296 -0
- package/src/utils/validation.ts +336 -0
- package/tests/wallet-management-integration.test.ts +284 -0
- package/tsconfig.json +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **BREAKING CHANGE:** Default environment changed from `development` to `production`
|
|
8
|
+
|
|
9
|
+
All SDK and MCP initialization now defaults to production environment
|
|
10
|
+
(`lpad-backend-prod1.defi.gala.com`) instead of development. To use development environment,
|
|
11
|
+
explicitly set `env: 'DEVELOPMENT'` or `ENVIRONMENT=development`.
|
|
12
|
+
|
|
13
|
+
Changes include:
|
|
14
|
+
- SDK `AgentConfig.detectEnvironment()` defaults to 'production'
|
|
15
|
+
- MCP Server environment defaults to 'production'
|
|
16
|
+
- All examples and documentation updated to show production as default
|
|
17
|
+
- All installation instructions updated accordingly
|
|
18
|
+
|
|
19
|
+
Users relying on implicit development environment must now explicitly set the environment
|
|
20
|
+
variable.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @gala-chain/launchpad-sdk@3.23.0
|
|
26
|
+
|
|
27
|
+
## 1.17.7
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Bump SDK dependency to v3.22.7 which includes the new read-only operations example
|
|
32
|
+
|
|
33
|
+
## 1.18.0
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- feat: Implement optional wallet support with 3 new wallet management tools (57 tools across
|
|
38
|
+
read-only and full-access modes)
|
|
39
|
+
|
|
40
|
+
## Overview
|
|
41
|
+
|
|
42
|
+
PRIVATE_KEY environment variable is now optional, enabling two distinct operational modes:
|
|
43
|
+
- **Read-Only Mode**: Query pools, prices, token details without wallet (40+ tools available)
|
|
44
|
+
- **Full-Access Mode**: Execute trades, create tokens, sign transactions with wallet (17+
|
|
45
|
+
additional tools)
|
|
46
|
+
|
|
47
|
+
## New Wallet Management Tools
|
|
48
|
+
- **`gala_launchpad_has_wallet`** - Check if MCP server wallet is currently configured
|
|
49
|
+
- **`gala_launchpad_get_wallet`** - Retrieve the configured wallet address (GalaChain and Ethereum
|
|
50
|
+
formats)
|
|
51
|
+
- **`gala_launchpad_set_wallet`** - Configure wallet for signing operations dynamically
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
**Full-Access Mode (with wallet):**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
claude mcp add "galachain-launchpad" -- \
|
|
59
|
+
env PRIVATE_KEY=<YOUR_KEY> ENVIRONMENT=production \
|
|
60
|
+
npx -y @gala-chain/launchpad-mcp-server@latest
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Read-Only Mode (no wallet):**
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
claude mcp add "galachain-launchpad" -- \
|
|
67
|
+
env ENVIRONMENT=production \
|
|
68
|
+
npx -y @gala-chain/launchpad-mcp-server@latest
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Key Features
|
|
72
|
+
- **Optional PRIVATE_KEY**: Omit `PRIVATE_KEY` environment variable for read-only mode
|
|
73
|
+
- **Progressive Enhancement**: Start with read-only queries, upgrade by setting wallet dynamically
|
|
74
|
+
- **Smart Tool Availability**: Tools requiring wallet automatically disabled in read-only mode
|
|
75
|
+
- **Seamless Claude Desktop Integration**: Full compatibility with Claude Desktop MCP server setup
|
|
76
|
+
- **Type Safety**: Wallet validation matches SDK implementation for consistency
|
|
77
|
+
- **Backward Compatible**: Existing installations with PRIVATE_KEY continue to work unchanged
|
|
78
|
+
|
|
79
|
+
## Tool Categories (57 Total)
|
|
80
|
+
- **Pool Management & Pricing** (17 tools) - Fetch pools, details, distributions, badges, prices
|
|
81
|
+
- **Price History & Analysis** (4 tools) - Historical price data and trends
|
|
82
|
+
- **Trading Operations** (13 tools) - Buy/sell calculations, token trades, graduation
|
|
83
|
+
- **Balance & Portfolio** (6 tools) - Token balances, holdings, profiles
|
|
84
|
+
- **Token Creation & Management** (4 tools) - Launch tokens, upload images, manage metadata
|
|
85
|
+
- **Wallet Management** (3 tools) - Check, get, set wallet configuration
|
|
86
|
+
- **Utility & Social** (10 tools) - Comments, transfers, configuration, URL generation
|
|
87
|
+
|
|
88
|
+
## SDK Dependency Update
|
|
89
|
+
- Updated @gala-chain/launchpad-sdk to 3.23.0
|
|
90
|
+
- Incorporates 4 new wallet management methods (hasWallet, getWallet, setWallet, validateWallet)
|
|
91
|
+
- All MCP tools leverage SDK's new optional wallet support
|
|
92
|
+
|
|
93
|
+
## Test Coverage
|
|
94
|
+
- Unit tests for optional wallet mode detection and tool filtering
|
|
95
|
+
- Integration tests for read-only mode MCP operations (pool queries, price fetches)
|
|
96
|
+
- Integration tests for full-access mode with wallet operations (trades, transfers, creation)
|
|
97
|
+
- Tool availability verification for both operational modes
|
|
98
|
+
|
|
3
99
|
## 1.17.5
|
|
4
100
|
|
|
5
101
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MCP (Model Context Protocol) server for Gala Launchpad SDK - Enables AI agents t
|
|
|
4
4
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **57 AI-accessible tools** for complete Gala Launchpad integration (includes 4 price history tools, 3 wallet management tools)
|
|
8
8
|
- **14 slash commands** (prompts) for quick access to common workflows
|
|
9
9
|
- **Type-safe** - Full TypeScript support with validated inputs
|
|
10
10
|
- **Production-ready** - Built on [@gala-chain/launchpad-sdk ](https://www.npmjs.com/package/@gala-chain/launchpad-sdk)
|
|
@@ -42,7 +42,7 @@ Add to your `claude_desktop_config.json`:
|
|
|
42
42
|
"args": ["-y", "@gala-chain/launchpad-mcp-server@latest"],
|
|
43
43
|
"env": {
|
|
44
44
|
"PRIVATE_KEY": "0x1234567890abcdef...",
|
|
45
|
-
"ENVIRONMENT": "
|
|
45
|
+
"ENVIRONMENT": "production"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -50,8 +50,8 @@ Add to your `claude_desktop_config.json`:
|
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
**Environment Variables:**
|
|
53
|
-
- `PRIVATE_KEY` (
|
|
54
|
-
- `ENVIRONMENT` (optional) - `development` or `production` (default:
|
|
53
|
+
- `PRIVATE_KEY` (optional) - Your Ethereum wallet private key (omit for read-only mode)
|
|
54
|
+
- `ENVIRONMENT` (optional) - `development` or `production` (default: production)
|
|
55
55
|
- `DEBUG` (optional) - `true` to enable debug logging
|
|
56
56
|
- `TIMEOUT` (optional) - Request timeout in milliseconds (default: 30000)
|
|
57
57
|
|
|
@@ -62,9 +62,45 @@ Add to your `claude_desktop_config.json`:
|
|
|
62
62
|
3. **Restart Claude Desktop**
|
|
63
63
|
4. **Use tools**: Ask Claude to interact with Gala Launchpad!
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## 🔐 Operational Modes
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
The MCP server supports two operational modes with dynamic wallet configuration:
|
|
68
|
+
|
|
69
|
+
### Full-Access Mode (with PRIVATE_KEY)
|
|
70
|
+
- Execute token trades (buy/sell)
|
|
71
|
+
- Create new tokens
|
|
72
|
+
- Transfer GALA and tokens
|
|
73
|
+
- Update profile information
|
|
74
|
+
- Post comments on token pools
|
|
75
|
+
- All read operations (fetch pools, prices, balances, etc.)
|
|
76
|
+
|
|
77
|
+
**Setup:**
|
|
78
|
+
```bash
|
|
79
|
+
claude mcp add "galachain-launchpad" -- env PRIVATE_KEY=0x... ENVIRONMENT=production npx -y @gala-chain/launchpad-mcp-server@latest
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Read-Only Mode (without PRIVATE_KEY)
|
|
83
|
+
- Fetch token pools and details
|
|
84
|
+
- Get real-time prices and price history
|
|
85
|
+
- Check balances and portfolio
|
|
86
|
+
- Browse comments on token pools
|
|
87
|
+
- Explore token metadata and distributions
|
|
88
|
+
- **Cannot:** Execute trades, create tokens, transfer funds (operations requiring wallet signatures)
|
|
89
|
+
|
|
90
|
+
**Setup:**
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add "galachain-launchpad-readonly" -- env ENVIRONMENT=production npx -y @gala-chain/launchpad-mcp-server@latest
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Dynamic Wallet Configuration
|
|
96
|
+
Use the wallet management tools to upgrade or switch wallets at runtime:
|
|
97
|
+
- `gala_launchpad_has_wallet` - Check current wallet status
|
|
98
|
+
- `gala_launchpad_set_wallet` - Upgrade from read-only to full-access mode
|
|
99
|
+
- `gala_launchpad_get_wallet` - Retrieve wallet information
|
|
100
|
+
|
|
101
|
+
## 🛠️ Available Tools (57 Total)
|
|
102
|
+
|
|
103
|
+
### Pool Management (17 tools)
|
|
68
104
|
- `gala_launchpad_fetch_pools` - Fetch token pools with filtering
|
|
69
105
|
- `gala_launchpad_fetch_all_pools` - Fetch all available pools with automatic pagination
|
|
70
106
|
- `gala_launchpad_fetch_pool_details` - Get detailed pool state
|
|
@@ -305,6 +341,11 @@ Ask Claude:
|
|
|
305
341
|
- `gala_launchpad_fetch_profile` - Get user profile
|
|
306
342
|
- `gala_launchpad_update_profile` - Update profile
|
|
307
343
|
|
|
344
|
+
### Wallet Management (3 tools)
|
|
345
|
+
- `gala_launchpad_has_wallet` - Check if wallet is configured
|
|
346
|
+
- `gala_launchpad_get_wallet` - Get currently configured wallet instance
|
|
347
|
+
- `gala_launchpad_set_wallet` - Configure wallet for signing operations (upgrade from read-only mode)
|
|
348
|
+
|
|
308
349
|
### Token Creation (4 tools)
|
|
309
350
|
- `gala_launchpad_launch_token` - Create new token pool
|
|
310
351
|
- `gala_launchpad_upload_token_image` - Upload token image from filesystem
|
|
@@ -319,16 +360,13 @@ Ask Claude:
|
|
|
319
360
|
- `gala_launchpad_transfer_gala` - Transfer GALA tokens
|
|
320
361
|
- `gala_launchpad_transfer_token` - Transfer launchpad tokens
|
|
321
362
|
|
|
322
|
-
### Utility Tools (
|
|
363
|
+
### Utility Tools (6 tools)
|
|
323
364
|
- `gala_launchpad_create_wallet` - Create new GalaChain wallet
|
|
324
365
|
- `gala_launchpad_get_address` - Get user's GalaChain address
|
|
325
366
|
- `gala_launchpad_get_ethereum_address` - Get user's Ethereum address
|
|
326
367
|
- `gala_launchpad_get_config` - Get current SDK configuration
|
|
327
368
|
- `gala_launchpad_get_url_by_token_name` - Generate frontend URL for a token
|
|
328
|
-
- `
|
|
329
|
-
- `gala_launchpad_is_token_graduated` - Check if token completed bonding curve phase
|
|
330
|
-
- `gala_launchpad_get_cache_info` - Get token metadata cache statistics
|
|
331
|
-
- `gala_launchpad_clear_cache` - Clear token metadata cache entries
|
|
369
|
+
- `gala_launchpad_get_version` - Get SDK and MCP server version information
|
|
332
370
|
|
|
333
371
|
## 💡 Example Usage
|
|
334
372
|
|
package/dist/server.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export declare class LaunchpadMCPServer {
|
|
|
10
10
|
constructor();
|
|
11
11
|
/**
|
|
12
12
|
* Initialize SDK with AgentConfig
|
|
13
|
+
*
|
|
14
|
+
* Supports two operational modes:
|
|
15
|
+
* 1. Full-access mode (PRIVATE_KEY provided): Uses quickSetup() - all operations available
|
|
16
|
+
* 2. Read-only mode (PRIVATE_KEY not provided): Uses readOnlySetup() - query operations only
|
|
17
|
+
*
|
|
18
|
+
* In read-only mode, signing operations (buy, sell, create tokens, etc.) will throw ValidationError
|
|
19
|
+
* when attempted, but all query operations (fetchPools, fetchBalance, etc.) work normally.
|
|
13
20
|
*/
|
|
14
21
|
initialize(): Promise<void>;
|
|
15
22
|
/**
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,KAAK,CAAU;;IAyBvB
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,KAAK,CAAU;;IAyBvB;;;;;;;;;OASG;IACG,UAAU;IA8DhB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmDzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAiD3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAsB1B;;OAEG;IACG,KAAK;IAaX;;OAEG;IACH,OAAO;CAQR"}
|
package/dist/server.js
CHANGED
|
@@ -35,29 +35,61 @@ class LaunchpadMCPServer {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Initialize SDK with AgentConfig
|
|
38
|
+
*
|
|
39
|
+
* Supports two operational modes:
|
|
40
|
+
* 1. Full-access mode (PRIVATE_KEY provided): Uses quickSetup() - all operations available
|
|
41
|
+
* 2. Read-only mode (PRIVATE_KEY not provided): Uses readOnlySetup() - query operations only
|
|
42
|
+
*
|
|
43
|
+
* In read-only mode, signing operations (buy, sell, create tokens, etc.) will throw ValidationError
|
|
44
|
+
* when attempted, but all query operations (fetchPools, fetchBalance, etc.) work normally.
|
|
38
45
|
*/
|
|
39
46
|
async initialize() {
|
|
40
47
|
try {
|
|
41
48
|
if (this.debug) {
|
|
42
49
|
console.error('[MCP Server] Initializing SDK...');
|
|
43
50
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const hasPrivateKey = Boolean(process.env.PRIVATE_KEY && process.env.PRIVATE_KEY.trim());
|
|
52
|
+
const environment = process.env.ENVIRONMENT || 'production';
|
|
53
|
+
const timeout = parseInt(process.env.TIMEOUT || '30000', 10);
|
|
54
|
+
if (hasPrivateKey) {
|
|
55
|
+
// Full-access mode: use quickSetup() to enable signing operations
|
|
56
|
+
if (this.debug) {
|
|
57
|
+
console.error('[MCP Server] PRIVATE_KEY detected - initializing in full-access mode');
|
|
58
|
+
}
|
|
59
|
+
const { sdk, validation } = await launchpad_sdk_1.AgentConfig.quickSetup({
|
|
60
|
+
environment,
|
|
61
|
+
privateKey: process.env.PRIVATE_KEY,
|
|
62
|
+
timeout,
|
|
63
|
+
debug: this.debug,
|
|
64
|
+
autoValidate: false,
|
|
65
|
+
});
|
|
66
|
+
this.sdk = sdk;
|
|
67
|
+
if (this.debug) {
|
|
68
|
+
console.error('[MCP Server] SDK initialized successfully (full-access mode)');
|
|
69
|
+
if (validation) {
|
|
70
|
+
console.error(`[MCP Server] Validation - Ready: ${validation.ready}`);
|
|
71
|
+
console.error(`[MCP Server] Validation - Can Trade: ${validation.capabilities.canTrade}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (validation && !validation.ready) {
|
|
75
|
+
console.error('[MCP Server] Warning: SDK not ready', validation.issues);
|
|
57
76
|
}
|
|
58
77
|
}
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
else {
|
|
79
|
+
// Read-only mode: use readOnlySetup() for query-only operations
|
|
80
|
+
if (this.debug) {
|
|
81
|
+
console.error('[MCP Server] PRIVATE_KEY not provided - initializing in read-only mode');
|
|
82
|
+
}
|
|
83
|
+
const { sdk } = await launchpad_sdk_1.AgentConfig.readOnlySetup({
|
|
84
|
+
environment,
|
|
85
|
+
timeout,
|
|
86
|
+
debug: this.debug,
|
|
87
|
+
});
|
|
88
|
+
this.sdk = sdk;
|
|
89
|
+
if (this.debug) {
|
|
90
|
+
console.error('[MCP Server] SDK initialized successfully (read-only mode)');
|
|
91
|
+
console.error('[MCP Server] Note: Signing operations will fail - wallet required');
|
|
92
|
+
}
|
|
61
93
|
}
|
|
62
94
|
}
|
|
63
95
|
catch (error) {
|
|
@@ -95,7 +127,7 @@ class LaunchpadMCPServer {
|
|
|
95
127
|
throw new Error(`Tool not found: ${toolName}`);
|
|
96
128
|
}
|
|
97
129
|
if (!this.sdk) {
|
|
98
|
-
throw new Error('SDK not initialized.
|
|
130
|
+
throw new Error('SDK not initialized. Failed during startup - check logs for details.');
|
|
99
131
|
}
|
|
100
132
|
try {
|
|
101
133
|
const result = await tool.handler(this.sdk, args);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAK4C;AAC5C,6DAA2E;AAC3E,+CAAyC;AACzC,iDAAwD;AAExD,MAAa,kBAAkB;IACrB,MAAM,CAAS;IACf,GAAG,GAAwB,IAAI,CAAC;IAChC,KAAK,CAAU;IAEvB;QACE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC;QAE1C,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAM,CACtB;YACE,IAAI,EAAE,kCAAkC;YACxC,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;gBACT,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI;iBAClB;aACF;SACF,CACF,CAAC;QAEF,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAED
|
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CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAlQD,gDAkQC"}
|
package/dist/tools/index.d.ts
CHANGED
package/dist/tools/index.js
CHANGED
|
@@ -58,9 +58,9 @@ const toolCategories = [
|
|
|
58
58
|
},
|
|
59
59
|
];
|
|
60
60
|
/**
|
|
61
|
-
* Enhanced tool registry with validation (
|
|
61
|
+
* Enhanced tool registry with validation (57 tools)
|
|
62
62
|
*/
|
|
63
|
-
exports.registry = (0, tool_registry_js_1.createToolRegistry)(toolCategories,
|
|
63
|
+
exports.registry = (0, tool_registry_js_1.createToolRegistry)(toolCategories, 57);
|
|
64
64
|
/**
|
|
65
65
|
* Complete tool array (for backward compatibility)
|
|
66
66
|
*/
|
|
@@ -631,22 +631,22 @@ import type {
|
|
|
631
631
|
### Environment Configuration
|
|
632
632
|
|
|
633
633
|
\`\`\`typescript
|
|
634
|
-
//
|
|
634
|
+
// Production (default)
|
|
635
635
|
const sdk = createLaunchpadSDK({
|
|
636
636
|
wallet: 'your-private-key',
|
|
637
637
|
config: {
|
|
638
|
-
baseUrl: 'https://lpad-backend-
|
|
639
|
-
debug:
|
|
638
|
+
baseUrl: 'https://lpad-backend-prod1.defi.gala.com',
|
|
639
|
+
debug: false,
|
|
640
|
+
timeout: 60000
|
|
640
641
|
}
|
|
641
642
|
});
|
|
642
643
|
|
|
643
|
-
//
|
|
644
|
+
// Development
|
|
644
645
|
const sdk = createLaunchpadSDK({
|
|
645
646
|
wallet: 'your-private-key',
|
|
646
647
|
config: {
|
|
647
|
-
baseUrl: 'https://lpad-backend-
|
|
648
|
-
debug:
|
|
649
|
-
timeout: 60000
|
|
648
|
+
baseUrl: 'https://lpad-backend-dev1.defi.gala.com',
|
|
649
|
+
debug: true
|
|
650
650
|
}
|
|
651
651
|
});
|
|
652
652
|
\`\`\`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Wallet Tool
|
|
3
|
+
*
|
|
4
|
+
* Retrieves the wallet instance currently configured in the SDK.
|
|
5
|
+
* Returns the wallet object if configured, or null if in read-only mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getWalletTool: import("../../types/mcp.js").MCPTool;
|
|
8
|
+
//# sourceMappingURL=getWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWallet.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getWallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,aAAa,sCAexB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Get Wallet Tool
|
|
4
|
+
*
|
|
5
|
+
* Retrieves the wallet instance currently configured in the SDK.
|
|
6
|
+
* Returns the wallet object if configured, or null if in read-only mode.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.getWalletTool = void 0;
|
|
10
|
+
const tool_factory_js_1 = require("../../utils/tool-factory.js");
|
|
11
|
+
exports.getWalletTool = (0, tool_factory_js_1.createNoParamTool)({
|
|
12
|
+
name: 'gala_launchpad_get_wallet',
|
|
13
|
+
description: 'Get the wallet instance currently configured in the SDK. Returns wallet object if available, or null if in read-only mode.',
|
|
14
|
+
handler: (sdk) => {
|
|
15
|
+
const wallet = sdk.getWallet();
|
|
16
|
+
// Return wallet metadata if available, or null
|
|
17
|
+
if (wallet && typeof wallet === 'object' && 'address' in wallet) {
|
|
18
|
+
return {
|
|
19
|
+
address: wallet.address,
|
|
20
|
+
hasPrivateKey: 'privateKey' in wallet && Boolean(wallet.privateKey),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
},
|
|
25
|
+
resultKey: 'wallet',
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=getWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWallet.js","sourceRoot":"","sources":["../../../src/tools/utils/getWallet.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAAgE;AAEnD,QAAA,aAAa,GAAG,IAAA,mCAAiB,EAAC;IAC7C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,4HAA4H;IACzI,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC/B,+CAA+C;QAC/C,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YAChE,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,aAAa,EAAE,YAAY,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;aACpE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Has Wallet Tool
|
|
3
|
+
*
|
|
4
|
+
* Checks if the SDK has a wallet configured for signing operations.
|
|
5
|
+
* Returns true if wallet is available, false for read-only mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare const hasWalletTool: import("../../types/mcp.js").MCPTool;
|
|
8
|
+
//# sourceMappingURL=hasWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasWallet.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/hasWallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,aAAa,sCAKxB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Has Wallet Tool
|
|
4
|
+
*
|
|
5
|
+
* Checks if the SDK has a wallet configured for signing operations.
|
|
6
|
+
* Returns true if wallet is available, false for read-only mode.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.hasWalletTool = void 0;
|
|
10
|
+
const tool_factory_js_1 = require("../../utils/tool-factory.js");
|
|
11
|
+
exports.hasWalletTool = (0, tool_factory_js_1.createNoParamTool)({
|
|
12
|
+
name: 'gala_launchpad_has_wallet',
|
|
13
|
+
description: 'Check if wallet is configured in the SDK. Returns true if wallet is available for signing operations, false if in read-only mode.',
|
|
14
|
+
handler: (sdk) => sdk.hasWallet(),
|
|
15
|
+
resultKey: 'hasWallet',
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=hasWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasWallet.js","sourceRoot":"","sources":["../../../src/tools/utils/hasWallet.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAAgE;AAEnD,QAAA,aAAa,GAAG,IAAA,mCAAiB,EAAC;IAC7C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,mIAAmI;IAChJ,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE;IACjC,SAAS,EAAE,WAAW;CACvB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,eAAO,MAAM,YAAY,wCAcxB,CAAC"}
|
|
@@ -14,6 +14,9 @@ const isTokenGraduated_js_1 = require("./isTokenGraduated.js");
|
|
|
14
14
|
const getCacheInfo_js_1 = require("./getCacheInfo.js");
|
|
15
15
|
const clearCache_js_1 = require("./clearCache.js");
|
|
16
16
|
const getVersion_js_1 = require("./getVersion.js");
|
|
17
|
+
const hasWallet_js_1 = require("./hasWallet.js");
|
|
18
|
+
const getWallet_js_1 = require("./getWallet.js");
|
|
19
|
+
const setWallet_js_1 = require("./setWallet.js");
|
|
17
20
|
exports.utilityTools = [
|
|
18
21
|
createWallet_js_1.createWalletTool,
|
|
19
22
|
getAddress_js_1.getAddressTool,
|
|
@@ -25,5 +28,8 @@ exports.utilityTools = [
|
|
|
25
28
|
getCacheInfo_js_1.getCacheInfoTool,
|
|
26
29
|
clearCache_js_1.clearCacheTool,
|
|
27
30
|
getVersion_js_1.getVersionTool,
|
|
31
|
+
hasWallet_js_1.hasWalletTool,
|
|
32
|
+
getWallet_js_1.getWalletTool,
|
|
33
|
+
setWallet_js_1.setWalletTool,
|
|
28
34
|
];
|
|
29
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAqD;AACrD,mDAAiD;AACjD,mEAAiE;AACjE,iDAA+C;AAC/C,iEAA+D;AAC/D,6DAA2D;AAC3D,+DAA6D;AAC7D,uDAAqD;AACrD,mDAAiD;AACjD,mDAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAqD;AACrD,mDAAiD;AACjD,mEAAiE;AACjE,iDAA+C;AAC/C,iEAA+D;AAC/D,6DAA2D;AAC3D,+DAA6D;AAC7D,uDAAqD;AACrD,mDAAiD;AACjD,mDAAiD;AACjD,iDAA+C;AAC/C,iDAA+C;AAC/C,iDAA+C;AAElC,QAAA,YAAY,GAAG;IAC1B,kCAAgB;IAChB,8BAAc;IACd,8CAAsB;IACtB,4BAAa;IACb,4CAAqB;IACrB,wCAAmB;IACnB,0CAAoB;IACpB,kCAAgB;IAChB,8BAAc;IACd,8BAAc;IACd,4BAAa;IACb,4BAAa;IACb,4BAAa;CACd,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set Wallet Tool
|
|
3
|
+
*
|
|
4
|
+
* Configures a wallet for signing operations.
|
|
5
|
+
* Takes a private key string and sets it as the active wallet in the SDK.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setWalletTool: import("../../types/mcp.js").MCPTool;
|
|
8
|
+
//# sourceMappingURL=setWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWallet.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/setWallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,eAAO,MAAM,aAAa,sCA8BxB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Set Wallet Tool
|
|
4
|
+
*
|
|
5
|
+
* Configures a wallet for signing operations.
|
|
6
|
+
* Takes a private key string and sets it as the active wallet in the SDK.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.setWalletTool = void 0;
|
|
10
|
+
const tool_factory_js_1 = require("../../utils/tool-factory.js");
|
|
11
|
+
const launchpad_sdk_1 = require("@gala-chain/launchpad-sdk");
|
|
12
|
+
exports.setWalletTool = (0, tool_factory_js_1.createFetchTool)({
|
|
13
|
+
name: 'gala_launchpad_set_wallet',
|
|
14
|
+
description: 'Configure a wallet for signing operations. Takes a private key and sets it as the active wallet.',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
privateKey: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Private key (0x prefixed hexadecimal string) to configure as the active wallet',
|
|
21
|
+
pattern: '^0x[a-fA-F0-9]{64}$',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: ['privateKey'],
|
|
25
|
+
},
|
|
26
|
+
handler: async (sdk, args) => {
|
|
27
|
+
const privateKey = args.privateKey;
|
|
28
|
+
// Create wallet from private key
|
|
29
|
+
const generatedWallet = (0, launchpad_sdk_1.createWallet)(privateKey);
|
|
30
|
+
// Set the wallet on the SDK
|
|
31
|
+
sdk.setWallet(generatedWallet.wallet);
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
message: 'Wallet configured successfully',
|
|
35
|
+
address: generatedWallet.wallet.address,
|
|
36
|
+
walletConfigured: sdk.hasWallet(),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=setWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWallet.js","sourceRoot":"","sources":["../../../src/tools/utils/setWallet.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAA8D;AAC9D,6DAAyD;AAE5C,QAAA,aAAa,GAAG,IAAA,iCAAe,EAAC;IAC3C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,kGAAkG;IAC/G,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gFAAgF;gBAC7F,OAAO,EAAE,qBAAqB;aAC/B;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;KACzB;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAoB,CAAC;QAE7C,iCAAiC;QACjC,MAAM,eAAe,GAAG,IAAA,4BAAY,EAAC,UAAU,CAAC,CAAC;QAEjD,4BAA4B;QAC5B,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEtC,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,gCAAgC;YACzC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,OAAO;YACvC,gBAAgB,EAAE,GAAG,CAAC,SAAS,EAAE;SAClC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|