@xano/developer-mcp 1.0.10 → 1.0.12
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 +83 -70
- package/dist/api_docs/format.d.ts +5 -0
- package/dist/api_docs/format.js +158 -0
- package/dist/api_docs/index.d.ts +52 -0
- package/dist/api_docs/index.js +111 -0
- package/dist/api_docs/topics/agent.d.ts +2 -0
- package/dist/api_docs/topics/agent.js +142 -0
- package/dist/api_docs/topics/api.d.ts +2 -0
- package/dist/api_docs/topics/api.js +176 -0
- package/dist/api_docs/topics/apigroup.d.ts +2 -0
- package/dist/api_docs/topics/apigroup.js +124 -0
- package/dist/api_docs/topics/authentication.d.ts +2 -0
- package/dist/api_docs/topics/authentication.js +61 -0
- package/dist/api_docs/topics/branch.d.ts +2 -0
- package/dist/api_docs/topics/branch.js +73 -0
- package/dist/api_docs/topics/file.d.ts +2 -0
- package/dist/api_docs/topics/file.js +70 -0
- package/dist/api_docs/topics/function.d.ts +2 -0
- package/dist/api_docs/topics/function.js +164 -0
- package/dist/api_docs/topics/history.d.ts +2 -0
- package/dist/api_docs/topics/history.js +149 -0
- package/dist/api_docs/topics/mcp_server.d.ts +2 -0
- package/dist/api_docs/topics/mcp_server.js +139 -0
- package/dist/api_docs/topics/middleware.d.ts +2 -0
- package/dist/api_docs/topics/middleware.js +156 -0
- package/dist/api_docs/topics/realtime.d.ts +2 -0
- package/dist/api_docs/topics/realtime.js +112 -0
- package/dist/api_docs/topics/start.d.ts +2 -0
- package/dist/api_docs/topics/start.js +107 -0
- package/dist/api_docs/topics/table.d.ts +2 -0
- package/dist/api_docs/topics/table.js +195 -0
- package/dist/api_docs/topics/task.d.ts +2 -0
- package/dist/api_docs/topics/task.js +165 -0
- package/dist/api_docs/topics/tool.d.ts +2 -0
- package/dist/api_docs/topics/tool.js +150 -0
- package/dist/api_docs/topics/workflows.d.ts +2 -0
- package/dist/api_docs/topics/workflows.js +131 -0
- package/dist/api_docs/topics/workspace.d.ts +2 -0
- package/dist/api_docs/topics/workspace.js +153 -0
- package/dist/api_docs/types.d.ts +79 -0
- package/dist/api_docs/types.js +4 -0
- package/dist/index.js +51 -175
- package/dist/templates/init-workspace.js +2 -16
- package/package.json +4 -7
- package/api_docs/addon.md +0 -193
- package/api_docs/agent.md +0 -154
- package/api_docs/api_group.md +0 -236
- package/api_docs/authentication.md +0 -68
- package/api_docs/file.md +0 -190
- package/api_docs/function.md +0 -217
- package/api_docs/history.md +0 -263
- package/api_docs/index.md +0 -104
- package/api_docs/mcp_server.md +0 -139
- package/api_docs/middleware.md +0 -205
- package/api_docs/realtime.md +0 -153
- package/api_docs/table.md +0 -151
- package/api_docs/task.md +0 -191
- package/api_docs/tool.md +0 -216
- package/api_docs/triggers.md +0 -344
- package/api_docs/workspace.md +0 -246
- /package/{xanoscript_docs → dist/xanoscript_docs}/README.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/addons.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/agents.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/apis.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/database.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/debugging.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/ephemeral.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/frontend.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/functions.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/integrations.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/mcp-servers.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/performance.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/realtime.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/schema.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/security.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/streaming.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/syntax.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/tables.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/tasks.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/testing.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/tools.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/triggers.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/types.md +0 -0
- /package/{xanoscript_docs → dist/xanoscript_docs}/version.json +0 -0
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ A Model Context Protocol (MCP) server that provides AI assistants with comprehen
|
|
|
6
6
|
|
|
7
7
|
This MCP server acts as a bridge between AI models and Xano's developer ecosystem, offering:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- XanoScript
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- **Meta API Documentation** - Programmatically manage Xano workspaces, databases, APIs, functions, and more
|
|
10
|
+
- **XanoScript Documentation** - Language reference with context-aware docs based on file type
|
|
11
|
+
- **Code Validation** - Syntax checking with the official XanoScript language server
|
|
12
|
+
- **Workflow Guides** - Step-by-step guides for common development tasks
|
|
13
13
|
|
|
14
14
|
## Quick Start
|
|
15
15
|
|
|
@@ -109,38 +109,7 @@ claude mcp add xano-developer node /path/to/xano-developer-mcp/dist/index.js
|
|
|
109
109
|
|
|
110
110
|
## Available Tools
|
|
111
111
|
|
|
112
|
-
### 1. `
|
|
113
|
-
|
|
114
|
-
Retrieves Xano Headless API documentation for specific resources.
|
|
115
|
-
|
|
116
|
-
**Parameters:**
|
|
117
|
-
| Parameter | Type | Required | Description |
|
|
118
|
-
|-----------|------|----------|-------------|
|
|
119
|
-
| `object` | string | No | Specific API resource to document |
|
|
120
|
-
|
|
121
|
-
**Available Objects:**
|
|
122
|
-
- `workspace` - Workspace management, branches, datasources, OpenAPI specs
|
|
123
|
-
- `table` - Database table schema management
|
|
124
|
-
- `api_group` - API groups and endpoints management
|
|
125
|
-
- `function` - Reusable function library
|
|
126
|
-
- `task` - Scheduled tasks (cron jobs)
|
|
127
|
-
- `middleware` - Request/response middleware
|
|
128
|
-
- `addon` - Response transformation queries
|
|
129
|
-
- `agent` - AI agent configuration
|
|
130
|
-
- `tool` - AI tool definitions for agents
|
|
131
|
-
- `mcp_server` - Model Context Protocol server management
|
|
132
|
-
- `realtime` - Realtime WebSocket channels
|
|
133
|
-
- `triggers` - Event-driven triggers
|
|
134
|
-
- `file` - File uploads and static hosting
|
|
135
|
-
- `history` - Request history and audit logs
|
|
136
|
-
- `authentication` - User authentication and session info
|
|
137
|
-
|
|
138
|
-
**Example:**
|
|
139
|
-
```
|
|
140
|
-
api_docs({ object: "workspace" })
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### 2. `validate_xanoscript`
|
|
112
|
+
### 1. `validate_xanoscript`
|
|
144
113
|
|
|
145
114
|
Validates XanoScript code for syntax errors. The language server auto-detects the object type from the code syntax.
|
|
146
115
|
|
|
@@ -158,7 +127,7 @@ validate_xanoscript({
|
|
|
158
127
|
|
|
159
128
|
**Returns:** List of errors with line/column positions, or confirmation of validity.
|
|
160
129
|
|
|
161
|
-
###
|
|
130
|
+
### 2. `xanoscript_docs`
|
|
162
131
|
|
|
163
132
|
Retrieves XanoScript programming language documentation with context-aware support.
|
|
164
133
|
|
|
@@ -212,21 +181,65 @@ xanoscript_docs({ file_path: "apis/users/create.xs" })
|
|
|
212
181
|
xanoscript_docs({ topic: "database", mode: "quick_reference" })
|
|
213
182
|
```
|
|
214
183
|
|
|
215
|
-
### 4. `
|
|
184
|
+
### 4. `mcp_version`
|
|
216
185
|
|
|
217
|
-
Get
|
|
186
|
+
Get the current version of the Xano Developer MCP server.
|
|
218
187
|
|
|
219
188
|
**Parameters:** None
|
|
220
189
|
|
|
221
|
-
**Returns:**
|
|
222
|
-
- Directory structure for local development
|
|
223
|
-
- File naming conventions
|
|
224
|
-
- Registry format for tracking changes
|
|
225
|
-
- Workflows for pulling/pushing XanoScript files via the Headless API
|
|
190
|
+
**Returns:** The version string from package.json.
|
|
226
191
|
|
|
227
192
|
**Example:**
|
|
228
193
|
```
|
|
229
|
-
|
|
194
|
+
mcp_version()
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 5. `api_docs`
|
|
198
|
+
|
|
199
|
+
Get documentation for Xano's Meta API. Use this to understand how to programmatically manage Xano workspaces, databases, APIs, functions, agents, and more.
|
|
200
|
+
|
|
201
|
+
**Parameters:**
|
|
202
|
+
| Parameter | Type | Required | Description |
|
|
203
|
+
|-----------|------|----------|-------------|
|
|
204
|
+
| `topic` | string | Yes | Documentation topic to retrieve |
|
|
205
|
+
| `detail_level` | string | No | `overview`, `detailed` (default), or `examples` |
|
|
206
|
+
| `include_schemas` | boolean | No | Include JSON schemas for requests/responses (default: true) |
|
|
207
|
+
|
|
208
|
+
**Available Topics:**
|
|
209
|
+
|
|
210
|
+
| Topic | Description |
|
|
211
|
+
|-------|-------------|
|
|
212
|
+
| `start` | Getting started with the Meta API |
|
|
213
|
+
| `authentication` | API authentication and authorization |
|
|
214
|
+
| `workspace` | Workspace management endpoints |
|
|
215
|
+
| `apigroup` | API group operations |
|
|
216
|
+
| `api` | API endpoint management |
|
|
217
|
+
| `table` | Database table operations |
|
|
218
|
+
| `function` | Function management |
|
|
219
|
+
| `task` | Scheduled task operations |
|
|
220
|
+
| `agent` | AI agent configuration |
|
|
221
|
+
| `tool` | AI tool management |
|
|
222
|
+
| `mcp_server` | MCP server endpoints |
|
|
223
|
+
| `middleware` | Middleware configuration |
|
|
224
|
+
| `branch` | Branch management |
|
|
225
|
+
| `realtime` | Real-time channel operations |
|
|
226
|
+
| `file` | File management |
|
|
227
|
+
| `history` | Version history |
|
|
228
|
+
| `workflows` | Step-by-step workflow guides |
|
|
229
|
+
|
|
230
|
+
**Examples:**
|
|
231
|
+
```
|
|
232
|
+
// Get overview of Meta API
|
|
233
|
+
api_docs({ topic: "start" })
|
|
234
|
+
|
|
235
|
+
// Get detailed table documentation
|
|
236
|
+
api_docs({ topic: "table", detail_level: "detailed" })
|
|
237
|
+
|
|
238
|
+
// Get examples without schemas (smaller context)
|
|
239
|
+
api_docs({ topic: "api", detail_level: "examples", include_schemas: false })
|
|
240
|
+
|
|
241
|
+
// Step-by-step workflow guides
|
|
242
|
+
api_docs({ topic: "workflows" })
|
|
230
243
|
```
|
|
231
244
|
|
|
232
245
|
## MCP Resources
|
|
@@ -266,7 +279,6 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
266
279
|
| `build` | `tsc` | Compile TypeScript to JavaScript |
|
|
267
280
|
| `start` | `node dist/index.js` | Run the MCP server |
|
|
268
281
|
| `dev` | `tsc && node dist/index.js` | Build and run in development |
|
|
269
|
-
| `sync-docs` | `npx ts-node scripts/sync-xanoscript-docs.ts` | Regenerate XanoScript documentation mapping |
|
|
270
282
|
|
|
271
283
|
## Project Structure
|
|
272
284
|
|
|
@@ -275,24 +287,19 @@ xano-developer-mcp/
|
|
|
275
287
|
├── src/
|
|
276
288
|
│ ├── index.ts # Main MCP server implementation
|
|
277
289
|
│ ├── xanoscript.d.ts # TypeScript declarations
|
|
290
|
+
│ ├── api_docs/ # Meta API documentation
|
|
291
|
+
│ │ ├── index.ts # API docs tool handler
|
|
292
|
+
│ │ ├── types.ts # Type definitions
|
|
293
|
+
│ │ ├── format.ts # Documentation formatter
|
|
294
|
+
│ │ └── topics/ # Individual topic modules
|
|
295
|
+
│ ├── xanoscript_docs/ # XanoScript language documentation
|
|
296
|
+
│ │ ├── version.json
|
|
297
|
+
│ │ ├── README.md
|
|
298
|
+
│ │ ├── syntax.md
|
|
299
|
+
│ │ └── ...
|
|
278
300
|
│ └── templates/
|
|
279
|
-
│ ├── init-workspace.ts # Workspace initialization template
|
|
280
301
|
│ └── xanoscript-index.ts
|
|
281
302
|
├── dist/ # Compiled JavaScript output
|
|
282
|
-
├── scripts/
|
|
283
|
-
│ └── sync-xanoscript-docs.ts # Documentation sync script
|
|
284
|
-
├── api_docs/ # Xano Headless API documentation (16 markdown files)
|
|
285
|
-
│ ├── index.md
|
|
286
|
-
│ ├── workspace.md
|
|
287
|
-
│ ├── table.md
|
|
288
|
-
│ └── ...
|
|
289
|
-
├── xanoscript_docs/ # XanoScript language documentation
|
|
290
|
-
│ ├── version.json
|
|
291
|
-
│ ├── README.md
|
|
292
|
-
│ ├── syntax.md
|
|
293
|
-
│ ├── functions.md
|
|
294
|
-
│ ├── apis.md
|
|
295
|
-
│ └── ...
|
|
296
303
|
├── package.json
|
|
297
304
|
└── tsconfig.json
|
|
298
305
|
```
|
|
@@ -315,16 +322,16 @@ MCP Protocol (JSON-RPC over stdio)
|
|
|
315
322
|
│
|
|
316
323
|
▼
|
|
317
324
|
Xano Developer MCP Server
|
|
318
|
-
│
|
|
319
|
-
├─► api_docs → Reads /api_docs/*.md files
|
|
320
325
|
│
|
|
321
326
|
├─► validate_xanoscript → Parses code with XanoScript language server
|
|
322
327
|
│
|
|
323
328
|
├─► xanoscript_docs → Context-aware docs from /xanoscript_docs/*.md
|
|
324
329
|
│
|
|
325
|
-
├─►
|
|
330
|
+
├─► api_docs → Meta API documentation with detail levels
|
|
331
|
+
│
|
|
332
|
+
├─► mcp_version → Returns server version from package.json
|
|
326
333
|
│
|
|
327
|
-
└─► MCP Resources → Direct access to documentation
|
|
334
|
+
└─► MCP Resources → Direct access to XanoScript documentation
|
|
328
335
|
```
|
|
329
336
|
|
|
330
337
|
## Authentication
|
|
@@ -343,11 +350,17 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
|
343
350
|
|
|
344
351
|
### Documentation Structure
|
|
345
352
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
-
|
|
349
|
-
- **
|
|
350
|
-
- **
|
|
353
|
+
**XanoScript Documentation** (`src/xanoscript_docs/`):
|
|
354
|
+
- Markdown files for XanoScript language reference
|
|
355
|
+
- Configured in `src/index.ts` via `XANOSCRIPT_DOCS_V2` with:
|
|
356
|
+
- **file**: The markdown file containing the documentation
|
|
357
|
+
- **applyTo**: Glob patterns for context-aware matching (e.g., `apis/**/*.xs`)
|
|
358
|
+
- **description**: Human-readable description of the topic
|
|
359
|
+
|
|
360
|
+
**Meta API Documentation** (`src/api_docs/`):
|
|
361
|
+
- TypeScript modules with structured documentation
|
|
362
|
+
- Supports parameterized output (detail levels, schema inclusion)
|
|
363
|
+
- Better for AI consumption due to context efficiency
|
|
351
364
|
|
|
352
365
|
## License
|
|
353
366
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utilities for API documentation output
|
|
3
|
+
*/
|
|
4
|
+
function formatParameter(param) {
|
|
5
|
+
const required = param.required ? " (required)" : "";
|
|
6
|
+
const defaultVal = param.default !== undefined ? ` [default: ${param.default}]` : "";
|
|
7
|
+
const enumVals = param.enum ? ` [options: ${param.enum.join(", ")}]` : "";
|
|
8
|
+
return ` - \`${param.name}\`: ${param.type}${required}${defaultVal}${enumVals} - ${param.description}`;
|
|
9
|
+
}
|
|
10
|
+
function formatEndpoint(ep, detailLevel) {
|
|
11
|
+
const lines = [];
|
|
12
|
+
// Method and path
|
|
13
|
+
lines.push(`### ${ep.method} ${ep.path}`);
|
|
14
|
+
if (ep.tool_name) {
|
|
15
|
+
lines.push(`**Tool:** \`${ep.tool_name}\``);
|
|
16
|
+
}
|
|
17
|
+
lines.push("");
|
|
18
|
+
lines.push(ep.description);
|
|
19
|
+
if (detailLevel === "overview") {
|
|
20
|
+
return lines.join("\n");
|
|
21
|
+
}
|
|
22
|
+
// Parameters
|
|
23
|
+
if (ep.parameters?.length) {
|
|
24
|
+
lines.push("");
|
|
25
|
+
lines.push("**Parameters:**");
|
|
26
|
+
for (const param of ep.parameters) {
|
|
27
|
+
lines.push(formatParameter(param));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Request body
|
|
31
|
+
if (ep.request_body) {
|
|
32
|
+
lines.push("");
|
|
33
|
+
lines.push(`**Request Body:** \`${ep.request_body.type}\``);
|
|
34
|
+
if (ep.request_body.properties) {
|
|
35
|
+
for (const [key, val] of Object.entries(ep.request_body.properties)) {
|
|
36
|
+
const req = val.required ? " (required)" : "";
|
|
37
|
+
lines.push(` - \`${key}\`: ${val.type}${req} - ${val.description || ""}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Example (only in detailed/examples mode)
|
|
42
|
+
if (detailLevel === "examples" && ep.example) {
|
|
43
|
+
lines.push("");
|
|
44
|
+
lines.push("**Example:**");
|
|
45
|
+
lines.push("```");
|
|
46
|
+
lines.push(`${ep.example.method} ${ep.example.path}`);
|
|
47
|
+
if (ep.example.body) {
|
|
48
|
+
lines.push(JSON.stringify(ep.example.body, null, 2));
|
|
49
|
+
}
|
|
50
|
+
lines.push("```");
|
|
51
|
+
}
|
|
52
|
+
return lines.join("\n");
|
|
53
|
+
}
|
|
54
|
+
function formatExample(ex) {
|
|
55
|
+
const lines = [];
|
|
56
|
+
lines.push(`### ${ex.title}`);
|
|
57
|
+
lines.push("");
|
|
58
|
+
lines.push(ex.description);
|
|
59
|
+
lines.push("");
|
|
60
|
+
lines.push("**Request:**");
|
|
61
|
+
lines.push("```");
|
|
62
|
+
lines.push(`${ex.request.method} ${ex.request.path}`);
|
|
63
|
+
if (ex.request.headers) {
|
|
64
|
+
for (const [key, val] of Object.entries(ex.request.headers)) {
|
|
65
|
+
lines.push(`${key}: ${val}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (ex.request.body) {
|
|
69
|
+
lines.push("");
|
|
70
|
+
lines.push(JSON.stringify(ex.request.body, null, 2));
|
|
71
|
+
}
|
|
72
|
+
lines.push("```");
|
|
73
|
+
if (ex.response !== undefined) {
|
|
74
|
+
lines.push("");
|
|
75
|
+
lines.push("**Response:**");
|
|
76
|
+
lines.push("```json");
|
|
77
|
+
lines.push(JSON.stringify(ex.response, null, 2));
|
|
78
|
+
lines.push("```");
|
|
79
|
+
}
|
|
80
|
+
return lines.join("\n");
|
|
81
|
+
}
|
|
82
|
+
function formatPattern(pattern) {
|
|
83
|
+
const lines = [];
|
|
84
|
+
lines.push(`### ${pattern.name}`);
|
|
85
|
+
if (pattern.description) {
|
|
86
|
+
lines.push("");
|
|
87
|
+
lines.push(pattern.description);
|
|
88
|
+
}
|
|
89
|
+
lines.push("");
|
|
90
|
+
lines.push("**Steps:**");
|
|
91
|
+
for (const step of pattern.steps) {
|
|
92
|
+
lines.push(step);
|
|
93
|
+
}
|
|
94
|
+
if (pattern.example) {
|
|
95
|
+
lines.push("");
|
|
96
|
+
lines.push("**Example:**");
|
|
97
|
+
lines.push("```");
|
|
98
|
+
lines.push(pattern.example);
|
|
99
|
+
lines.push("```");
|
|
100
|
+
}
|
|
101
|
+
return lines.join("\n");
|
|
102
|
+
}
|
|
103
|
+
export function formatDocumentation(doc, detailLevel = "detailed", includeSchemas = true) {
|
|
104
|
+
const sections = [];
|
|
105
|
+
// Header
|
|
106
|
+
sections.push(`# ${doc.title}`);
|
|
107
|
+
sections.push("");
|
|
108
|
+
sections.push(doc.description);
|
|
109
|
+
// AI Hints (always include for AI optimization)
|
|
110
|
+
if (doc.ai_hints) {
|
|
111
|
+
sections.push("");
|
|
112
|
+
sections.push("## AI Usage Hints");
|
|
113
|
+
sections.push(doc.ai_hints);
|
|
114
|
+
}
|
|
115
|
+
// Endpoints
|
|
116
|
+
if (doc.endpoints?.length) {
|
|
117
|
+
sections.push("");
|
|
118
|
+
sections.push("## Endpoints");
|
|
119
|
+
for (const ep of doc.endpoints) {
|
|
120
|
+
sections.push("");
|
|
121
|
+
sections.push(formatEndpoint(ep, detailLevel));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Patterns/Workflows
|
|
125
|
+
if (doc.patterns?.length) {
|
|
126
|
+
sections.push("");
|
|
127
|
+
sections.push("## Workflows");
|
|
128
|
+
for (const pattern of doc.patterns) {
|
|
129
|
+
sections.push("");
|
|
130
|
+
sections.push(formatPattern(pattern));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Examples
|
|
134
|
+
if ((detailLevel === "detailed" || detailLevel === "examples") && doc.examples?.length) {
|
|
135
|
+
sections.push("");
|
|
136
|
+
sections.push("## Examples");
|
|
137
|
+
for (const ex of doc.examples) {
|
|
138
|
+
sections.push("");
|
|
139
|
+
sections.push(formatExample(ex));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Schemas
|
|
143
|
+
if (includeSchemas && doc.schemas && Object.keys(doc.schemas).length > 0) {
|
|
144
|
+
sections.push("");
|
|
145
|
+
sections.push("## Schemas");
|
|
146
|
+
sections.push("");
|
|
147
|
+
sections.push("```json");
|
|
148
|
+
sections.push(JSON.stringify(doc.schemas, null, 2));
|
|
149
|
+
sections.push("```");
|
|
150
|
+
}
|
|
151
|
+
// Related topics
|
|
152
|
+
if (doc.related_topics?.length) {
|
|
153
|
+
sections.push("");
|
|
154
|
+
sections.push("## Related Topics");
|
|
155
|
+
sections.push(`Use \`api_docs\` with topic: ${doc.related_topics.join(", ")}`);
|
|
156
|
+
}
|
|
157
|
+
return sections.join("\n");
|
|
158
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Xano Meta API Documentation Index
|
|
3
|
+
*
|
|
4
|
+
* This module exports all documentation topics and provides
|
|
5
|
+
* the api_docs tool handler for the MCP server.
|
|
6
|
+
*/
|
|
7
|
+
import type { TopicDoc, ApiDocsArgs } 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 api_docs tool
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleApiDocs(args: ApiDocsArgs): string;
|
|
24
|
+
/**
|
|
25
|
+
* Tool definition for MCP server
|
|
26
|
+
*/
|
|
27
|
+
export declare const apiDocsToolDefinition: {
|
|
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 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 api_docs tool
|
|
64
|
+
*/
|
|
65
|
+
export function handleApiDocs(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 apiDocsToolDefinition = {
|
|
79
|
+
name: "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
|
+
};
|