@xano/developer-mcp 1.0.11 → 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 +78 -60
- 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 +46 -92
- 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
|
|
|
@@ -225,6 +194,54 @@ Get the current version of the Xano Developer MCP server.
|
|
|
225
194
|
mcp_version()
|
|
226
195
|
```
|
|
227
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" })
|
|
243
|
+
```
|
|
244
|
+
|
|
228
245
|
## MCP Resources
|
|
229
246
|
|
|
230
247
|
The server also exposes XanoScript documentation as MCP resources for direct access:
|
|
@@ -262,7 +279,6 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
262
279
|
| `build` | `tsc` | Compile TypeScript to JavaScript |
|
|
263
280
|
| `start` | `node dist/index.js` | Run the MCP server |
|
|
264
281
|
| `dev` | `tsc && node dist/index.js` | Build and run in development |
|
|
265
|
-
| `sync-docs` | `npx ts-node scripts/sync-xanoscript-docs.ts` | Regenerate XanoScript documentation mapping |
|
|
266
282
|
|
|
267
283
|
## Project Structure
|
|
268
284
|
|
|
@@ -271,23 +287,19 @@ xano-developer-mcp/
|
|
|
271
287
|
├── src/
|
|
272
288
|
│ ├── index.ts # Main MCP server implementation
|
|
273
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
|
+
│ │ └── ...
|
|
274
300
|
│ └── templates/
|
|
275
301
|
│ └── xanoscript-index.ts
|
|
276
302
|
├── dist/ # Compiled JavaScript output
|
|
277
|
-
├── scripts/
|
|
278
|
-
│ └── sync-xanoscript-docs.ts # Documentation sync script
|
|
279
|
-
├── api_docs/ # Xano Headless API documentation (16 markdown files)
|
|
280
|
-
│ ├── index.md
|
|
281
|
-
│ ├── workspace.md
|
|
282
|
-
│ ├── table.md
|
|
283
|
-
│ └── ...
|
|
284
|
-
├── xanoscript_docs/ # XanoScript language documentation
|
|
285
|
-
│ ├── version.json
|
|
286
|
-
│ ├── README.md
|
|
287
|
-
│ ├── syntax.md
|
|
288
|
-
│ ├── functions.md
|
|
289
|
-
│ ├── apis.md
|
|
290
|
-
│ └── ...
|
|
291
303
|
├── package.json
|
|
292
304
|
└── tsconfig.json
|
|
293
305
|
```
|
|
@@ -310,16 +322,16 @@ MCP Protocol (JSON-RPC over stdio)
|
|
|
310
322
|
│
|
|
311
323
|
▼
|
|
312
324
|
Xano Developer MCP Server
|
|
313
|
-
│
|
|
314
|
-
├─► api_docs → Reads /api_docs/*.md files
|
|
315
325
|
│
|
|
316
326
|
├─► validate_xanoscript → Parses code with XanoScript language server
|
|
317
327
|
│
|
|
318
328
|
├─► xanoscript_docs → Context-aware docs from /xanoscript_docs/*.md
|
|
319
329
|
│
|
|
330
|
+
├─► api_docs → Meta API documentation with detail levels
|
|
331
|
+
│
|
|
320
332
|
├─► mcp_version → Returns server version from package.json
|
|
321
333
|
│
|
|
322
|
-
└─► MCP Resources → Direct access to documentation
|
|
334
|
+
└─► MCP Resources → Direct access to XanoScript documentation
|
|
323
335
|
```
|
|
324
336
|
|
|
325
337
|
## Authentication
|
|
@@ -338,11 +350,17 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
|
338
350
|
|
|
339
351
|
### Documentation Structure
|
|
340
352
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
-
|
|
344
|
-
- **
|
|
345
|
-
- **
|
|
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
|
|
346
364
|
|
|
347
365
|
## License
|
|
348
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
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export const agentDoc = {
|
|
2
|
+
topic: "agent",
|
|
3
|
+
title: "AI Agent Management",
|
|
4
|
+
description: `Agents are AI-powered automation units that use LLMs (like Claude) to make decisions and execute multi-step workflows.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
- Agents use LLMs for reasoning and decision-making
|
|
8
|
+
- Can call tools to perform actions
|
|
9
|
+
- Support multiple LLM providers (Anthropic, OpenAI, etc.)
|
|
10
|
+
- Configurable system prompts, temperature, max steps
|
|
11
|
+
- Can have triggers that invoke them automatically
|
|
12
|
+
|
|
13
|
+
## LLM Configuration
|
|
14
|
+
- Type: Provider (e.g., "anthropic")
|
|
15
|
+
- Model: Specific model (e.g., "claude-4-sonnet-20250514")
|
|
16
|
+
- System prompt: Instructions for the agent
|
|
17
|
+
- Temperature: Creativity level (0-1)
|
|
18
|
+
- Max steps: Maximum reasoning iterations
|
|
19
|
+
- Reasoning: Enable/disable chain-of-thought`,
|
|
20
|
+
ai_hints: `- Create tools first, then create agent and associate tools
|
|
21
|
+
- System prompt is critical for agent behavior
|
|
22
|
+
- Lower temperature = more deterministic responses
|
|
23
|
+
- Max steps limits runaway agent loops
|
|
24
|
+
- Use triggers to invoke agents on events (table changes, etc.)`,
|
|
25
|
+
endpoints: [
|
|
26
|
+
{
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: "/workspace/{workspace_id}/agent",
|
|
29
|
+
tool_name: "listAgents",
|
|
30
|
+
description: "List all AI agents in a workspace.",
|
|
31
|
+
parameters: [
|
|
32
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
33
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
34
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" },
|
|
35
|
+
{ name: "search", type: "string", description: "Search by agent name" },
|
|
36
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript definition" },
|
|
37
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft versions" }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
method: "GET",
|
|
42
|
+
path: "/workspace/{workspace_id}/agent/{agent_id}",
|
|
43
|
+
tool_name: "getAgent",
|
|
44
|
+
description: "Get details of a specific AI agent.",
|
|
45
|
+
parameters: [
|
|
46
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
47
|
+
{ name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" },
|
|
48
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript definition" },
|
|
49
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft version" }
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
method: "POST",
|
|
54
|
+
path: "/workspace/{workspace_id}/agent",
|
|
55
|
+
tool_name: "createAgent",
|
|
56
|
+
description: "Create a new AI agent with LLM configuration.",
|
|
57
|
+
parameters: [
|
|
58
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
59
|
+
],
|
|
60
|
+
request_body: {
|
|
61
|
+
type: "application/json",
|
|
62
|
+
properties: {
|
|
63
|
+
name: { type: "string", description: "Agent name", required: true },
|
|
64
|
+
description: { type: "string", description: "Agent description" },
|
|
65
|
+
xanoscript: { type: "string", description: "XanoScript agent definition", required: true }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
example: {
|
|
69
|
+
method: "POST",
|
|
70
|
+
path: "/workspace/1/agent",
|
|
71
|
+
body: {
|
|
72
|
+
name: "support_agent",
|
|
73
|
+
description: "Customer support AI agent",
|
|
74
|
+
xanoscript: `agent support_agent {
|
|
75
|
+
llm {
|
|
76
|
+
type = "anthropic"
|
|
77
|
+
model = "claude-4-sonnet-20250514"
|
|
78
|
+
system_prompt = "You are a helpful customer support agent."
|
|
79
|
+
max_steps = 10
|
|
80
|
+
temperature = 0.3
|
|
81
|
+
}
|
|
82
|
+
tools = [lookup_order, update_ticket]
|
|
83
|
+
}`
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
method: "PUT",
|
|
89
|
+
path: "/workspace/{workspace_id}/agent/{agent_id}",
|
|
90
|
+
tool_name: "updateAgent",
|
|
91
|
+
description: "Update an existing AI agent.",
|
|
92
|
+
parameters: [
|
|
93
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
94
|
+
{ name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" },
|
|
95
|
+
{ name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
|
|
96
|
+
],
|
|
97
|
+
request_body: {
|
|
98
|
+
type: "application/json",
|
|
99
|
+
properties: {
|
|
100
|
+
name: { type: "string", description: "Agent name" },
|
|
101
|
+
description: { type: "string", description: "Agent description" },
|
|
102
|
+
xanoscript: { type: "string", description: "XanoScript agent definition" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
method: "DELETE",
|
|
108
|
+
path: "/workspace/{workspace_id}/agent/{agent_id}",
|
|
109
|
+
tool_name: "deleteAgent",
|
|
110
|
+
description: "Delete an AI agent.",
|
|
111
|
+
parameters: [
|
|
112
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
113
|
+
{ name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
schemas: {
|
|
118
|
+
Agent: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
id: { type: "integer" },
|
|
122
|
+
name: { type: "string" },
|
|
123
|
+
description: { type: "string" },
|
|
124
|
+
llm: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
type: { type: "string", description: "LLM provider (anthropic, openai, etc.)" },
|
|
128
|
+
model: { type: "string", description: "Model identifier" },
|
|
129
|
+
system_prompt: { type: "string" },
|
|
130
|
+
max_steps: { type: "integer" },
|
|
131
|
+
temperature: { type: "number" },
|
|
132
|
+
reasoning: { type: "boolean" }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
tools: { type: "array", items: { type: "string" } },
|
|
136
|
+
created_at: { type: "string", format: "date-time" },
|
|
137
|
+
updated_at: { type: "string", format: "date-time" }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
related_topics: ["tool", "mcp_server", "function"]
|
|
142
|
+
};
|