@xano/developer-mcp 1.0.14 → 1.0.16
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 +56 -10
- package/dist/index.js +48 -9
- package/dist/meta_api_docs/format.d.ts +5 -0
- package/dist/meta_api_docs/format.js +171 -0
- package/dist/meta_api_docs/index.d.ts +52 -0
- package/dist/meta_api_docs/index.js +111 -0
- package/dist/meta_api_docs/topics/agent.d.ts +2 -0
- package/dist/meta_api_docs/topics/agent.js +142 -0
- package/dist/meta_api_docs/topics/api.d.ts +2 -0
- package/dist/meta_api_docs/topics/api.js +176 -0
- package/dist/meta_api_docs/topics/apigroup.d.ts +2 -0
- package/dist/meta_api_docs/topics/apigroup.js +124 -0
- package/dist/meta_api_docs/topics/authentication.d.ts +2 -0
- package/dist/meta_api_docs/topics/authentication.js +61 -0
- package/dist/meta_api_docs/topics/branch.d.ts +2 -0
- package/dist/meta_api_docs/topics/branch.js +73 -0
- package/dist/meta_api_docs/topics/file.d.ts +2 -0
- package/dist/meta_api_docs/topics/file.js +70 -0
- package/dist/meta_api_docs/topics/function.d.ts +2 -0
- package/dist/meta_api_docs/topics/function.js +164 -0
- package/dist/meta_api_docs/topics/history.d.ts +2 -0
- package/dist/meta_api_docs/topics/history.js +149 -0
- package/dist/meta_api_docs/topics/mcp_server.d.ts +2 -0
- package/dist/meta_api_docs/topics/mcp_server.js +139 -0
- package/dist/meta_api_docs/topics/middleware.d.ts +2 -0
- package/dist/meta_api_docs/topics/middleware.js +156 -0
- package/dist/meta_api_docs/topics/realtime.d.ts +2 -0
- package/dist/meta_api_docs/topics/realtime.js +112 -0
- package/dist/meta_api_docs/topics/start.d.ts +2 -0
- package/dist/meta_api_docs/topics/start.js +107 -0
- package/dist/meta_api_docs/topics/table.d.ts +2 -0
- package/dist/meta_api_docs/topics/table.js +195 -0
- package/dist/meta_api_docs/topics/task.d.ts +2 -0
- package/dist/meta_api_docs/topics/task.js +165 -0
- package/dist/meta_api_docs/topics/tool.d.ts +2 -0
- package/dist/meta_api_docs/topics/tool.js +150 -0
- package/dist/meta_api_docs/topics/workflows.d.ts +2 -0
- package/dist/meta_api_docs/topics/workflows.js +131 -0
- package/dist/meta_api_docs/topics/workspace.d.ts +2 -0
- package/dist/meta_api_docs/topics/workspace.js +153 -0
- package/dist/meta_api_docs/types.d.ts +79 -0
- package/dist/meta_api_docs/types.js +4 -0
- package/dist/run_api_docs/format.d.ts +5 -0
- package/dist/run_api_docs/format.js +175 -0
- package/dist/run_api_docs/index.d.ts +52 -0
- package/dist/run_api_docs/index.js +90 -0
- package/dist/run_api_docs/topics/data.d.ts +2 -0
- package/dist/run_api_docs/topics/data.js +104 -0
- package/dist/run_api_docs/topics/history.d.ts +2 -0
- package/dist/run_api_docs/topics/history.js +93 -0
- package/dist/run_api_docs/topics/run.d.ts +2 -0
- package/dist/run_api_docs/topics/run.js +110 -0
- package/dist/run_api_docs/topics/session.d.ts +2 -0
- package/dist/run_api_docs/topics/session.js +166 -0
- package/dist/run_api_docs/topics/start.d.ts +2 -0
- package/dist/run_api_docs/topics/start.js +97 -0
- package/dist/run_api_docs/topics/workflows.d.ts +2 -0
- package/dist/run_api_docs/topics/workflows.js +140 -0
- package/dist/templates/xanoscript-index.js +1 -1
- package/dist/xanoscript_docs/README.md +2 -2
- package/dist/xanoscript_docs/run.md +357 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ A Model Context Protocol (MCP) server that provides AI assistants with comprehen
|
|
|
7
7
|
This MCP server acts as a bridge between AI models and Xano's developer ecosystem, offering:
|
|
8
8
|
|
|
9
9
|
- **Meta API Documentation** - Programmatically manage Xano workspaces, databases, APIs, functions, and more
|
|
10
|
+
- **Run API Documentation** - Runtime execution, session management, and XanoScript execution
|
|
10
11
|
- **XanoScript Documentation** - Language reference with context-aware docs based on file type
|
|
11
12
|
- **Code Validation** - Syntax checking with the official XanoScript language server
|
|
12
13
|
- **Workflow Guides** - Step-by-step guides for common development tasks
|
|
@@ -157,7 +158,7 @@ Retrieves XanoScript programming language documentation with context-aware suppo
|
|
|
157
158
|
| `testing` | Unit tests, mocks, and assertions |
|
|
158
159
|
| `integrations` | Cloud storage, Redis, security, and external APIs |
|
|
159
160
|
| `frontend` | Static frontend development and deployment |
|
|
160
|
-
| `
|
|
161
|
+
| `run` | Run job and service configurations |
|
|
161
162
|
| `addons` | Reusable subqueries for fetching related data |
|
|
162
163
|
| `debugging` | Logging, inspecting, and debugging XanoScript execution |
|
|
163
164
|
| `performance` | Performance optimization best practices |
|
|
@@ -181,6 +182,45 @@ xanoscript_docs({ file_path: "apis/users/create.xs" })
|
|
|
181
182
|
xanoscript_docs({ topic: "database", mode: "quick_reference" })
|
|
182
183
|
```
|
|
183
184
|
|
|
185
|
+
### 3. `run_api_docs`
|
|
186
|
+
|
|
187
|
+
Get documentation for Xano's Run API. Use this to understand runtime execution, session management, and XanoScript execution.
|
|
188
|
+
|
|
189
|
+
**Important:** The Run API uses a fixed base URL: `https://app.dev.xano.com/api:run/<endpoint>` (NOT your Xano instance URL)
|
|
190
|
+
|
|
191
|
+
**Parameters:**
|
|
192
|
+
| Parameter | Type | Required | Description |
|
|
193
|
+
|-----------|------|----------|-------------|
|
|
194
|
+
| `topic` | string | Yes | Documentation topic to retrieve |
|
|
195
|
+
| `detail_level` | string | No | `overview`, `detailed` (default), or `examples` |
|
|
196
|
+
| `include_schemas` | boolean | No | Include JSON schemas for requests/responses (default: true) |
|
|
197
|
+
|
|
198
|
+
**Available Topics:**
|
|
199
|
+
|
|
200
|
+
| Topic | Description |
|
|
201
|
+
|-------|-------------|
|
|
202
|
+
| `start` | Getting started with the Run API |
|
|
203
|
+
| `run` | Execute XanoScript code and API endpoints |
|
|
204
|
+
| `session` | Session management for stateful execution |
|
|
205
|
+
| `history` | Execution history and debugging |
|
|
206
|
+
| `data` | Data operations and variable management |
|
|
207
|
+
| `workflows` | Step-by-step workflow guides |
|
|
208
|
+
|
|
209
|
+
**Examples:**
|
|
210
|
+
```
|
|
211
|
+
// Get overview of Run API
|
|
212
|
+
run_api_docs({ topic: "start" })
|
|
213
|
+
|
|
214
|
+
// Get detailed run endpoint documentation
|
|
215
|
+
run_api_docs({ topic: "run", detail_level: "detailed" })
|
|
216
|
+
|
|
217
|
+
// Get examples without schemas (smaller context)
|
|
218
|
+
run_api_docs({ topic: "session", detail_level: "examples", include_schemas: false })
|
|
219
|
+
|
|
220
|
+
// Step-by-step workflow guides
|
|
221
|
+
run_api_docs({ topic: "workflows" })
|
|
222
|
+
```
|
|
223
|
+
|
|
184
224
|
### 4. `mcp_version`
|
|
185
225
|
|
|
186
226
|
Get the current version of the Xano Developer MCP server.
|
|
@@ -194,7 +234,7 @@ Get the current version of the Xano Developer MCP server.
|
|
|
194
234
|
mcp_version()
|
|
195
235
|
```
|
|
196
236
|
|
|
197
|
-
### 5. `
|
|
237
|
+
### 5. `meta_api_docs`
|
|
198
238
|
|
|
199
239
|
Get documentation for Xano's Meta API. Use this to understand how to programmatically manage Xano workspaces, databases, APIs, functions, agents, and more.
|
|
200
240
|
|
|
@@ -230,16 +270,16 @@ Get documentation for Xano's Meta API. Use this to understand how to programmati
|
|
|
230
270
|
**Examples:**
|
|
231
271
|
```
|
|
232
272
|
// Get overview of Meta API
|
|
233
|
-
|
|
273
|
+
meta_api_docs({ topic: "start" })
|
|
234
274
|
|
|
235
275
|
// Get detailed table documentation
|
|
236
|
-
|
|
276
|
+
meta_api_docs({ topic: "table", detail_level: "detailed" })
|
|
237
277
|
|
|
238
278
|
// Get examples without schemas (smaller context)
|
|
239
|
-
|
|
279
|
+
meta_api_docs({ topic: "api", detail_level: "examples", include_schemas: false })
|
|
240
280
|
|
|
241
281
|
// Step-by-step workflow guides
|
|
242
|
-
|
|
282
|
+
meta_api_docs({ topic: "workflows" })
|
|
243
283
|
```
|
|
244
284
|
|
|
245
285
|
## MCP Resources
|
|
@@ -263,7 +303,7 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
263
303
|
| `xanoscript://docs/testing` | Unit tests and mocks |
|
|
264
304
|
| `xanoscript://docs/integrations` | External service integrations |
|
|
265
305
|
| `xanoscript://docs/frontend` | Static frontend development |
|
|
266
|
-
| `xanoscript://docs/
|
|
306
|
+
| `xanoscript://docs/run` | Run job and service configurations |
|
|
267
307
|
| `xanoscript://docs/addons` | Reusable subqueries for related data |
|
|
268
308
|
| `xanoscript://docs/debugging` | Logging and debugging tools |
|
|
269
309
|
| `xanoscript://docs/performance` | Performance optimization |
|
|
@@ -287,11 +327,15 @@ xano-developer-mcp/
|
|
|
287
327
|
├── src/
|
|
288
328
|
│ ├── index.ts # Main MCP server implementation
|
|
289
329
|
│ ├── xanoscript.d.ts # TypeScript declarations
|
|
290
|
-
│ ├──
|
|
330
|
+
│ ├── meta_api_docs/ # Meta API documentation
|
|
291
331
|
│ │ ├── index.ts # API docs tool handler
|
|
292
332
|
│ │ ├── types.ts # Type definitions
|
|
293
333
|
│ │ ├── format.ts # Documentation formatter
|
|
294
334
|
│ │ └── topics/ # Individual topic modules
|
|
335
|
+
│ ├── run_api_docs/ # Run API documentation
|
|
336
|
+
│ │ ├── index.ts # Run API tool handler
|
|
337
|
+
│ │ ├── format.ts # Documentation formatter
|
|
338
|
+
│ │ └── topics/ # Individual topic modules
|
|
295
339
|
│ ├── xanoscript_docs/ # XanoScript language documentation
|
|
296
340
|
│ │ ├── version.json
|
|
297
341
|
│ │ ├── README.md
|
|
@@ -327,7 +371,9 @@ Xano Developer MCP Server
|
|
|
327
371
|
│
|
|
328
372
|
├─► xanoscript_docs → Context-aware docs from /xanoscript_docs/*.md
|
|
329
373
|
│
|
|
330
|
-
├─►
|
|
374
|
+
├─► meta_api_docs → Meta API documentation with detail levels
|
|
375
|
+
│
|
|
376
|
+
├─► run_api_docs → Run API documentation for runtime execution
|
|
331
377
|
│
|
|
332
378
|
├─► mcp_version → Returns server version from package.json
|
|
333
379
|
│
|
|
@@ -357,7 +403,7 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
|
357
403
|
- **applyTo**: Glob patterns for context-aware matching (e.g., `apis/**/*.xs`)
|
|
358
404
|
- **description**: Human-readable description of the topic
|
|
359
405
|
|
|
360
|
-
**Meta API Documentation** (`src/
|
|
406
|
+
**Meta API Documentation** (`src/meta_api_docs/`):
|
|
361
407
|
- TypeScript modules with structured documentation
|
|
362
408
|
- Supports parameterized output (detail levels, schema inclusion)
|
|
363
409
|
- Better for AI consumption due to context efficiency
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import { dirname, join } from "path";
|
|
|
8
8
|
import { minimatch } from "minimatch";
|
|
9
9
|
import { xanoscriptParser } from "@xano/xanoscript-language-server/parser/parser.js";
|
|
10
10
|
import { getSchemeFromContent } from "@xano/xanoscript-language-server/utils.js";
|
|
11
|
-
import {
|
|
11
|
+
import { metaApiDocsToolDefinition, handleMetaApiDocs } from "./meta_api_docs/index.js";
|
|
12
|
+
import { runApiDocsToolDefinition, handleRunApiDocs } from "./run_api_docs/index.js";
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = dirname(__filename);
|
|
14
15
|
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
@@ -93,10 +94,10 @@ const XANOSCRIPT_DOCS_V2 = {
|
|
|
93
94
|
applyTo: ["static/**/*"],
|
|
94
95
|
description: "Static frontend development and deployment",
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
-
file: "
|
|
98
|
-
applyTo: ["
|
|
99
|
-
description: "
|
|
97
|
+
run: {
|
|
98
|
+
file: "run.md",
|
|
99
|
+
applyTo: ["run/**/*.xs"],
|
|
100
|
+
description: "Run job and service configurations for the Xano Job Runner",
|
|
100
101
|
},
|
|
101
102
|
addons: {
|
|
102
103
|
file: "addons.md",
|
|
@@ -366,7 +367,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
366
367
|
required: [],
|
|
367
368
|
},
|
|
368
369
|
},
|
|
369
|
-
|
|
370
|
+
metaApiDocsToolDefinition,
|
|
371
|
+
runApiDocsToolDefinition,
|
|
370
372
|
],
|
|
371
373
|
};
|
|
372
374
|
});
|
|
@@ -465,21 +467,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
465
467
|
],
|
|
466
468
|
};
|
|
467
469
|
}
|
|
468
|
-
if (request.params.name === "
|
|
470
|
+
if (request.params.name === "meta_api_docs") {
|
|
469
471
|
const args = request.params.arguments;
|
|
470
472
|
if (!args?.topic) {
|
|
471
473
|
return {
|
|
472
474
|
content: [
|
|
473
475
|
{
|
|
474
476
|
type: "text",
|
|
475
|
-
text: "Error: 'topic' parameter is required. Use
|
|
477
|
+
text: "Error: 'topic' parameter is required. Use meta_api_docs with topic='start' for overview.",
|
|
476
478
|
},
|
|
477
479
|
],
|
|
478
480
|
isError: true,
|
|
479
481
|
};
|
|
480
482
|
}
|
|
481
483
|
try {
|
|
482
|
-
const documentation =
|
|
484
|
+
const documentation = handleMetaApiDocs({
|
|
483
485
|
topic: args.topic,
|
|
484
486
|
detail_level: args.detail_level,
|
|
485
487
|
include_schemas: args.include_schemas,
|
|
@@ -506,6 +508,43 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
506
508
|
};
|
|
507
509
|
}
|
|
508
510
|
}
|
|
511
|
+
if (request.params.name === "run_api_docs") {
|
|
512
|
+
const args = request.params.arguments;
|
|
513
|
+
if (!args?.topic) {
|
|
514
|
+
return {
|
|
515
|
+
content: [
|
|
516
|
+
{
|
|
517
|
+
type: "text",
|
|
518
|
+
text: "Error: 'topic' parameter is required. Use run_api_docs with topic='start' for overview.",
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
isError: true,
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
try {
|
|
525
|
+
const documentation = handleRunApiDocs(args.topic, args.detail_level, args.include_schemas);
|
|
526
|
+
return {
|
|
527
|
+
content: [
|
|
528
|
+
{
|
|
529
|
+
type: "text",
|
|
530
|
+
text: documentation,
|
|
531
|
+
},
|
|
532
|
+
],
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
catch (error) {
|
|
536
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
537
|
+
return {
|
|
538
|
+
content: [
|
|
539
|
+
{
|
|
540
|
+
type: "text",
|
|
541
|
+
text: `Error retrieving Run API documentation: ${errorMessage}`,
|
|
542
|
+
},
|
|
543
|
+
],
|
|
544
|
+
isError: true,
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
}
|
|
509
548
|
return {
|
|
510
549
|
content: [
|
|
511
550
|
{
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utilities for API documentation output
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base URL information included with any topic that has endpoints
|
|
6
|
+
*/
|
|
7
|
+
const BASE_URL_INFO = `## Base URL
|
|
8
|
+
\`\`\`
|
|
9
|
+
https://<your-instance-subdomain>.xano.io/api:meta/<endpoint>
|
|
10
|
+
\`\`\`
|
|
11
|
+
Authorization: \`Bearer <your-access-token>\`
|
|
12
|
+
`;
|
|
13
|
+
function formatParameter(param) {
|
|
14
|
+
const required = param.required ? " (required)" : "";
|
|
15
|
+
const defaultVal = param.default !== undefined ? ` [default: ${param.default}]` : "";
|
|
16
|
+
const enumVals = param.enum ? ` [options: ${param.enum.join(", ")}]` : "";
|
|
17
|
+
return ` - \`${param.name}\`: ${param.type}${required}${defaultVal}${enumVals} - ${param.description}`;
|
|
18
|
+
}
|
|
19
|
+
function formatEndpoint(ep, detailLevel) {
|
|
20
|
+
const lines = [];
|
|
21
|
+
// Method and path
|
|
22
|
+
lines.push(`### ${ep.method} ${ep.path}`);
|
|
23
|
+
if (ep.tool_name) {
|
|
24
|
+
lines.push(`**Tool:** \`${ep.tool_name}\``);
|
|
25
|
+
}
|
|
26
|
+
lines.push("");
|
|
27
|
+
lines.push(ep.description);
|
|
28
|
+
if (detailLevel === "overview") {
|
|
29
|
+
return lines.join("\n");
|
|
30
|
+
}
|
|
31
|
+
// Parameters
|
|
32
|
+
if (ep.parameters?.length) {
|
|
33
|
+
lines.push("");
|
|
34
|
+
lines.push("**Parameters:**");
|
|
35
|
+
for (const param of ep.parameters) {
|
|
36
|
+
lines.push(formatParameter(param));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// Request body
|
|
40
|
+
if (ep.request_body) {
|
|
41
|
+
lines.push("");
|
|
42
|
+
lines.push(`**Request Body:** \`${ep.request_body.type}\``);
|
|
43
|
+
if (ep.request_body.properties) {
|
|
44
|
+
for (const [key, val] of Object.entries(ep.request_body.properties)) {
|
|
45
|
+
const req = val.required ? " (required)" : "";
|
|
46
|
+
lines.push(` - \`${key}\`: ${val.type}${req} - ${val.description || ""}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Example (only in detailed/examples mode)
|
|
51
|
+
if (detailLevel === "examples" && ep.example) {
|
|
52
|
+
lines.push("");
|
|
53
|
+
lines.push("**Example:**");
|
|
54
|
+
lines.push("```");
|
|
55
|
+
lines.push(`${ep.example.method} ${ep.example.path}`);
|
|
56
|
+
if (ep.example.body) {
|
|
57
|
+
lines.push(JSON.stringify(ep.example.body, null, 2));
|
|
58
|
+
}
|
|
59
|
+
lines.push("```");
|
|
60
|
+
}
|
|
61
|
+
return lines.join("\n");
|
|
62
|
+
}
|
|
63
|
+
function formatExample(ex) {
|
|
64
|
+
const lines = [];
|
|
65
|
+
lines.push(`### ${ex.title}`);
|
|
66
|
+
lines.push("");
|
|
67
|
+
lines.push(ex.description);
|
|
68
|
+
lines.push("");
|
|
69
|
+
lines.push("**Request:**");
|
|
70
|
+
lines.push("```");
|
|
71
|
+
lines.push(`${ex.request.method} ${ex.request.path}`);
|
|
72
|
+
if (ex.request.headers) {
|
|
73
|
+
for (const [key, val] of Object.entries(ex.request.headers)) {
|
|
74
|
+
lines.push(`${key}: ${val}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (ex.request.body) {
|
|
78
|
+
lines.push("");
|
|
79
|
+
lines.push(JSON.stringify(ex.request.body, null, 2));
|
|
80
|
+
}
|
|
81
|
+
lines.push("```");
|
|
82
|
+
if (ex.response !== undefined) {
|
|
83
|
+
lines.push("");
|
|
84
|
+
lines.push("**Response:**");
|
|
85
|
+
lines.push("```json");
|
|
86
|
+
lines.push(JSON.stringify(ex.response, null, 2));
|
|
87
|
+
lines.push("```");
|
|
88
|
+
}
|
|
89
|
+
return lines.join("\n");
|
|
90
|
+
}
|
|
91
|
+
function formatPattern(pattern) {
|
|
92
|
+
const lines = [];
|
|
93
|
+
lines.push(`### ${pattern.name}`);
|
|
94
|
+
if (pattern.description) {
|
|
95
|
+
lines.push("");
|
|
96
|
+
lines.push(pattern.description);
|
|
97
|
+
}
|
|
98
|
+
lines.push("");
|
|
99
|
+
lines.push("**Steps:**");
|
|
100
|
+
for (const step of pattern.steps) {
|
|
101
|
+
lines.push(step);
|
|
102
|
+
}
|
|
103
|
+
if (pattern.example) {
|
|
104
|
+
lines.push("");
|
|
105
|
+
lines.push("**Example:**");
|
|
106
|
+
lines.push("```");
|
|
107
|
+
lines.push(pattern.example);
|
|
108
|
+
lines.push("```");
|
|
109
|
+
}
|
|
110
|
+
return lines.join("\n");
|
|
111
|
+
}
|
|
112
|
+
export function formatDocumentation(doc, detailLevel = "detailed", includeSchemas = true) {
|
|
113
|
+
const sections = [];
|
|
114
|
+
// Header
|
|
115
|
+
sections.push(`# ${doc.title}`);
|
|
116
|
+
sections.push("");
|
|
117
|
+
sections.push(doc.description);
|
|
118
|
+
// AI Hints (always include for AI optimization)
|
|
119
|
+
if (doc.ai_hints) {
|
|
120
|
+
sections.push("");
|
|
121
|
+
sections.push("## AI Usage Hints");
|
|
122
|
+
sections.push(doc.ai_hints);
|
|
123
|
+
}
|
|
124
|
+
// Include base URL info if topic has endpoints or patterns (workflows)
|
|
125
|
+
if (doc.endpoints?.length || doc.patterns?.length) {
|
|
126
|
+
sections.push("");
|
|
127
|
+
sections.push(BASE_URL_INFO);
|
|
128
|
+
}
|
|
129
|
+
// Endpoints
|
|
130
|
+
if (doc.endpoints?.length) {
|
|
131
|
+
sections.push("## Endpoints");
|
|
132
|
+
for (const ep of doc.endpoints) {
|
|
133
|
+
sections.push("");
|
|
134
|
+
sections.push(formatEndpoint(ep, detailLevel));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Patterns/Workflows
|
|
138
|
+
if (doc.patterns?.length) {
|
|
139
|
+
sections.push("");
|
|
140
|
+
sections.push("## Workflows");
|
|
141
|
+
for (const pattern of doc.patterns) {
|
|
142
|
+
sections.push("");
|
|
143
|
+
sections.push(formatPattern(pattern));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Examples
|
|
147
|
+
if ((detailLevel === "detailed" || detailLevel === "examples") && doc.examples?.length) {
|
|
148
|
+
sections.push("");
|
|
149
|
+
sections.push("## Examples");
|
|
150
|
+
for (const ex of doc.examples) {
|
|
151
|
+
sections.push("");
|
|
152
|
+
sections.push(formatExample(ex));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Schemas
|
|
156
|
+
if (includeSchemas && doc.schemas && Object.keys(doc.schemas).length > 0) {
|
|
157
|
+
sections.push("");
|
|
158
|
+
sections.push("## Schemas");
|
|
159
|
+
sections.push("");
|
|
160
|
+
sections.push("```json");
|
|
161
|
+
sections.push(JSON.stringify(doc.schemas, null, 2));
|
|
162
|
+
sections.push("```");
|
|
163
|
+
}
|
|
164
|
+
// Related topics
|
|
165
|
+
if (doc.related_topics?.length) {
|
|
166
|
+
sections.push("");
|
|
167
|
+
sections.push("## Related Topics");
|
|
168
|
+
sections.push(`Use \`meta_api_docs\` with topic: ${doc.related_topics.join(", ")}`);
|
|
169
|
+
}
|
|
170
|
+
return sections.join("\n");
|
|
171
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Xano Meta API Documentation Index
|
|
3
|
+
*
|
|
4
|
+
* This module exports all documentation topics and provides
|
|
5
|
+
* the meta_api_docs tool handler for the MCP server.
|
|
6
|
+
*/
|
|
7
|
+
import type { TopicDoc, MetaApiDocsArgs } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* All available documentation topics
|
|
10
|
+
*/
|
|
11
|
+
export declare const topics: Record<string, TopicDoc>;
|
|
12
|
+
/**
|
|
13
|
+
* Get list of all available topic names
|
|
14
|
+
*/
|
|
15
|
+
export declare function getTopicNames(): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Get topic descriptions for tool documentation
|
|
18
|
+
*/
|
|
19
|
+
export declare function getTopicDescriptions(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Handler for the meta_api_docs tool
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleMetaApiDocs(args: MetaApiDocsArgs): string;
|
|
24
|
+
/**
|
|
25
|
+
* Tool definition for MCP server
|
|
26
|
+
*/
|
|
27
|
+
export declare const metaApiDocsToolDefinition: {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: string;
|
|
32
|
+
properties: {
|
|
33
|
+
topic: {
|
|
34
|
+
type: string;
|
|
35
|
+
enum: string[];
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
detail_level: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: string[];
|
|
41
|
+
default: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
include_schemas: {
|
|
45
|
+
type: string;
|
|
46
|
+
default: boolean;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
required: string[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Xano Meta API Documentation Index
|
|
3
|
+
*
|
|
4
|
+
* This module exports all documentation topics and provides
|
|
5
|
+
* the meta_api_docs tool handler for the MCP server.
|
|
6
|
+
*/
|
|
7
|
+
import { formatDocumentation } from "./format.js";
|
|
8
|
+
// Import all topic documentation
|
|
9
|
+
import { startDoc } from "./topics/start.js";
|
|
10
|
+
import { authenticationDoc } from "./topics/authentication.js";
|
|
11
|
+
import { workspaceDoc } from "./topics/workspace.js";
|
|
12
|
+
import { apigroupDoc } from "./topics/apigroup.js";
|
|
13
|
+
import { apiDoc } from "./topics/api.js";
|
|
14
|
+
import { tableDoc } from "./topics/table.js";
|
|
15
|
+
import { functionDoc } from "./topics/function.js";
|
|
16
|
+
import { taskDoc } from "./topics/task.js";
|
|
17
|
+
import { agentDoc } from "./topics/agent.js";
|
|
18
|
+
import { toolDoc } from "./topics/tool.js";
|
|
19
|
+
import { mcpServerDoc } from "./topics/mcp_server.js";
|
|
20
|
+
import { middlewareDoc } from "./topics/middleware.js";
|
|
21
|
+
import { branchDoc } from "./topics/branch.js";
|
|
22
|
+
import { realtimeDoc } from "./topics/realtime.js";
|
|
23
|
+
import { fileDoc } from "./topics/file.js";
|
|
24
|
+
import { historyDoc } from "./topics/history.js";
|
|
25
|
+
import { workflowsDoc } from "./topics/workflows.js";
|
|
26
|
+
/**
|
|
27
|
+
* All available documentation topics
|
|
28
|
+
*/
|
|
29
|
+
export const topics = {
|
|
30
|
+
start: startDoc,
|
|
31
|
+
authentication: authenticationDoc,
|
|
32
|
+
workspace: workspaceDoc,
|
|
33
|
+
apigroup: apigroupDoc,
|
|
34
|
+
api: apiDoc,
|
|
35
|
+
table: tableDoc,
|
|
36
|
+
function: functionDoc,
|
|
37
|
+
task: taskDoc,
|
|
38
|
+
agent: agentDoc,
|
|
39
|
+
tool: toolDoc,
|
|
40
|
+
mcp_server: mcpServerDoc,
|
|
41
|
+
middleware: middlewareDoc,
|
|
42
|
+
branch: branchDoc,
|
|
43
|
+
realtime: realtimeDoc,
|
|
44
|
+
file: fileDoc,
|
|
45
|
+
history: historyDoc,
|
|
46
|
+
workflows: workflowsDoc,
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Get list of all available topic names
|
|
50
|
+
*/
|
|
51
|
+
export function getTopicNames() {
|
|
52
|
+
return Object.keys(topics);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get topic descriptions for tool documentation
|
|
56
|
+
*/
|
|
57
|
+
export function getTopicDescriptions() {
|
|
58
|
+
return Object.entries(topics)
|
|
59
|
+
.map(([key, doc]) => `- ${key}: ${doc.title}`)
|
|
60
|
+
.join("\n");
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Handler for the meta_api_docs tool
|
|
64
|
+
*/
|
|
65
|
+
export function handleMetaApiDocs(args) {
|
|
66
|
+
const { topic, detail_level = "detailed", include_schemas = true } = args;
|
|
67
|
+
// Validate topic
|
|
68
|
+
if (!topics[topic]) {
|
|
69
|
+
const available = getTopicNames().join(", ");
|
|
70
|
+
return `Error: Unknown topic "${topic}".\n\nAvailable topics: ${available}`;
|
|
71
|
+
}
|
|
72
|
+
const doc = topics[topic];
|
|
73
|
+
return formatDocumentation(doc, detail_level, include_schemas);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Tool definition for MCP server
|
|
77
|
+
*/
|
|
78
|
+
export const metaApiDocsToolDefinition = {
|
|
79
|
+
name: "meta_api_docs",
|
|
80
|
+
description: `Get documentation for Xano's Meta API. Use this to understand how to programmatically manage Xano workspaces, databases, APIs, functions, agents, and more.
|
|
81
|
+
|
|
82
|
+
## Topics
|
|
83
|
+
${getTopicDescriptions()}
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
- Start with "start" topic for overview and getting started
|
|
87
|
+
- Use "workflows" for step-by-step guides
|
|
88
|
+
- Use specific topics (workspace, table, api, etc.) for detailed endpoint docs`,
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: "object",
|
|
91
|
+
properties: {
|
|
92
|
+
topic: {
|
|
93
|
+
type: "string",
|
|
94
|
+
enum: getTopicNames(),
|
|
95
|
+
description: "Documentation topic to retrieve",
|
|
96
|
+
},
|
|
97
|
+
detail_level: {
|
|
98
|
+
type: "string",
|
|
99
|
+
enum: ["overview", "detailed", "examples"],
|
|
100
|
+
default: "detailed",
|
|
101
|
+
description: "Level of detail: overview (brief), detailed (full docs), examples (with code examples)",
|
|
102
|
+
},
|
|
103
|
+
include_schemas: {
|
|
104
|
+
type: "boolean",
|
|
105
|
+
default: true,
|
|
106
|
+
description: "Include JSON schemas for requests/responses",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
required: ["topic"],
|
|
110
|
+
},
|
|
111
|
+
};
|