megalaunch-mcp 1.0.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.
Files changed (3) hide show
  1. package/README.md +99 -0
  2. package/index.js +256 -0
  3. package/package.json +35 -0
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # MegaLaunch MCP Server
2
+
3
+ MCP (Model Context Protocol) server for **MegaLaunch** — an AI-powered meme token launch service on Solana. This server allows AI tools like Claude Desktop, Cursor, Windsurf, and others to discover and use MegaLaunch directly.
4
+
5
+ ## Tools
6
+
7
+ | Tool | Description |
8
+ |------|-------------|
9
+ | `megalaunch_status` | Check service status and recent launch statistics |
10
+ | `megalaunch_pricing` | Get current pricing for Basic and Premium packages |
11
+ | `megalaunch_create_order` | Create a new meme token launch order on pump.fun |
12
+ | `megalaunch_list_orders` | List your token launch orders with optional filters |
13
+ | `megalaunch_get_order` | Get detailed status of a specific order |
14
+ | `megalaunch_cancel_order` | Cancel a pending (unpaid) order |
15
+
16
+ ## Configuration
17
+
18
+ ### Claude Desktop
19
+
20
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "megalaunch": {
26
+ "command": "node",
27
+ "args": ["/path/to/mcp-server/index.js"],
28
+ "env": {
29
+ "MEGALAUNCH_API_KEY": "ml_your_api_key_here"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ### Cursor
37
+
38
+ Add to `.cursor/mcp.json` in your project root or `~/.cursor/mcp.json` globally:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "megalaunch": {
44
+ "command": "node",
45
+ "args": ["/path/to/mcp-server/index.js"],
46
+ "env": {
47
+ "MEGALAUNCH_API_KEY": "ml_your_api_key_here"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ### Windsurf
55
+
56
+ Add to `~/.codeium/windsurf/mcp_config.json`:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "megalaunch": {
62
+ "command": "node",
63
+ "args": ["/path/to/mcp-server/index.js"],
64
+ "env": {
65
+ "MEGALAUNCH_API_KEY": "ml_your_api_key_here"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### Claude Code
73
+
74
+ ```bash
75
+ claude mcp add megalaunch -- node /path/to/mcp-server/index.js
76
+ ```
77
+
78
+ Set the API key as an environment variable before launching Claude Code, or add it to your shell profile:
79
+
80
+ ```bash
81
+ export MEGALAUNCH_API_KEY="ml_your_api_key_here"
82
+ ```
83
+
84
+ ## Environment Variables
85
+
86
+ | Variable | Required | Default | Description |
87
+ |----------|----------|---------|-------------|
88
+ | `MEGALAUNCH_API_KEY` | Yes (for authenticated endpoints) | — | Your MegaLaunch API key |
89
+ | `MEGALAUNCH_API_URL` | No | `https://vernal.zylos.coco.xyz/megalaunch` | API base URL |
90
+
91
+ ## Development
92
+
93
+ ```bash
94
+ # Install dependencies
95
+ npm install
96
+
97
+ # Test server startup (sends an MCP initialize request)
98
+ echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' | MEGALAUNCH_API_KEY=test node index.js
99
+ ```
package/index.js ADDED
@@ -0,0 +1,256 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod/v4";
5
+
6
+ // ---------------------------------------------------------------------------
7
+ // Configuration
8
+ // ---------------------------------------------------------------------------
9
+
10
+ const API_URL = (process.env.MEGALAUNCH_API_URL || "https://vernal.zylos.coco.xyz/megalaunch")
11
+ .replace(/\/+$/, ""); // strip trailing slashes
12
+
13
+ const API_KEY = process.env.MEGALAUNCH_API_KEY || "";
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Helpers
17
+ // ---------------------------------------------------------------------------
18
+
19
+ /**
20
+ * Make a request to the MegaLaunch REST API.
21
+ */
22
+ async function apiRequest(method, path, body) {
23
+ const url = `${API_URL}/api/v1${path}`;
24
+
25
+ const headers = {
26
+ "Content-Type": "application/json",
27
+ "Accept": "application/json",
28
+ };
29
+
30
+ if (API_KEY) {
31
+ headers["Authorization"] = `Bearer ${API_KEY}`;
32
+ }
33
+
34
+ const opts = { method, headers };
35
+ if (body !== undefined) {
36
+ opts.body = JSON.stringify(body);
37
+ }
38
+
39
+ const res = await fetch(url, opts);
40
+
41
+ let data;
42
+ const text = await res.text();
43
+ try {
44
+ data = JSON.parse(text);
45
+ } catch {
46
+ data = { raw: text };
47
+ }
48
+
49
+ if (!res.ok) {
50
+ const msg = data?.error || data?.message || `HTTP ${res.status}`;
51
+ throw new Error(`MegaLaunch API error: ${msg}`);
52
+ }
53
+
54
+ return data;
55
+ }
56
+
57
+ /**
58
+ * Format an API response as MCP tool result content.
59
+ */
60
+ function jsonResult(data) {
61
+ return {
62
+ content: [
63
+ {
64
+ type: "text",
65
+ text: JSON.stringify(data, null, 2),
66
+ },
67
+ ],
68
+ };
69
+ }
70
+
71
+ /**
72
+ * Format an error as MCP tool error result.
73
+ */
74
+ function errorResult(err) {
75
+ return {
76
+ content: [
77
+ {
78
+ type: "text",
79
+ text: err instanceof Error ? err.message : String(err),
80
+ },
81
+ ],
82
+ isError: true,
83
+ };
84
+ }
85
+
86
+ // ---------------------------------------------------------------------------
87
+ // MCP Server
88
+ // ---------------------------------------------------------------------------
89
+
90
+ const server = new McpServer({
91
+ name: "megalaunch",
92
+ version: "1.0.0",
93
+ description:
94
+ "MegaLaunch \u2014 AI-powered meme token launch service on Solana. Create tokens on pump.fun with AI-generated art, bundled buys, and Jito-powered speed.",
95
+ });
96
+
97
+ // ---------------------------------------------------------------------------
98
+ // Tool: megalaunch_status
99
+ // ---------------------------------------------------------------------------
100
+
101
+ server.registerTool("megalaunch_status", {
102
+ description: "Check MegaLaunch service status and recent launch statistics",
103
+ }, async () => {
104
+ try {
105
+ const data = await apiRequest("GET", "/status");
106
+ return jsonResult(data);
107
+ } catch (err) {
108
+ return errorResult(err);
109
+ }
110
+ });
111
+
112
+ // ---------------------------------------------------------------------------
113
+ // Tool: megalaunch_pricing
114
+ // ---------------------------------------------------------------------------
115
+
116
+ server.registerTool("megalaunch_pricing", {
117
+ description: "Get current pricing for token launch packages (Basic and Premium)",
118
+ }, async () => {
119
+ try {
120
+ const data = await apiRequest("GET", "/pricing");
121
+ return jsonResult(data);
122
+ } catch (err) {
123
+ return errorResult(err);
124
+ }
125
+ });
126
+
127
+ // ---------------------------------------------------------------------------
128
+ // Tool: megalaunch_create_order
129
+ // ---------------------------------------------------------------------------
130
+
131
+ server.registerTool("megalaunch_create_order", {
132
+ description:
133
+ "Create a new meme token launch order on Solana/pump.fun. Returns deposit address and amount to send.",
134
+ inputSchema: {
135
+ package: z.enum(["basic", "premium"]).describe('Launch package: "basic" or "premium"'),
136
+ tokenName: z.string().optional().describe("Custom token name"),
137
+ tokenSymbol: z
138
+ .string()
139
+ .min(1)
140
+ .max(10)
141
+ .optional()
142
+ .describe("Custom token symbol (1-10 characters)"),
143
+ tokenDescription: z.string().optional().describe("Token description"),
144
+ aiPick: z
145
+ .boolean()
146
+ .optional()
147
+ .describe("Let AI choose a trending name/symbol"),
148
+ theme: z
149
+ .enum(["war", "money", "hype", "animal", "fire", "ice"])
150
+ .optional()
151
+ .describe("Theme for AI-generated token identity"),
152
+ },
153
+ }, async (args) => {
154
+ try {
155
+ const body = { package: args.package };
156
+ if (args.tokenName !== undefined) body.tokenName = args.tokenName;
157
+ if (args.tokenSymbol !== undefined) body.tokenSymbol = args.tokenSymbol;
158
+ if (args.tokenDescription !== undefined) body.tokenDescription = args.tokenDescription;
159
+ if (args.aiPick !== undefined) body.aiPick = args.aiPick;
160
+ if (args.theme !== undefined) body.theme = args.theme;
161
+
162
+ const data = await apiRequest("POST", "/orders", body);
163
+ return jsonResult(data);
164
+ } catch (err) {
165
+ return errorResult(err);
166
+ }
167
+ });
168
+
169
+ // ---------------------------------------------------------------------------
170
+ // Tool: megalaunch_list_orders
171
+ // ---------------------------------------------------------------------------
172
+
173
+ server.registerTool("megalaunch_list_orders", {
174
+ description: "List your token launch orders with optional status filter",
175
+ inputSchema: {
176
+ status: z.string().optional().describe("Filter by order status"),
177
+ limit: z
178
+ .number()
179
+ .int()
180
+ .min(1)
181
+ .max(100)
182
+ .optional()
183
+ .describe("Maximum number of results (1-100)"),
184
+ offset: z
185
+ .number()
186
+ .int()
187
+ .min(0)
188
+ .optional()
189
+ .describe("Pagination offset"),
190
+ },
191
+ }, async (args) => {
192
+ try {
193
+ const params = new URLSearchParams();
194
+ if (args.status) params.set("status", args.status);
195
+ if (args.limit !== undefined) params.set("limit", String(args.limit));
196
+ if (args.offset !== undefined) params.set("offset", String(args.offset));
197
+
198
+ const qs = params.toString();
199
+ const path = qs ? `/orders?${qs}` : "/orders";
200
+
201
+ const data = await apiRequest("GET", path);
202
+ return jsonResult(data);
203
+ } catch (err) {
204
+ return errorResult(err);
205
+ }
206
+ });
207
+
208
+ // ---------------------------------------------------------------------------
209
+ // Tool: megalaunch_get_order
210
+ // ---------------------------------------------------------------------------
211
+
212
+ server.registerTool("megalaunch_get_order", {
213
+ description: "Get detailed status of a specific token launch order",
214
+ inputSchema: {
215
+ orderId: z.string().describe("The order ID to look up"),
216
+ },
217
+ }, async ({ orderId }) => {
218
+ try {
219
+ const data = await apiRequest("GET", `/orders/${encodeURIComponent(orderId)}`);
220
+ return jsonResult(data);
221
+ } catch (err) {
222
+ return errorResult(err);
223
+ }
224
+ });
225
+
226
+ // ---------------------------------------------------------------------------
227
+ // Tool: megalaunch_cancel_order
228
+ // ---------------------------------------------------------------------------
229
+
230
+ server.registerTool("megalaunch_cancel_order", {
231
+ description: "Cancel a pending token launch order (only works for unpaid orders)",
232
+ inputSchema: {
233
+ orderId: z.string().describe("The order ID to cancel"),
234
+ },
235
+ }, async ({ orderId }) => {
236
+ try {
237
+ const data = await apiRequest("POST", `/orders/${encodeURIComponent(orderId)}/cancel`);
238
+ return jsonResult(data);
239
+ } catch (err) {
240
+ return errorResult(err);
241
+ }
242
+ });
243
+
244
+ // ---------------------------------------------------------------------------
245
+ // Start
246
+ // ---------------------------------------------------------------------------
247
+
248
+ async function main() {
249
+ const transport = new StdioServerTransport();
250
+ await server.connect(transport);
251
+ }
252
+
253
+ main().catch((err) => {
254
+ console.error("MCP server fatal error:", err);
255
+ process.exit(1);
256
+ });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "megalaunch-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for MegaLaunch — AI-powered meme token launch service on Solana/pump.fun. Launch tokens with AI art, bundled buys, and Jito speed.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "megalaunch-mcp": "./index.js"
9
+ },
10
+ "files": [
11
+ "index.js",
12
+ "README.md"
13
+ ],
14
+ "keywords": [
15
+ "mcp",
16
+ "mcp-server",
17
+ "solana",
18
+ "pump-fun",
19
+ "meme-coin",
20
+ "token-launch",
21
+ "ai-agent",
22
+ "megalaunch"
23
+ ],
24
+ "scripts": {
25
+ "start": "node index.js"
26
+ },
27
+ "dependencies": {
28
+ "@modelcontextprotocol/sdk": "^1.12.1"
29
+ },
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/megalaunch/megalaunch-mcp.git"
34
+ }
35
+ }