@xano/developer-mcp 1.0.31 → 1.0.32
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/README.md +169 -6
- package/dist/index.d.ts +8 -0
- package/dist/index.js +14 -286
- package/dist/lib.d.ts +53 -0
- package/dist/lib.js +71 -0
- package/dist/tools/cli_docs.d.ts +40 -0
- package/dist/tools/cli_docs.js +68 -0
- package/dist/tools/index.d.ts +91 -0
- package/dist/tools/index.js +104 -0
- package/dist/tools/mcp_version.d.ts +45 -0
- package/dist/tools/mcp_version.js +94 -0
- package/dist/tools/meta_api_docs.d.ts +41 -0
- package/dist/tools/meta_api_docs.js +69 -0
- package/dist/tools/run_api_docs.d.ts +46 -0
- package/dist/tools/run_api_docs.js +69 -0
- package/dist/tools/types.d.ts +18 -0
- package/dist/tools/types.js +17 -0
- package/dist/tools/validate_xanoscript.d.ts +68 -0
- package/dist/tools/validate_xanoscript.js +114 -0
- package/dist/tools/xanoscript_docs.d.ts +72 -0
- package/dist/tools/xanoscript_docs.js +129 -0
- package/dist/xanoscript_docs/streaming.md +113 -91
- package/dist/xanoscript_docs/tasks.md +15 -7
- package/package.json +22 -3
|
@@ -8,32 +8,35 @@ Stream data from files, requests, and to API responses.
|
|
|
8
8
|
|
|
9
9
|
## Quick Reference
|
|
10
10
|
|
|
11
|
-
| Operation
|
|
12
|
-
|
|
13
|
-
| `stream.from_csv`
|
|
14
|
-
| `stream.from_jsonl`
|
|
15
|
-
| `stream.from_request` | Stream HTTP request body
|
|
16
|
-
| `api.stream`
|
|
11
|
+
| Operation | Purpose | Input |
|
|
12
|
+
| --------------------- | ------------------------- | -------------- |
|
|
13
|
+
| `stream.from_csv` | Parse CSV stream | File or string |
|
|
14
|
+
| `stream.from_jsonl` | Parse JSONL stream | File or string |
|
|
15
|
+
| `stream.from_request` | Stream HTTP request body | Request |
|
|
16
|
+
| `api.stream` | Stream response to client | Data |
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
## stream.from_csv
|
|
21
21
|
|
|
22
|
-
Parse CSV data as a stream
|
|
22
|
+
Parse CSV data as a stream. Returns a stream value (like a generator) that is then iterated with `foreach`.
|
|
23
23
|
|
|
24
24
|
```xs
|
|
25
25
|
stream.from_csv {
|
|
26
26
|
value = $input.csv_file
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} as $
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
separator = ","
|
|
28
|
+
enclosure = '"'
|
|
29
|
+
escape_char = '"'
|
|
30
|
+
} as $stream
|
|
31
|
+
|
|
32
|
+
foreach ($stream) {
|
|
33
|
+
each as $row {
|
|
34
|
+
db.add "import_record" {
|
|
35
|
+
data = {
|
|
36
|
+
name: $row.name,
|
|
37
|
+
email: $row.email,
|
|
38
|
+
created_at: now
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -41,13 +44,13 @@ stream.from_csv {
|
|
|
41
44
|
|
|
42
45
|
### Parameters
|
|
43
46
|
|
|
44
|
-
| Parameter
|
|
45
|
-
|
|
46
|
-
| `value`
|
|
47
|
-
| `headers`
|
|
48
|
-
| `
|
|
49
|
-
| `enclosure`
|
|
50
|
-
| `
|
|
47
|
+
| Parameter | Type | Default | Description |
|
|
48
|
+
| ------------- | --------- | -------- | -------------------------- |
|
|
49
|
+
| `value` | file/text | required | CSV file or string |
|
|
50
|
+
| `headers` | bool | `true` | First row contains headers |
|
|
51
|
+
| `separator` | text | `,` | Field separator |
|
|
52
|
+
| `enclosure` | text | `"` | Field enclosure character |
|
|
53
|
+
| `escape_char` | text | `"` | Escape character |
|
|
51
54
|
|
|
52
55
|
### With Custom Headers
|
|
53
56
|
|
|
@@ -55,10 +58,14 @@ stream.from_csv {
|
|
|
55
58
|
stream.from_csv {
|
|
56
59
|
value = $input.file
|
|
57
60
|
headers = false
|
|
58
|
-
} as $
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
} as $stream
|
|
62
|
+
|
|
63
|
+
foreach ($stream) {
|
|
64
|
+
each as $row {
|
|
65
|
+
// Access by index: $row.0, $row.1, etc.
|
|
66
|
+
var $name { value = $row.0 }
|
|
67
|
+
var $email { value = $row.1 }
|
|
68
|
+
}
|
|
62
69
|
}
|
|
63
70
|
```
|
|
64
71
|
|
|
@@ -66,18 +73,21 @@ stream.from_csv {
|
|
|
66
73
|
|
|
67
74
|
## stream.from_jsonl
|
|
68
75
|
|
|
69
|
-
Parse JSON Lines (newline-delimited JSON) as a stream.
|
|
76
|
+
Parse JSON Lines (newline-delimited JSON) as a stream. Returns a stream value iterated with `foreach`.
|
|
70
77
|
|
|
71
78
|
```xs
|
|
72
79
|
stream.from_jsonl {
|
|
73
80
|
value = $input.jsonl_file
|
|
74
|
-
} as $
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
} as $stream
|
|
82
|
+
|
|
83
|
+
foreach ($stream) {
|
|
84
|
+
each as $record {
|
|
85
|
+
db.add "event" {
|
|
86
|
+
data = {
|
|
87
|
+
event_type: $record.type,
|
|
88
|
+
payload: $record.data,
|
|
89
|
+
timestamp: $record.ts
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
}
|
|
@@ -85,9 +95,9 @@ stream.from_jsonl {
|
|
|
85
95
|
|
|
86
96
|
### Parameters
|
|
87
97
|
|
|
88
|
-
| Parameter | Type
|
|
89
|
-
|
|
90
|
-
| `value`
|
|
98
|
+
| Parameter | Type | Default | Description |
|
|
99
|
+
| --------- | --------- | -------- | -------------------- |
|
|
100
|
+
| `value` | file/text | required | JSONL file or string |
|
|
91
101
|
|
|
92
102
|
### Example JSONL Format
|
|
93
103
|
|
|
@@ -101,24 +111,27 @@ stream.from_jsonl {
|
|
|
101
111
|
|
|
102
112
|
## stream.from_request
|
|
103
113
|
|
|
104
|
-
Stream the incoming HTTP request body for large uploads.
|
|
114
|
+
Stream the incoming HTTP request body for large uploads. Returns a stream value iterated with `foreach`.
|
|
105
115
|
|
|
106
116
|
```xs
|
|
107
117
|
stream.from_request {
|
|
108
118
|
format = "jsonl"
|
|
109
|
-
} as $
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
} as $stream
|
|
120
|
+
|
|
121
|
+
foreach ($stream) {
|
|
122
|
+
each as $record {
|
|
123
|
+
db.add "log" { data = $record }
|
|
124
|
+
}
|
|
112
125
|
}
|
|
113
126
|
```
|
|
114
127
|
|
|
115
128
|
### Parameters
|
|
116
129
|
|
|
117
|
-
| Parameter
|
|
118
|
-
|
|
119
|
-
| `format`
|
|
120
|
-
| `headers`
|
|
121
|
-
| `
|
|
130
|
+
| Parameter | Type | Options | Description |
|
|
131
|
+
| ----------- | ---- | --------------------- | --------------- |
|
|
132
|
+
| `format` | text | `jsonl`, `csv`, `raw` | Body format |
|
|
133
|
+
| `headers` | bool | `true` (csv) | CSV has headers |
|
|
134
|
+
| `separator` | text | `,` (csv) | CSV separator |
|
|
122
135
|
|
|
123
136
|
### Raw Chunks
|
|
124
137
|
|
|
@@ -126,11 +139,14 @@ stream.from_request {
|
|
|
126
139
|
stream.from_request {
|
|
127
140
|
format = "raw"
|
|
128
141
|
chunk_size = 8192
|
|
129
|
-
} as $
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
142
|
+
} as $stream
|
|
143
|
+
|
|
144
|
+
foreach ($stream) {
|
|
145
|
+
each as $chunk {
|
|
146
|
+
storage.append_file {
|
|
147
|
+
pathname = "uploads/large_file.bin"
|
|
148
|
+
data = $chunk
|
|
149
|
+
}
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
152
|
```
|
|
@@ -207,12 +223,12 @@ query "live_updates" {
|
|
|
207
223
|
|
|
208
224
|
### Parameters
|
|
209
225
|
|
|
210
|
-
| Parameter
|
|
211
|
-
|
|
212
|
-
| `format`
|
|
213
|
-
| `value`
|
|
214
|
-
| `headers`
|
|
215
|
-
| `filename` | text
|
|
226
|
+
| Parameter | Type | Options | Description |
|
|
227
|
+
| ---------- | ------ | ---------------------------- | --------------------------- |
|
|
228
|
+
| `format` | text | `jsonl`, `csv`, `sse`, `raw` | Stream format |
|
|
229
|
+
| `value` | stream | optional | Data source for jsonl/csv |
|
|
230
|
+
| `headers` | text[] | optional | CSV column headers |
|
|
231
|
+
| `filename` | text | optional | Suggested download filename |
|
|
216
232
|
|
|
217
233
|
---
|
|
218
234
|
|
|
@@ -222,31 +238,35 @@ query "live_updates" {
|
|
|
222
238
|
|
|
223
239
|
```xs
|
|
224
240
|
function "import_large_csv" {
|
|
225
|
-
input {
|
|
226
|
-
file csv_file
|
|
227
|
-
}
|
|
241
|
+
input { file csv_file }
|
|
228
242
|
stack {
|
|
229
243
|
var $processed { value = 0 }
|
|
230
244
|
var $errors { value = [] }
|
|
231
245
|
|
|
232
246
|
stream.from_csv {
|
|
233
247
|
value = $input.csv_file
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
separator = ","
|
|
249
|
+
enclosure = '"'
|
|
250
|
+
escape_char = '"'
|
|
251
|
+
} as $stream
|
|
252
|
+
|
|
253
|
+
foreach ($stream) {
|
|
254
|
+
each as $row {
|
|
255
|
+
try_catch {
|
|
256
|
+
try {
|
|
257
|
+
db.add "record" {
|
|
258
|
+
data = {
|
|
259
|
+
name: $row.name|trim,
|
|
260
|
+
email: $row.email|trim|lower,
|
|
261
|
+
created_at: now
|
|
262
|
+
}
|
|
243
263
|
}
|
|
264
|
+
math.add $processed { value = 1 }
|
|
244
265
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
value = $errors|push:{ row: $processed, error: $error.message }
|
|
266
|
+
catch {
|
|
267
|
+
var.update $errors {
|
|
268
|
+
value = $errors|push:{ row: $processed, error: $error.message }
|
|
269
|
+
}
|
|
250
270
|
}
|
|
251
271
|
}
|
|
252
272
|
}
|
|
@@ -260,26 +280,28 @@ function "import_large_csv" {
|
|
|
260
280
|
|
|
261
281
|
```xs
|
|
262
282
|
function "etl_events" {
|
|
263
|
-
input {
|
|
264
|
-
file events_file
|
|
265
|
-
}
|
|
283
|
+
input { file events_file }
|
|
266
284
|
stack {
|
|
267
285
|
stream.from_jsonl {
|
|
268
286
|
value = $input.events_file
|
|
269
|
-
} as $
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
287
|
+
} as $stream
|
|
288
|
+
|
|
289
|
+
foreach ($stream) {
|
|
290
|
+
each as $event {
|
|
291
|
+
// Transform
|
|
292
|
+
var $transformed {
|
|
293
|
+
value = {
|
|
294
|
+
event_type: $event.type|to_lower,
|
|
295
|
+
user_id: $event.user_id|to_int,
|
|
296
|
+
metadata: $event.data|json_encode,
|
|
297
|
+
occurred_at: $event.timestamp|to_timestamp
|
|
298
|
+
}
|
|
277
299
|
}
|
|
278
|
-
}
|
|
279
300
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
301
|
+
// Load
|
|
302
|
+
db.add "processed_event" {
|
|
303
|
+
data = $transformed
|
|
304
|
+
}
|
|
283
305
|
}
|
|
284
306
|
}
|
|
285
307
|
}
|
|
@@ -17,13 +17,14 @@ task "<name>" {
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
### Common Frequencies
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
20
|
+
|
|
21
|
+
| Interval | Seconds |
|
|
22
|
+
| --------- | ------- |
|
|
23
|
+
| 1 minute | 60 |
|
|
24
|
+
| 5 minutes | 300 |
|
|
25
|
+
| 1 hour | 3600 |
|
|
26
|
+
| Daily | 86400 |
|
|
27
|
+
| Weekly | 604800 |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -57,11 +58,13 @@ task "daily_cleanup" {
|
|
|
57
58
|
## Schedule Configuration
|
|
58
59
|
|
|
59
60
|
### Single Event
|
|
61
|
+
|
|
60
62
|
```xs
|
|
61
63
|
schedule = [{starts_on: 2025-06-15 09:00:00+0000, freq: 86400}]
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
### With End Date
|
|
67
|
+
|
|
65
68
|
```xs
|
|
66
69
|
schedule = [{
|
|
67
70
|
starts_on: 2025-01-01 08:00:00+0000,
|
|
@@ -71,6 +74,7 @@ schedule = [{
|
|
|
71
74
|
```
|
|
72
75
|
|
|
73
76
|
### Multiple Schedules
|
|
77
|
+
|
|
74
78
|
```xs
|
|
75
79
|
schedule = [
|
|
76
80
|
{starts_on: 2025-01-01 09:00:00+0000, freq: 86400},
|
|
@@ -83,6 +87,7 @@ schedule = [
|
|
|
83
87
|
## Common Patterns
|
|
84
88
|
|
|
85
89
|
### Data Aggregation
|
|
90
|
+
|
|
86
91
|
```xs
|
|
87
92
|
task "hourly_stats" {
|
|
88
93
|
description = "Aggregate hourly statistics"
|
|
@@ -106,6 +111,7 @@ task "hourly_stats" {
|
|
|
106
111
|
```
|
|
107
112
|
|
|
108
113
|
### Cleanup Job
|
|
114
|
+
|
|
109
115
|
```xs
|
|
110
116
|
task "cleanup_temp_files" {
|
|
111
117
|
description = "Delete temporary files older than 24 hours"
|
|
@@ -131,6 +137,7 @@ task "cleanup_temp_files" {
|
|
|
131
137
|
```
|
|
132
138
|
|
|
133
139
|
### Notification Job
|
|
140
|
+
|
|
134
141
|
```xs
|
|
135
142
|
task "daily_digest" {
|
|
136
143
|
description = "Send daily digest emails"
|
|
@@ -166,6 +173,7 @@ task "daily_digest" {
|
|
|
166
173
|
```
|
|
167
174
|
|
|
168
175
|
### External API Sync
|
|
176
|
+
|
|
169
177
|
```xs
|
|
170
178
|
task "sync_exchange_rates" {
|
|
171
179
|
description = "Sync currency exchange rates every hour"
|
package/package.json
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/developer-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "MCP server for Xano
|
|
3
|
+
"version": "1.0.32",
|
|
4
|
+
"description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
6
|
+
"main": "dist/lib.js",
|
|
7
|
+
"module": "dist/lib.js",
|
|
8
|
+
"types": "dist/lib.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/lib.d.ts",
|
|
12
|
+
"import": "./dist/lib.js",
|
|
13
|
+
"default": "./dist/lib.js"
|
|
14
|
+
},
|
|
15
|
+
"./server": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./tools": {
|
|
21
|
+
"types": "./dist/tools/index.d.ts",
|
|
22
|
+
"import": "./dist/tools/index.js",
|
|
23
|
+
"default": "./dist/tools/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
7
26
|
"bin": {
|
|
8
27
|
"xano-developer-mcp": "./dist/index.js"
|
|
9
28
|
},
|