nana800-mcp-server 1.0.4 → 1.1.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/LICENSE +22 -0
- package/README.md +10 -6
- package/dist/index.js +92 -117
- package/package.json +16 -18
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bekender
|
|
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.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -85,6 +85,9 @@ Add to your extension settings:
|
|
|
85
85
|
| `MCP_API_KEY` | Yes | Your nana800.io API key |
|
|
86
86
|
| `MCP_PROJECT_ID` | No | Default project ID (can be overridden per tool call) |
|
|
87
87
|
| `MCP_SCHEME_ID` | No | Default scheme ID (can be overridden per tool call) |
|
|
88
|
+
| `MCP_API_URL` | No | API origin, `https://api.nana800.io` by default |
|
|
89
|
+
|
|
90
|
+
Every API request has a 30 second timeout. Requires Node.js 18 or newer.
|
|
88
91
|
|
|
89
92
|
## Available Tools
|
|
90
93
|
|
|
@@ -105,7 +108,7 @@ Add to your extension settings:
|
|
|
105
108
|
| `scheme_create` | Create a new scheme (workflow) |
|
|
106
109
|
| `scheme_get` | Get scheme details |
|
|
107
110
|
| `scheme_list_by_project` | List all schemes in a project |
|
|
108
|
-
| `scheme_update` | Update scheme
|
|
111
|
+
| `scheme_update` | Update scheme name, description and enable or disable it |
|
|
109
112
|
| `scheme_delete` | Delete a scheme |
|
|
110
113
|
| `scheme_export` | Export scheme as JSON |
|
|
111
114
|
| `scheme_import` | Import nodes into a scheme |
|
|
@@ -116,6 +119,7 @@ Add to your extension settings:
|
|
|
116
119
|
|
|
117
120
|
| Tool | Description |
|
|
118
121
|
|------|-------------|
|
|
122
|
+
| `get_nodes_info` | List available trigger and action types with their configuration |
|
|
119
123
|
| `node_create_trigger` | Create a trigger node |
|
|
120
124
|
| `node_create_action` | Create an action node |
|
|
121
125
|
| `node_get` | Get node details |
|
|
@@ -123,7 +127,7 @@ Add to your extension settings:
|
|
|
123
127
|
| `node_update` | Update node properties |
|
|
124
128
|
| `node_update_config` | Update node configuration |
|
|
125
129
|
| `node_delete` | Delete a node |
|
|
126
|
-
| `node_connect` | Connect two nodes |
|
|
130
|
+
| `node_connect` | Connect two nodes (for condition nodes `connection_index` 0 is the "true" output, 1 is the "false" output) |
|
|
127
131
|
| `node_disconnect` | Disconnect two nodes |
|
|
128
132
|
| `node_copy` | Copy a node |
|
|
129
133
|
| `node_get_scheme_edges` | Get all connections in a scheme |
|
|
@@ -134,7 +138,7 @@ Add to your extension settings:
|
|
|
134
138
|
| Tool | Description |
|
|
135
139
|
|------|-------------|
|
|
136
140
|
| `node_process_get` | Get node process details |
|
|
137
|
-
| `node_process_list_filtered` | List node processes
|
|
141
|
+
| `node_process_list_filtered` | List node processes, filter by scheme, node or scheme process is required |
|
|
138
142
|
| `node_process_delete` | Delete a node process record |
|
|
139
143
|
|
|
140
144
|
### Scheme Process Management
|
|
@@ -142,7 +146,7 @@ Add to your extension settings:
|
|
|
142
146
|
| Tool | Description |
|
|
143
147
|
|------|-------------|
|
|
144
148
|
| `scheme_process_get` | Get scheme process details |
|
|
145
|
-
| `scheme_process_list_filtered` | List scheme processes
|
|
149
|
+
| `scheme_process_list_filtered` | List scheme processes, filter by scheme or project is required |
|
|
146
150
|
| `scheme_process_delete` | Delete a scheme process record |
|
|
147
151
|
|
|
148
152
|
### Payment Account Management
|
|
@@ -151,7 +155,7 @@ Add to your extension settings:
|
|
|
151
155
|
|------|-------------|
|
|
152
156
|
| `payment_account_get_by_user` | Get payment account by user ID |
|
|
153
157
|
| `payment_account_get_by_project` | Get payment account by project ID |
|
|
154
|
-
| `payment_account_update` | Update payment account
|
|
158
|
+
| `payment_account_update` | Update payment account name and automatic balance refill |
|
|
155
159
|
| `payment_account_remove` | Remove payment account |
|
|
156
160
|
| `payment_account_get_transactions` | Get transaction history |
|
|
157
161
|
|
|
@@ -168,7 +172,7 @@ Once configured, you can ask your AI assistant things like:
|
|
|
168
172
|
|
|
169
173
|
## API Documentation
|
|
170
174
|
|
|
171
|
-
Full API documentation available at: [https://api.nana800.io/
|
|
175
|
+
Full API documentation available at: [https://api.nana800.io/public-api](https://api.nana800.io/public-api)
|
|
172
176
|
|
|
173
177
|
## License
|
|
174
178
|
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,10 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
// src/api-client.ts
|
|
11
|
-
var API_BASE_URL = "https://api.nana800.io";
|
|
11
|
+
var API_BASE_URL = (process.env.MCP_API_URL || "https://api.nana800.io").replace(/\/+$/, "");
|
|
12
12
|
var API_KEY_HEADER = "x-nana-api-key";
|
|
13
|
+
var REQUEST_TIMEOUT_MS = 3e4;
|
|
14
|
+
var MAX_ERROR_TEXT_LENGTH = 2e3;
|
|
13
15
|
var DEFAULT_PROJECT_ID = process.env.MCP_PROJECT_ID || "";
|
|
14
16
|
var DEFAULT_SCHEME_ID = process.env.MCP_SCHEME_ID || "";
|
|
15
17
|
var getProjectId = (providedId) => {
|
|
@@ -26,95 +28,65 @@ var getSchemeId = (providedId) => {
|
|
|
26
28
|
}
|
|
27
29
|
return id;
|
|
28
30
|
};
|
|
31
|
+
var apiPath = (strings, ...values) => {
|
|
32
|
+
return strings.reduce((path, part, index) => path + part + (index < values.length ? encodeURIComponent(values[index]) : ""), "");
|
|
33
|
+
};
|
|
34
|
+
var getErrorMessage = (error) => {
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
return error.name === "TimeoutError" || error.name === "AbortError" ? `request timed out after ${REQUEST_TIMEOUT_MS / 1e3}s` : error.message;
|
|
37
|
+
}
|
|
38
|
+
return "Unknown error";
|
|
39
|
+
};
|
|
29
40
|
var ApiClient = class {
|
|
30
41
|
apiKey;
|
|
31
42
|
constructor(apiKey) {
|
|
32
43
|
this.apiKey = apiKey;
|
|
33
44
|
}
|
|
34
|
-
|
|
45
|
+
get(path, queryParams) {
|
|
46
|
+
return this.request("GET", path, { query: queryParams });
|
|
47
|
+
}
|
|
48
|
+
post(path, body) {
|
|
49
|
+
return this.request("POST", path, { body });
|
|
50
|
+
}
|
|
51
|
+
put(path, body) {
|
|
52
|
+
return this.request("PUT", path, { body });
|
|
53
|
+
}
|
|
54
|
+
delete(path) {
|
|
55
|
+
return this.request("DELETE", path, {});
|
|
56
|
+
}
|
|
57
|
+
async request(method, path, { query, body }) {
|
|
35
58
|
try {
|
|
36
59
|
const url = new URL(`${API_BASE_URL}${path}`);
|
|
37
|
-
if (
|
|
38
|
-
Object.entries(
|
|
60
|
+
if (query) {
|
|
61
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
39
62
|
if (value !== void 0) {
|
|
40
63
|
url.searchParams.append(key, String(value));
|
|
41
64
|
}
|
|
42
65
|
});
|
|
43
66
|
}
|
|
44
67
|
const response = await fetch(url.toString(), {
|
|
45
|
-
method
|
|
46
|
-
headers: {
|
|
47
|
-
[API_KEY_HEADER]: this.apiKey,
|
|
48
|
-
"Content-Type": "application/json"
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
if (!response.ok) {
|
|
52
|
-
const errorText = await response.text();
|
|
53
|
-
return { success: false, error: `HTTP ${response.status}: ${errorText}` };
|
|
54
|
-
}
|
|
55
|
-
const data = await response.json();
|
|
56
|
-
return { success: true, data };
|
|
57
|
-
} catch (error) {
|
|
58
|
-
return { success: false, error: error instanceof Error ? error.message : "Unknown error" };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async post(path, body) {
|
|
62
|
-
try {
|
|
63
|
-
const response = await fetch(`${API_BASE_URL}${path}`, {
|
|
64
|
-
method: "POST",
|
|
68
|
+
method,
|
|
65
69
|
headers: {
|
|
66
70
|
[API_KEY_HEADER]: this.apiKey,
|
|
67
71
|
"Content-Type": "application/json"
|
|
68
72
|
},
|
|
69
|
-
body: body ? JSON.stringify(body) : void 0
|
|
73
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
74
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
70
75
|
});
|
|
76
|
+
const text = await response.text();
|
|
71
77
|
if (!response.ok) {
|
|
72
|
-
|
|
73
|
-
return { success: false, error: `HTTP ${response.status}: ${errorText}` };
|
|
78
|
+
return { success: false, error: `HTTP ${response.status}: ${text.slice(0, MAX_ERROR_TEXT_LENGTH)}` };
|
|
74
79
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} catch (error) {
|
|
78
|
-
return { success: false, error: error instanceof Error ? error.message : "Unknown error" };
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
async put(path, body) {
|
|
82
|
-
try {
|
|
83
|
-
const response = await fetch(`${API_BASE_URL}${path}`, {
|
|
84
|
-
method: "PUT",
|
|
85
|
-
headers: {
|
|
86
|
-
[API_KEY_HEADER]: this.apiKey,
|
|
87
|
-
"Content-Type": "application/json"
|
|
88
|
-
},
|
|
89
|
-
body: body ? JSON.stringify(body) : void 0
|
|
90
|
-
});
|
|
91
|
-
if (!response.ok) {
|
|
92
|
-
const errorText = await response.text();
|
|
93
|
-
return { success: false, error: `HTTP ${response.status}: ${errorText}` };
|
|
80
|
+
if (!text) {
|
|
81
|
+
return { success: true, data: null };
|
|
94
82
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async delete(path) {
|
|
102
|
-
try {
|
|
103
|
-
const response = await fetch(`${API_BASE_URL}${path}`, {
|
|
104
|
-
method: "DELETE",
|
|
105
|
-
headers: {
|
|
106
|
-
[API_KEY_HEADER]: this.apiKey,
|
|
107
|
-
"Content-Type": "application/json"
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
if (!response.ok) {
|
|
111
|
-
const errorText = await response.text();
|
|
112
|
-
return { success: false, error: `HTTP ${response.status}: ${errorText}` };
|
|
83
|
+
try {
|
|
84
|
+
return { success: true, data: JSON.parse(text) };
|
|
85
|
+
} catch {
|
|
86
|
+
return { success: true, data: text };
|
|
113
87
|
}
|
|
114
|
-
const data = await response.json();
|
|
115
|
-
return { success: true, data };
|
|
116
88
|
} catch (error) {
|
|
117
|
-
return { success: false, error: error
|
|
89
|
+
return { success: false, error: getErrorMessage(error) };
|
|
118
90
|
}
|
|
119
91
|
}
|
|
120
92
|
};
|
|
@@ -158,7 +130,7 @@ var registerProjectTools = (server) => {
|
|
|
158
130
|
try {
|
|
159
131
|
const resolvedProjectId = getProjectId(project_id);
|
|
160
132
|
const client = getApiClient();
|
|
161
|
-
const result = await client.get(`/project/get/${resolvedProjectId}`);
|
|
133
|
+
const result = await client.get(apiPath`/project/get/${resolvedProjectId}`);
|
|
162
134
|
return {
|
|
163
135
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
164
136
|
};
|
|
@@ -177,7 +149,7 @@ var registerProjectTools = (server) => {
|
|
|
177
149
|
},
|
|
178
150
|
async ({ payment_account_id }) => {
|
|
179
151
|
const client = getApiClient();
|
|
180
|
-
const result = await client.get(`/project/get_list_by_payment_account/${payment_account_id}`);
|
|
152
|
+
const result = await client.get(apiPath`/project/get_list_by_payment_account/${payment_account_id}`);
|
|
181
153
|
return {
|
|
182
154
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
183
155
|
};
|
|
@@ -198,7 +170,7 @@ var registerProjectTools = (server) => {
|
|
|
198
170
|
const body = {};
|
|
199
171
|
if (project_name) body.project_name = project_name;
|
|
200
172
|
if (project_slug) body.project_slug = project_slug;
|
|
201
|
-
const result = await client.put(`/project/update/${resolvedProjectId}`, body);
|
|
173
|
+
const result = await client.put(apiPath`/project/update/${resolvedProjectId}`, body);
|
|
202
174
|
return {
|
|
203
175
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
204
176
|
};
|
|
@@ -219,7 +191,7 @@ var registerProjectTools = (server) => {
|
|
|
219
191
|
try {
|
|
220
192
|
const resolvedProjectId = getProjectId(project_id);
|
|
221
193
|
const client = getApiClient();
|
|
222
|
-
const result = await client.delete(`/project/delete/${resolvedProjectId}`);
|
|
194
|
+
const result = await client.delete(apiPath`/project/delete/${resolvedProjectId}`);
|
|
223
195
|
return {
|
|
224
196
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
225
197
|
};
|
|
@@ -263,18 +235,18 @@ var registerSchemeTools = (server) => {
|
|
|
263
235
|
{
|
|
264
236
|
scheme_id: z2.string().optional().describe("The unique ID of the scheme to update (uses MCP_SCHEME_ID env if not provided)"),
|
|
265
237
|
scheme_name: z2.string().optional().describe("New name for the scheme"),
|
|
266
|
-
|
|
267
|
-
|
|
238
|
+
description: z2.string().optional().describe("New description for the scheme"),
|
|
239
|
+
enabled: z2.boolean().optional().describe("Enable or disable the scheme")
|
|
268
240
|
},
|
|
269
|
-
async ({ scheme_id, scheme_name,
|
|
241
|
+
async ({ scheme_id, scheme_name, description, enabled }) => {
|
|
270
242
|
try {
|
|
271
243
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
272
244
|
const client = getApiClient();
|
|
273
245
|
const body = {};
|
|
274
246
|
if (scheme_name !== void 0) body.scheme_name = scheme_name;
|
|
275
|
-
if (
|
|
276
|
-
if (
|
|
277
|
-
const result = await client.put(`/scheme/update/${resolvedSchemeId}`, body);
|
|
247
|
+
if (description !== void 0) body.description = description;
|
|
248
|
+
if (enabled !== void 0) body.enabled = enabled;
|
|
249
|
+
const result = await client.put(apiPath`/scheme/update/${resolvedSchemeId}`, body);
|
|
278
250
|
return {
|
|
279
251
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
280
252
|
};
|
|
@@ -295,7 +267,7 @@ var registerSchemeTools = (server) => {
|
|
|
295
267
|
try {
|
|
296
268
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
297
269
|
const client = getApiClient();
|
|
298
|
-
const result = await client.get(`/scheme/get/${resolvedSchemeId}`);
|
|
270
|
+
const result = await client.get(apiPath`/scheme/get/${resolvedSchemeId}`);
|
|
299
271
|
return {
|
|
300
272
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
301
273
|
};
|
|
@@ -316,7 +288,7 @@ var registerSchemeTools = (server) => {
|
|
|
316
288
|
try {
|
|
317
289
|
const resolvedProjectId = getProjectId(project_id);
|
|
318
290
|
const client = getApiClient();
|
|
319
|
-
const result = await client.get(`/scheme/project_list/${resolvedProjectId}`);
|
|
291
|
+
const result = await client.get(apiPath`/scheme/project_list/${resolvedProjectId}`);
|
|
320
292
|
return {
|
|
321
293
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
322
294
|
};
|
|
@@ -337,7 +309,7 @@ var registerSchemeTools = (server) => {
|
|
|
337
309
|
try {
|
|
338
310
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
339
311
|
const client = getApiClient();
|
|
340
|
-
const result = await client.get(`/scheme/context_type/${resolvedSchemeId}`);
|
|
312
|
+
const result = await client.get(apiPath`/scheme/context_type/${resolvedSchemeId}`);
|
|
341
313
|
return {
|
|
342
314
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
343
315
|
};
|
|
@@ -358,7 +330,7 @@ var registerSchemeTools = (server) => {
|
|
|
358
330
|
try {
|
|
359
331
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
360
332
|
const client = getApiClient();
|
|
361
|
-
const result = await client.get(`/scheme/swagger_json/${resolvedSchemeId}`);
|
|
333
|
+
const result = await client.get(apiPath`/scheme/swagger_json/${resolvedSchemeId}`);
|
|
362
334
|
return {
|
|
363
335
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
364
336
|
};
|
|
@@ -379,7 +351,7 @@ var registerSchemeTools = (server) => {
|
|
|
379
351
|
try {
|
|
380
352
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
381
353
|
const client = getApiClient();
|
|
382
|
-
const result = await client.get(`/scheme/export/${resolvedSchemeId}`);
|
|
354
|
+
const result = await client.get(apiPath`/scheme/export/${resolvedSchemeId}`);
|
|
383
355
|
return {
|
|
384
356
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
385
357
|
};
|
|
@@ -409,7 +381,7 @@ var registerSchemeTools = (server) => {
|
|
|
409
381
|
content: [{ type: "text", text: JSON.stringify({ success: false, error: "Invalid JSON in nodes_list" }, null, 2) }]
|
|
410
382
|
};
|
|
411
383
|
}
|
|
412
|
-
const result = await client.post(`/scheme/import/${resolvedSchemeId}`, { nodes_list: parsedNodes });
|
|
384
|
+
const result = await client.post(apiPath`/scheme/import/${resolvedSchemeId}`, { nodes_list: parsedNodes });
|
|
413
385
|
return {
|
|
414
386
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
415
387
|
};
|
|
@@ -430,7 +402,7 @@ var registerSchemeTools = (server) => {
|
|
|
430
402
|
try {
|
|
431
403
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
432
404
|
const client = getApiClient();
|
|
433
|
-
const result = await client.delete(`/scheme/delete/${resolvedSchemeId}`);
|
|
405
|
+
const result = await client.delete(apiPath`/scheme/delete/${resolvedSchemeId}`);
|
|
434
406
|
return {
|
|
435
407
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
436
408
|
};
|
|
@@ -450,6 +422,9 @@ var getNodesInfo = async () => {
|
|
|
450
422
|
if (cachedNodesInfo) return cachedNodesInfo;
|
|
451
423
|
const client = getApiClient();
|
|
452
424
|
const response = await client.get("/info/nodes_info");
|
|
425
|
+
if (!response.success || !Array.isArray(response.data?.trigger_types) || !Array.isArray(response.data?.action_types)) {
|
|
426
|
+
throw new Error(`Failed to load available node types: ${response.error || "unexpected response"}`);
|
|
427
|
+
}
|
|
453
428
|
cachedNodesInfo = response.data;
|
|
454
429
|
return cachedNodesInfo;
|
|
455
430
|
};
|
|
@@ -561,7 +536,7 @@ var registerNodeTools = (server) => {
|
|
|
561
536
|
const body = {};
|
|
562
537
|
if (slug !== void 0) body.slug = slug;
|
|
563
538
|
if (description !== void 0) body.description = description;
|
|
564
|
-
const result = await client.put(`/node/update/${node_id}`, body);
|
|
539
|
+
const result = await client.put(apiPath`/node/update/${node_id}`, body);
|
|
565
540
|
return {
|
|
566
541
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
567
542
|
};
|
|
@@ -573,12 +548,14 @@ var registerNodeTools = (server) => {
|
|
|
573
548
|
{
|
|
574
549
|
node_from: z3.string().describe("The source node ID (execution flows from this node)"),
|
|
575
550
|
node_to: z3.string().describe("The target node ID (execution flows to this node)"),
|
|
576
|
-
|
|
551
|
+
connection_index: z3.number().int().min(0).optional().describe('Output of the source node to connect. For CONDITION nodes: 0 is the "true" output, 1 is the "false" output. Default 0'),
|
|
552
|
+
edge_type: z3.enum(["COMMON", "CONDITION", "SWITCH"]).optional().describe("Type of the connection, CONDITION for outputs of condition nodes")
|
|
577
553
|
},
|
|
578
|
-
async ({ node_from, node_to,
|
|
554
|
+
async ({ node_from, node_to, connection_index, edge_type }) => {
|
|
579
555
|
const client = getApiClient();
|
|
580
556
|
const body = { node_from, node_to };
|
|
581
|
-
if (
|
|
557
|
+
if (connection_index !== void 0) body.connection_index = connection_index;
|
|
558
|
+
if (edge_type !== void 0) body.edge_type = edge_type;
|
|
582
559
|
const result = await client.put("/node/connect_nodes", body);
|
|
583
560
|
return {
|
|
584
561
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
@@ -608,7 +585,7 @@ var registerNodeTools = (server) => {
|
|
|
608
585
|
},
|
|
609
586
|
async ({ node_id }) => {
|
|
610
587
|
const client = getApiClient();
|
|
611
|
-
const result = await client.get(`/node/find_existing_button_from/${node_id}`);
|
|
588
|
+
const result = await client.get(apiPath`/node/find_existing_button_from/${node_id}`);
|
|
612
589
|
return {
|
|
613
590
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
614
591
|
};
|
|
@@ -622,7 +599,7 @@ var registerNodeTools = (server) => {
|
|
|
622
599
|
},
|
|
623
600
|
async ({ node_id }) => {
|
|
624
601
|
const client = getApiClient();
|
|
625
|
-
const result = await client.post(`/node/copy_node_create/${node_id}`);
|
|
602
|
+
const result = await client.post(apiPath`/node/copy_node_create/${node_id}`);
|
|
626
603
|
return {
|
|
627
604
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
628
605
|
};
|
|
@@ -638,7 +615,7 @@ var registerNodeTools = (server) => {
|
|
|
638
615
|
try {
|
|
639
616
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
640
617
|
const client = getApiClient();
|
|
641
|
-
const result = await client.get(`/node/scheme_node_edges_list/${resolvedSchemeId}`);
|
|
618
|
+
const result = await client.get(apiPath`/node/scheme_node_edges_list/${resolvedSchemeId}`);
|
|
642
619
|
return {
|
|
643
620
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
644
621
|
};
|
|
@@ -657,7 +634,7 @@ var registerNodeTools = (server) => {
|
|
|
657
634
|
},
|
|
658
635
|
async ({ node_id }) => {
|
|
659
636
|
const client = getApiClient();
|
|
660
|
-
const result = await client.get(`/node/get/${node_id}`);
|
|
637
|
+
const result = await client.get(apiPath`/node/get/${node_id}`);
|
|
661
638
|
return {
|
|
662
639
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
663
640
|
};
|
|
@@ -680,7 +657,7 @@ var registerNodeTools = (server) => {
|
|
|
680
657
|
content: [{ type: "text", text: JSON.stringify({ success: false, error: "Invalid JSON in config" }, null, 2) }]
|
|
681
658
|
};
|
|
682
659
|
}
|
|
683
|
-
const result = await client.put(`/node/update_config/${node_id}`, parsedConfig);
|
|
660
|
+
const result = await client.put(apiPath`/node/update_config/${node_id}`, parsedConfig);
|
|
684
661
|
return {
|
|
685
662
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
686
663
|
};
|
|
@@ -696,7 +673,7 @@ var registerNodeTools = (server) => {
|
|
|
696
673
|
try {
|
|
697
674
|
const resolvedSchemeId = getSchemeId(scheme_id);
|
|
698
675
|
const client = getApiClient();
|
|
699
|
-
const result = await client.get(`/node/scheme_list/${resolvedSchemeId}`);
|
|
676
|
+
const result = await client.get(apiPath`/node/scheme_list/${resolvedSchemeId}`);
|
|
700
677
|
return {
|
|
701
678
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
702
679
|
};
|
|
@@ -715,7 +692,7 @@ var registerNodeTools = (server) => {
|
|
|
715
692
|
},
|
|
716
693
|
async ({ node_id }) => {
|
|
717
694
|
const client = getApiClient();
|
|
718
|
-
const result = await client.delete(`/node/delete/${node_id}`);
|
|
695
|
+
const result = await client.delete(apiPath`/node/delete/${node_id}`);
|
|
719
696
|
return {
|
|
720
697
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
721
698
|
};
|
|
@@ -734,7 +711,7 @@ var registerNodeProcessTools = (server) => {
|
|
|
734
711
|
},
|
|
735
712
|
async ({ node_process_id }) => {
|
|
736
713
|
const client = getApiClient();
|
|
737
|
-
const result = await client.get(`/node-process/get/${node_process_id}`);
|
|
714
|
+
const result = await client.get(apiPath`/node-process/get/${node_process_id}`);
|
|
738
715
|
return {
|
|
739
716
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
740
717
|
};
|
|
@@ -742,7 +719,7 @@ var registerNodeProcessTools = (server) => {
|
|
|
742
719
|
);
|
|
743
720
|
server.tool(
|
|
744
721
|
"node_process_list_filtered",
|
|
745
|
-
"Get filtered list of node processes with pagination",
|
|
722
|
+
"Get filtered list of node processes with pagination. At least one of scheme, node or scheme_process is required",
|
|
746
723
|
{
|
|
747
724
|
scheme: z4.string().optional().describe("Filter by scheme ID"),
|
|
748
725
|
node: z4.string().optional().describe("Filter by node ID"),
|
|
@@ -776,7 +753,7 @@ var registerNodeProcessTools = (server) => {
|
|
|
776
753
|
},
|
|
777
754
|
async ({ node_process_id }) => {
|
|
778
755
|
const client = getApiClient();
|
|
779
|
-
const result = await client.delete(`/node-process/delete/${node_process_id}`);
|
|
756
|
+
const result = await client.delete(apiPath`/node-process/delete/${node_process_id}`);
|
|
780
757
|
return {
|
|
781
758
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
782
759
|
};
|
|
@@ -795,7 +772,7 @@ var registerSchemeProcessTools = (server) => {
|
|
|
795
772
|
},
|
|
796
773
|
async ({ scheme_process_id }) => {
|
|
797
774
|
const client = getApiClient();
|
|
798
|
-
const result = await client.get(`/scheme-process/get/${scheme_process_id}`);
|
|
775
|
+
const result = await client.get(apiPath`/scheme-process/get/${scheme_process_id}`);
|
|
799
776
|
return {
|
|
800
777
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
801
778
|
};
|
|
@@ -803,7 +780,7 @@ var registerSchemeProcessTools = (server) => {
|
|
|
803
780
|
);
|
|
804
781
|
server.tool(
|
|
805
782
|
"scheme_process_list_filtered",
|
|
806
|
-
"Get filtered list of scheme processes (workflow executions) with pagination",
|
|
783
|
+
"Get filtered list of scheme processes (workflow executions) with pagination. At least one of scheme or project is required",
|
|
807
784
|
{
|
|
808
785
|
project: z5.string().optional().describe("Filter by project ID"),
|
|
809
786
|
scheme: z5.string().optional().describe("Filter by scheme ID"),
|
|
@@ -837,7 +814,7 @@ var registerSchemeProcessTools = (server) => {
|
|
|
837
814
|
},
|
|
838
815
|
async ({ scheme_process_id }) => {
|
|
839
816
|
const client = getApiClient();
|
|
840
|
-
const result = await client.delete(`/scheme-process/delete/${scheme_process_id}`);
|
|
817
|
+
const result = await client.delete(apiPath`/scheme-process/delete/${scheme_process_id}`);
|
|
841
818
|
return {
|
|
842
819
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
843
820
|
};
|
|
@@ -856,7 +833,7 @@ var registerPaymentAccountTools = (server) => {
|
|
|
856
833
|
},
|
|
857
834
|
async ({ user_id }) => {
|
|
858
835
|
const client = getApiClient();
|
|
859
|
-
const result = await client.delete(`/payment_account/remove_payment_account/${user_id}`);
|
|
836
|
+
const result = await client.delete(apiPath`/payment_account/remove_payment_account/${user_id}`);
|
|
860
837
|
return {
|
|
861
838
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
862
839
|
};
|
|
@@ -864,22 +841,20 @@ var registerPaymentAccountTools = (server) => {
|
|
|
864
841
|
);
|
|
865
842
|
server.tool(
|
|
866
843
|
"payment_account_update",
|
|
867
|
-
"Update payment account
|
|
844
|
+
"Update payment account settings: name and automatic balance refill",
|
|
868
845
|
{
|
|
869
846
|
user_id: z6.string().describe("The user ID"),
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
phone: z6.string().optional().describe("Phone number")
|
|
847
|
+
payment_account_name: z6.string().optional().describe("New name of the payment account"),
|
|
848
|
+
auto_money_refill_enabled: z6.boolean().optional().describe("Enable or disable automatic balance refill"),
|
|
849
|
+
auto_money_refill_amount: z6.number().optional().describe("Automatic refill amount in USD")
|
|
874
850
|
},
|
|
875
|
-
async ({ user_id,
|
|
851
|
+
async ({ user_id, payment_account_name, auto_money_refill_enabled, auto_money_refill_amount }) => {
|
|
876
852
|
const client = getApiClient();
|
|
877
853
|
const body = {};
|
|
878
|
-
if (
|
|
879
|
-
if (
|
|
880
|
-
if (
|
|
881
|
-
|
|
882
|
-
const result = await client.post(`/payment_account/update_payment_account/${user_id}`, body);
|
|
854
|
+
if (payment_account_name !== void 0) body.payment_account_name = payment_account_name;
|
|
855
|
+
if (auto_money_refill_enabled !== void 0) body.auto_money_refill_enabled = auto_money_refill_enabled;
|
|
856
|
+
if (auto_money_refill_amount !== void 0) body.auto_money_refill_amount = auto_money_refill_amount;
|
|
857
|
+
const result = await client.post(apiPath`/payment_account/update_payment_account/${user_id}`, body);
|
|
883
858
|
return {
|
|
884
859
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
885
860
|
};
|
|
@@ -893,7 +868,7 @@ var registerPaymentAccountTools = (server) => {
|
|
|
893
868
|
},
|
|
894
869
|
async ({ user_id }) => {
|
|
895
870
|
const client = getApiClient();
|
|
896
|
-
const result = await client.get(`/payment_account/get_user_payment_account/${user_id}`);
|
|
871
|
+
const result = await client.get(apiPath`/payment_account/get_user_payment_account/${user_id}`);
|
|
897
872
|
return {
|
|
898
873
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
899
874
|
};
|
|
@@ -907,7 +882,7 @@ var registerPaymentAccountTools = (server) => {
|
|
|
907
882
|
},
|
|
908
883
|
async ({ project_id }) => {
|
|
909
884
|
const client = getApiClient();
|
|
910
|
-
const result = await client.get(`/payment_account/get_project_payment_account/${project_id}`);
|
|
885
|
+
const result = await client.get(apiPath`/payment_account/get_project_payment_account/${project_id}`);
|
|
911
886
|
return {
|
|
912
887
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
913
888
|
};
|
|
@@ -921,7 +896,7 @@ var registerPaymentAccountTools = (server) => {
|
|
|
921
896
|
},
|
|
922
897
|
async ({ payment_account_id }) => {
|
|
923
898
|
const client = getApiClient();
|
|
924
|
-
const result = await client.get(`/payment_account/get_payment_account_transactions_history/${payment_account_id}`);
|
|
899
|
+
const result = await client.get(apiPath`/payment_account/get_payment_account_transactions_history/${payment_account_id}`);
|
|
925
900
|
return {
|
|
926
901
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
927
902
|
};
|
|
@@ -931,7 +906,7 @@ var registerPaymentAccountTools = (server) => {
|
|
|
931
906
|
|
|
932
907
|
// src/index.ts
|
|
933
908
|
var SERVER_NAME = "nana800-mcp-server";
|
|
934
|
-
var SERVER_VERSION = "1.
|
|
909
|
+
var SERVER_VERSION = "1.1.0";
|
|
935
910
|
var main = async () => {
|
|
936
911
|
const apiKey = process.env.MCP_API_KEY;
|
|
937
912
|
if (!apiKey) {
|
package/package.json
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nana800-mcp-server",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "MCP Server for nana800.io Public API - enables AI IDEs to interact with your no-code projects",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://nana800.io",
|
|
6
8
|
"files": [
|
|
7
9
|
"dist"
|
|
8
10
|
],
|
|
9
11
|
"bin": {
|
|
10
|
-
"nana800-mcp": "
|
|
12
|
+
"nana800-mcp": "dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18"
|
|
11
16
|
},
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
17
|
"scripts": {
|
|
14
18
|
"build": "node scripts/build.js",
|
|
15
|
-
"
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"prepublishOnly": "npm run build",
|
|
21
|
+
"release": "npm publish --access public"
|
|
16
22
|
},
|
|
17
23
|
"dependencies": {
|
|
18
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
19
|
-
"zod": "^
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
25
|
+
"zod": "^4.6.7"
|
|
20
26
|
},
|
|
21
27
|
"devDependencies": {
|
|
22
|
-
"@types/node": "^22.
|
|
23
|
-
"esbuild": "^0.
|
|
24
|
-
"typescript": "^5.
|
|
28
|
+
"@types/node": "^22.20.5",
|
|
29
|
+
"esbuild": "^0.28.2",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
25
31
|
},
|
|
26
32
|
"keywords": [
|
|
27
33
|
"mcp",
|
|
@@ -34,13 +40,5 @@
|
|
|
34
40
|
"low-code",
|
|
35
41
|
"automation",
|
|
36
42
|
"api"
|
|
37
|
-
]
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "https://github.com/nicenana800/nana800-mcp-server"
|
|
42
|
-
},
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=18.0.0"
|
|
45
|
-
}
|
|
43
|
+
]
|
|
46
44
|
}
|