@xano/developer-mcp 1.0.67 → 1.0.71
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 +0 -4
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/tools/validate_xanoscript.d.ts +6 -0
- package/dist/tools/validate_xanoscript.js +44 -23
- package/dist/xanoscript.test.js +0 -3
- package/dist/xanoscript_docs/README.md +0 -2
- package/dist/xanoscript_docs/docs_index.json +0 -12
- package/dist/xanoscript_docs/types.md +44 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -374,12 +374,10 @@ Retrieves XanoScript programming language documentation with context-aware suppo
|
|
|
374
374
|
| `integrations/external-apis` | HTTP requests with api.request |
|
|
375
375
|
| `integrations/utilities` | Local storage, email, zip, and Lambda |
|
|
376
376
|
| `frontend` | Static frontend development and deployment |
|
|
377
|
-
| `run` | Run job and service configurations |
|
|
378
377
|
| `addons` | Reusable subqueries for fetching related data |
|
|
379
378
|
| `debugging` | Logging, inspecting, and debugging XanoScript execution |
|
|
380
379
|
| `performance` | Performance optimization best practices |
|
|
381
380
|
| `realtime` | Real-time channels and events for push updates |
|
|
382
|
-
| `schema` | Runtime schema parsing and validation |
|
|
383
381
|
| `security` | Security best practices for authentication and authorization |
|
|
384
382
|
| `streaming` | Streaming data from files, requests, and responses |
|
|
385
383
|
| `middleware` | Request/response interceptors for functions, queries, tasks, and tools |
|
|
@@ -563,12 +561,10 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
563
561
|
| `xanoscript://docs/integrations/external-apis` | HTTP requests with api.request |
|
|
564
562
|
| `xanoscript://docs/integrations/utilities` | Email, zip, Lambda utilities |
|
|
565
563
|
| `xanoscript://docs/frontend` | Static frontend development |
|
|
566
|
-
| `xanoscript://docs/run` | Run job and service configurations |
|
|
567
564
|
| `xanoscript://docs/addons` | Reusable subqueries for related data |
|
|
568
565
|
| `xanoscript://docs/debugging` | Logging and debugging tools |
|
|
569
566
|
| `xanoscript://docs/performance` | Performance optimization |
|
|
570
567
|
| `xanoscript://docs/realtime` | Real-time channels and events |
|
|
571
|
-
| `xanoscript://docs/schema` | Runtime schema parsing |
|
|
572
568
|
| `xanoscript://docs/security` | Security best practices |
|
|
573
569
|
| `xanoscript://docs/streaming` | Data streaming operations |
|
|
574
570
|
| `xanoscript://docs/middleware` | Request/response interceptors |
|
package/dist/lib.d.ts
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
*
|
|
42
42
|
* @packageDocumentation
|
|
43
43
|
*/
|
|
44
|
-
export { validateXanoscript, type ValidateXanoscriptArgs, type ValidationResult, type ParserDiagnostic, } from "./tools/validate_xanoscript.js";
|
|
44
|
+
export { validateXanoscript, type ValidateXanoscriptArgs, type ValidationResult, type ParserDiagnostic, type DiagnosticSeverity, SEVERITY, } from "./tools/validate_xanoscript.js";
|
|
45
45
|
export { xanoscriptDocs, getXanoscriptDocsPath, setXanoscriptDocsPath, type XanoscriptDocsArgs, type XanoscriptDocsResult, type TopicDoc, } from "./tools/xanoscript_docs.js";
|
|
46
46
|
export { mcpVersion, getServerVersion, setServerVersion, type McpVersionResult, } from "./tools/mcp_version.js";
|
|
47
47
|
export { metaApiDocs, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, type MetaApiDocsArgs, type MetaApiDocsResult, } from "./tools/meta_api_docs.js";
|
package/dist/lib.js
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
// Main Tool Exports
|
|
46
46
|
// =============================================================================
|
|
47
47
|
// Validation
|
|
48
|
-
export { validateXanoscript, } from "./tools/validate_xanoscript.js";
|
|
48
|
+
export { validateXanoscript, SEVERITY, } from "./tools/validate_xanoscript.js";
|
|
49
49
|
// XanoScript Documentation
|
|
50
50
|
export { xanoscriptDocs, getXanoscriptDocsPath, setXanoscriptDocsPath, } from "./tools/xanoscript_docs.js";
|
|
51
51
|
// MCP Version
|
|
@@ -23,7 +23,13 @@ export interface ValidateXanoscriptArgs {
|
|
|
23
23
|
/** Glob pattern to filter files when using directory (default: "**\/*.xs") */
|
|
24
24
|
pattern?: string;
|
|
25
25
|
}
|
|
26
|
+
export declare const SEVERITY: {
|
|
27
|
+
readonly ERROR: 1;
|
|
28
|
+
readonly WARNING: 2;
|
|
29
|
+
};
|
|
30
|
+
export type DiagnosticSeverity = (typeof SEVERITY)[keyof typeof SEVERITY];
|
|
26
31
|
export interface ParserDiagnostic {
|
|
32
|
+
severity: DiagnosticSeverity;
|
|
27
33
|
range: {
|
|
28
34
|
start: {
|
|
29
35
|
line: number;
|
|
@@ -15,6 +15,10 @@ import { getSchemeFromContent } from "@xano/xanoscript-language-server/utils.js"
|
|
|
15
15
|
import { readFileSync, existsSync, readdirSync } from "fs";
|
|
16
16
|
import { join, resolve, basename } from "path";
|
|
17
17
|
import { minimatch } from "minimatch";
|
|
18
|
+
export const SEVERITY = {
|
|
19
|
+
ERROR: 1,
|
|
20
|
+
WARNING: 2,
|
|
21
|
+
};
|
|
18
22
|
// =============================================================================
|
|
19
23
|
// Error Message Improvements
|
|
20
24
|
// =============================================================================
|
|
@@ -173,45 +177,62 @@ function validateCode(code, filePath) {
|
|
|
173
177
|
const text = code;
|
|
174
178
|
const scheme = getSchemeFromContent(text);
|
|
175
179
|
const parser = xanoscriptParser(text, scheme);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
errors: [],
|
|
180
|
-
message: filePath
|
|
181
|
-
? `✓ ${basename(filePath)}: Valid`
|
|
182
|
-
: "XanoScript is valid. No syntax errors found.",
|
|
183
|
-
file_path: filePath,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
const diagnostics = parser.errors.map((error) => {
|
|
187
|
-
const startOffset = error.token?.startOffset ?? 0;
|
|
188
|
-
const endOffset = error.token?.endOffset ?? 5;
|
|
180
|
+
function toDiagnostic(item, severity) {
|
|
181
|
+
const startOffset = item.token?.startOffset ?? 0;
|
|
182
|
+
const endOffset = item.token?.endOffset ?? 5;
|
|
189
183
|
const lines = text.substring(0, startOffset).split("\n");
|
|
190
184
|
const line = lines.length - 1;
|
|
191
185
|
const character = lines[lines.length - 1].length;
|
|
192
186
|
const endLines = text.substring(0, endOffset + 1).split("\n");
|
|
193
187
|
const endLine = endLines.length - 1;
|
|
194
188
|
const endCharacter = endLines[endLines.length - 1].length;
|
|
195
|
-
|
|
196
|
-
const enhancedMessage = enhanceErrorMessage(error.message, text, line);
|
|
189
|
+
const enhancedMessage = enhanceErrorMessage(item.message, text, line);
|
|
197
190
|
return {
|
|
191
|
+
severity,
|
|
198
192
|
range: {
|
|
199
193
|
start: { line, character },
|
|
200
194
|
end: { line: endLine, character: endCharacter },
|
|
201
195
|
},
|
|
202
196
|
message: enhancedMessage,
|
|
203
|
-
source:
|
|
197
|
+
source: item.name || "XanoScript Parser",
|
|
204
198
|
};
|
|
205
|
-
}
|
|
206
|
-
const
|
|
199
|
+
}
|
|
200
|
+
const diagnostics = [
|
|
201
|
+
...parser.errors.map((e) => toDiagnostic(e, SEVERITY.ERROR)),
|
|
202
|
+
...(parser.warnings ?? []).map((w) => toDiagnostic(w, SEVERITY.WARNING)),
|
|
203
|
+
];
|
|
204
|
+
if (diagnostics.length === 0) {
|
|
205
|
+
return {
|
|
206
|
+
valid: true,
|
|
207
|
+
errors: [],
|
|
208
|
+
message: filePath
|
|
209
|
+
? `✓ ${basename(filePath)}: Valid`
|
|
210
|
+
: "XanoScript is valid. No syntax errors found.",
|
|
211
|
+
file_path: filePath,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
const errors = diagnostics.filter((d) => d.severity === SEVERITY.ERROR);
|
|
215
|
+
const warnings = diagnostics.filter((d) => d.severity === SEVERITY.WARNING);
|
|
216
|
+
const hasErrors = errors.length > 0;
|
|
217
|
+
const formatDiagnostic = (d, i) => {
|
|
218
|
+
const label = d.severity === SEVERITY.ERROR ? "ERROR" : "WARNING";
|
|
207
219
|
const location = `Line ${d.range.start.line + 1}, Column ${d.range.start.character + 1}`;
|
|
208
|
-
return `${i + 1}. [${location}] ${d.message}`;
|
|
209
|
-
}
|
|
210
|
-
const
|
|
220
|
+
return `${i + 1}. [${label}] [${location}] ${d.message}`;
|
|
221
|
+
};
|
|
222
|
+
const messageLines = [];
|
|
223
|
+
const prefix = filePath ? `${hasErrors ? "✗" : "⚠"} ${basename(filePath)}: ` : "";
|
|
224
|
+
if (errors.length > 0) {
|
|
225
|
+
messageLines.push(`${prefix}Found ${errors.length} error(s)${warnings.length > 0 ? ` and ${warnings.length} warning(s)` : ""}:`);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
messageLines.push(`${prefix}Found ${warnings.length} warning(s):`);
|
|
229
|
+
}
|
|
230
|
+
messageLines.push("");
|
|
231
|
+
messageLines.push(...diagnostics.map(formatDiagnostic));
|
|
211
232
|
return {
|
|
212
|
-
valid:
|
|
233
|
+
valid: !hasErrors,
|
|
213
234
|
errors: diagnostics,
|
|
214
|
-
message:
|
|
235
|
+
message: messageLines.join("\n"),
|
|
215
236
|
file_path: filePath,
|
|
216
237
|
};
|
|
217
238
|
}
|
package/dist/xanoscript.test.js
CHANGED
|
@@ -36,12 +36,10 @@ describe("xanoscript module", () => {
|
|
|
36
36
|
"integrations/external-apis",
|
|
37
37
|
"integrations/utilities",
|
|
38
38
|
"frontend",
|
|
39
|
-
"run",
|
|
40
39
|
"addons",
|
|
41
40
|
"debugging",
|
|
42
41
|
"performance",
|
|
43
42
|
"realtime",
|
|
44
|
-
"schema",
|
|
45
43
|
"security",
|
|
46
44
|
"streaming",
|
|
47
45
|
"middleware",
|
|
@@ -151,7 +149,6 @@ describe("xanoscript module", () => {
|
|
|
151
149
|
it("should match run files", () => {
|
|
152
150
|
const result = getDocsForFilePath("run/job/main.xs");
|
|
153
151
|
expect(result).toContain("syntax");
|
|
154
|
-
expect(result).toContain("run");
|
|
155
152
|
});
|
|
156
153
|
it("should not include readme automatically", () => {
|
|
157
154
|
const result = getDocsForFilePath("api/test.xs");
|
|
@@ -219,7 +219,6 @@ Use `xanoscript_docs({ tier: "survival" })` or `xanoscript_docs({ tier: "working
|
|
|
219
219
|
| `syntax/functions` | Built-in functions | Math, Date, Crypto, JSON |
|
|
220
220
|
| `types` | Data types, validation, input blocks | Validation Filters, Input Blocks |
|
|
221
221
|
| `functions` | Reusable function stacks, async, loops | Loops, Async Patterns |
|
|
222
|
-
| `schema` | Runtime schema parsing and validation | parse.object, parse.array |
|
|
223
222
|
|
|
224
223
|
### Data
|
|
225
224
|
|
|
@@ -269,7 +268,6 @@ Use `xanoscript_docs({ tier: "survival" })` or `xanoscript_docs({ tier: "working
|
|
|
269
268
|
| `workflow-tests` | End-to-end workflow tests with data sources and tags | Data Sources, Tags, Common Patterns |
|
|
270
269
|
| `debugging` | Logging, inspecting, and debugging XanoScript execution | debug.log, Inspection |
|
|
271
270
|
| `frontend` | Static frontend development and deployment | File Structure |
|
|
272
|
-
| `run` | Run job and service configurations for the Xano Job Runner | Jobs, Services |
|
|
273
271
|
|
|
274
272
|
### Best Practices
|
|
275
273
|
|
|
@@ -179,12 +179,6 @@
|
|
|
179
179
|
"applyTo": ["static/**/*"],
|
|
180
180
|
"aliases": ["static", "html", "css", "web"]
|
|
181
181
|
},
|
|
182
|
-
"run": {
|
|
183
|
-
"file": "run.md",
|
|
184
|
-
"description": "Run job and service configurations for the Xano Job Runner",
|
|
185
|
-
"applyTo": ["run/**/*.xs"],
|
|
186
|
-
"aliases": ["jobs", "runner", "services"]
|
|
187
|
-
},
|
|
188
182
|
"addons": {
|
|
189
183
|
"file": "addons.md",
|
|
190
184
|
"description": "Reusable subqueries for fetching related data",
|
|
@@ -209,12 +203,6 @@
|
|
|
209
203
|
"applyTo": ["realtime/channel/*.xs", "realtime/trigger/*.xs"],
|
|
210
204
|
"aliases": ["websocket", "channels", "pubsub"]
|
|
211
205
|
},
|
|
212
|
-
"schema": {
|
|
213
|
-
"file": "schema.md",
|
|
214
|
-
"description": "Runtime schema parsing and validation",
|
|
215
|
-
"applyTo": [],
|
|
216
|
-
"aliases": ["runtime-schema", "parsing"]
|
|
217
|
-
},
|
|
218
206
|
"security": {
|
|
219
207
|
"file": "security.md",
|
|
220
208
|
"description": "Security best practices for authentication and authorization",
|
|
@@ -35,6 +35,11 @@ Reference for XanoScript data types, input blocks, and validation.
|
|
|
35
35
|
| `file` / `image` / `video` / `audio` / `attachment` | File resources |
|
|
36
36
|
| `geo_point` / `geo_polygon` / `geo_linestring` | Geographic data |
|
|
37
37
|
|
|
38
|
+
### Dynamic Input
|
|
39
|
+
| Type | Description |
|
|
40
|
+
|------|-------------|
|
|
41
|
+
| `dblink` | Generate inputs from a table's schema (not available on tables) |
|
|
42
|
+
|
|
38
43
|
### Modifiers
|
|
39
44
|
|
|
40
45
|
The `?` has different meanings depending on placement:
|
|
@@ -358,6 +363,45 @@ input {
|
|
|
358
363
|
|
|
359
364
|
---
|
|
360
365
|
|
|
366
|
+
## Database Link Inputs (dblink)
|
|
367
|
+
|
|
368
|
+
Generates inputs dynamically from a table's schema. Each non-hidden column becomes an input, accessed via `$input.<column_name>`. Not available on table definitions.
|
|
369
|
+
|
|
370
|
+
```xs
|
|
371
|
+
// user table has: name, email, password → generates $input.name, $input.email, $input.password
|
|
372
|
+
function create_user {
|
|
373
|
+
input {
|
|
374
|
+
dblink {
|
|
375
|
+
table = "user"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
stack {
|
|
380
|
+
var $x1 { value = $input.name }
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
response = $x1
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Use `override` to hide fields from the generated inputs:
|
|
388
|
+
|
|
389
|
+
```xs
|
|
390
|
+
input {
|
|
391
|
+
dblink {
|
|
392
|
+
table = "user"
|
|
393
|
+
override = {
|
|
394
|
+
created_at: {hidden: true}
|
|
395
|
+
email : {hidden: true}
|
|
396
|
+
password : {hidden: true}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// Only $input.name is available — overridden fields are excluded
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
361
405
|
## Sensitive Fields
|
|
362
406
|
|
|
363
407
|
Mark fields for log masking:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/developer-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/lib.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"license": "MIT",
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
64
|
-
"@xano/xanoscript-language-server": "^
|
|
64
|
+
"@xano/xanoscript-language-server": "^12.0.0",
|
|
65
65
|
"minimatch": "^10.1.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|