@xano/developer-mcp 1.0.15 → 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 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
- | `ephemeral` | Temporary test environments |
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.
@@ -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/ephemeral` | Temporary test environments |
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
- │ ├── meta_api_docs/ # Meta API documentation
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
@@ -329,6 +373,8 @@ Xano Developer MCP Server
329
373
 
330
374
  ├─► meta_api_docs → Meta API documentation with detail levels
331
375
 
376
+ ├─► run_api_docs → Run API documentation for runtime execution
377
+
332
378
  ├─► mcp_version → Returns server version from package.json
333
379
 
334
380
  └─► MCP Resources → Direct access to XanoScript documentation
package/dist/index.js CHANGED
@@ -94,10 +94,10 @@ const XANOSCRIPT_DOCS_V2 = {
94
94
  applyTo: ["static/**/*"],
95
95
  description: "Static frontend development and deployment",
96
96
  },
97
- ephemeral: {
98
- file: "ephemeral.md",
99
- applyTo: ["ephemeral/**/*.xs"],
100
- description: "Temporary test environments",
97
+ run: {
98
+ file: "run.md",
99
+ applyTo: ["run/**/*.xs"],
100
+ description: "Run job and service configurations for the Xano Job Runner",
101
101
  },
102
102
  addons: {
103
103
  file: "addons.md",
@@ -64,6 +64,6 @@ ${formatRow("security", "Security best practices")}
64
64
  ${formatRow("streaming", "Streaming data from files and responses")}
65
65
  ${formatRow("testing", "Unit testing XanoScript code")}
66
66
  ${formatRow("tips", "Tips and tricks")}
67
- ${formatRow("ephemeral", "Ephemeral environment setup")}
67
+ ${formatRow("run", "Run job and service configurations")}
68
68
  `;
69
69
  }
@@ -33,7 +33,7 @@ project/
33
33
  ├── mcp_servers/ // MCP server definitions
34
34
  ├── addons/ // Query addons
35
35
  ├── static/ // Frontend files (HTML, CSS, JS)
36
- └── ephemeral/ // Temporary test environments
36
+ └── run/ // Job and service configurations
37
37
  ```
38
38
 
39
39
  ## Environment Variables
@@ -147,7 +147,7 @@ Use `xanoscript_docs({ keyword: "<keyword>" })` to retrieve documentation.
147
147
  | Testing | `testing` | Unit tests and mocking |
148
148
  | Debugging | `debugging` | Logging and inspection tools |
149
149
  | Frontend | `frontend` | Static frontend development |
150
- | Ephemeral | `ephemeral` | Temporary environments |
150
+ | Run | `run` | Job and service configurations |
151
151
 
152
152
  ### Best Practices
153
153
  | Topic | Keyword | Description |
@@ -0,0 +1,357 @@
1
+ ---
2
+ applyTo: "run/**/*.xs"
3
+ ---
4
+
5
+ # Run Configurations
6
+
7
+ Define job and service configurations for the Xano Job Runner.
8
+
9
+ ## Quick Reference
10
+
11
+ | Type | Purpose | Lifecycle |
12
+ |------|---------|-----------|
13
+ | **run.job** | Execute a function once | Runs main function, then shuts down |
14
+ | **run.service** | Long-running background process | Runs pre initialization, then maintains service |
15
+
16
+ ### Directory Structure
17
+ ```
18
+ run/
19
+ ├── my-job/
20
+ │ ├── run.xs
21
+ │ ├── tables/
22
+ │ └── functions/
23
+ └── my-service/
24
+ ├── run.xs
25
+ ├── tables/
26
+ ├── functions/
27
+ └── apis/
28
+ ```
29
+
30
+ ---
31
+
32
+ ## run.job
33
+
34
+ Execute a function as a standalone job in the Xano Job Runner.
35
+
36
+ ### Syntax
37
+ ```xs
38
+ run.job "Job Name" {
39
+ main = {
40
+ name: "function_name"
41
+ input: { key: value }
42
+ }
43
+ env = ["ENV_VAR1", "ENV_VAR2"]
44
+ }
45
+ ```
46
+
47
+ ### Properties
48
+
49
+ | Property | Type | Required | Description |
50
+ |----------|------|----------|-------------|
51
+ | `main` | Object | Yes | Function to execute |
52
+ | `main.name` | String | Yes | Name of the function to call |
53
+ | `main.input` | Object | No | Input parameters for the function |
54
+ | `env` | String[] | No | Environment variables required |
55
+
56
+ ### Basic Example
57
+ ```xs
58
+ run.job "Random Dad Joke" {
59
+ main = {
60
+ name: "fetch_dad_joke"
61
+ input: {}
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### With Input Parameters
67
+ ```xs
68
+ run.job "Average of values" {
69
+ main = {
70
+ name: "avg_value"
71
+ input: {
72
+ left: 1
73
+ right: 2
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### With Environment Variables
80
+ ```xs
81
+ run.job "Gemini Image Understanding" {
82
+ main = {
83
+ name: "analyze_image"
84
+ input: {
85
+ model: "gemini-1.5-flash"
86
+ prompt: "Describe what is happening in this image."
87
+ image: "(attach image file)"
88
+ }
89
+ }
90
+ env = ["gemini_api_key"]
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## run.service
97
+
98
+ Define a long-running background service with optional initialization.
99
+
100
+ ### Syntax
101
+ ```xs
102
+ run.service "Service Name" {
103
+ pre = {
104
+ name: "init_function"
105
+ input: { key: value }
106
+ }
107
+ env = ["ENV_VAR1", "ENV_VAR2"]
108
+ }
109
+ ```
110
+
111
+ ### Properties
112
+
113
+ | Property | Type | Required | Description |
114
+ |----------|------|----------|-------------|
115
+ | `pre` | Object | No | Initialization function |
116
+ | `pre.name` | String | Yes (if pre) | Name of the init function |
117
+ | `pre.input` | Object | No | Input parameters for init |
118
+ | `env` | String[] | No | Environment variables required |
119
+
120
+ ### Minimal Form
121
+ ```xs
122
+ run.service "email proxy"
123
+ ```
124
+
125
+ ### Basic Example
126
+ ```xs
127
+ run.service "Random Dad Joke" {
128
+ pre = {
129
+ name: "fetch_dad_joke"
130
+ input: {}
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### With Initialization
136
+ ```xs
137
+ run.service "email proxy" {
138
+ pre = {
139
+ name: "email_proxy_init"
140
+ input: {
141
+ config: "default"
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### With Environment Variables
148
+ ```xs
149
+ run.service "webhook listener" {
150
+ pre = {
151
+ name: "init_webhook_listener"
152
+ input: {
153
+ port: 8080
154
+ }
155
+ }
156
+ env = ["webhook_secret", "database_url"]
157
+ }
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Supporting Files
163
+
164
+ Jobs and services can include supporting tables and functions.
165
+
166
+ ### Table with Seed Data
167
+ ```xs
168
+ table users {
169
+ auth = false
170
+ schema {
171
+ int id
172
+ text name
173
+ text email
174
+ timestamp created_at?=now
175
+ }
176
+ index = [
177
+ {type: "primary", field: [{name: "id"}]}
178
+ ]
179
+ items = [
180
+ {"id": 1, "name": "Alice", "email": "alice@example.com"}
181
+ {"id": 2, "name": "Bob", "email": "bob@example.com"}
182
+ ]
183
+ }
184
+ ```
185
+
186
+ ### Function Definition
187
+ ```xs
188
+ function "process_data" {
189
+ input {
190
+ json data
191
+ }
192
+ stack {
193
+ db.query users {
194
+ return = { type: "list" }
195
+ } as $users
196
+ }
197
+ response = $users
198
+ }
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Complete Job Example
204
+
205
+ ```
206
+ run/data-migration/
207
+ ├── run.xs
208
+ ├── tables/
209
+ │ └── users.xs
210
+ └── functions/
211
+ └── migrate_users.xs
212
+ ```
213
+
214
+ ### run.xs
215
+ ```xs
216
+ run.job "Data Migration" {
217
+ main = {
218
+ name: "migrate_users"
219
+ input: {
220
+ batch_size: 100
221
+ }
222
+ }
223
+ env = ["source_db_url", "webhook_url"]
224
+ }
225
+ ```
226
+
227
+ ### tables/users.xs
228
+ ```xs
229
+ table users {
230
+ auth = false
231
+ schema {
232
+ int id
233
+ text name
234
+ text email
235
+ timestamp migrated_at?
236
+ }
237
+ index = [
238
+ {type: "primary", field: [{name: "id"}]}
239
+ ]
240
+ items = [
241
+ {"id": 1, "name": "Alice", "email": "alice@example.com"}
242
+ {"id": 2, "name": "Bob", "email": "bob@example.com"}
243
+ ]
244
+ }
245
+ ```
246
+
247
+ ### functions/migrate_users.xs
248
+ ```xs
249
+ function "migrate_users" {
250
+ input {
251
+ int batch_size
252
+ }
253
+ stack {
254
+ db.query users {
255
+ where = $db.users.migrated_at == null
256
+ paging = { page: 1, per_page: $input.batch_size }
257
+ } as $pending
258
+
259
+ foreach ($pending) {
260
+ each as $user {
261
+ db.edit users {
262
+ field_name = "id"
263
+ field_value = $user.id
264
+ data = { migrated_at: now }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ response = { migrated: $pending|count }
270
+ }
271
+ ```
272
+
273
+ ---
274
+
275
+ ## Complete Service Example
276
+
277
+ ```
278
+ run/event-tracker/
279
+ ├── run.xs
280
+ ├── tables/
281
+ │ └── event.xs
282
+ └── apis/
283
+ ├── api_group.xs
284
+ ├── list.xs
285
+ └── add.xs
286
+ ```
287
+
288
+ ### run.xs
289
+ ```xs
290
+ run.service "Event Tracker" {
291
+ pre = {
292
+ name: "init_tracker"
293
+ input: {}
294
+ }
295
+ env = ["api_key"]
296
+ }
297
+ ```
298
+
299
+ ### tables/event.xs
300
+ ```xs
301
+ table event {
302
+ auth = false
303
+ schema {
304
+ int id
305
+ timestamp created_at?=now
306
+ text name
307
+ }
308
+ index = [
309
+ {type: "primary", field: [{name: "id"}]}
310
+ ]
311
+ items = []
312
+ }
313
+ ```
314
+
315
+ ### apis/list.xs
316
+ ```xs
317
+ query list verb=GET {
318
+ api_group = "events"
319
+ stack {
320
+ db.query event {
321
+ sort = { created_at: "desc" }
322
+ return = { type: "list" }
323
+ } as $events
324
+ }
325
+ response = $events
326
+ }
327
+ ```
328
+
329
+ ---
330
+
331
+ ## Differences: run.job vs run.service
332
+
333
+ | Feature | run.job | run.service |
334
+ |---------|---------|-------------|
335
+ | Required attribute | `main` | None |
336
+ | Init function | N/A | `pre` (optional) |
337
+ | Lifecycle | Executes once | Long-running |
338
+ | Use case | One-time operations | Proxies, listeners, daemons |
339
+
340
+ ---
341
+
342
+ ## Validation Rules
343
+
344
+ 1. **run.job requires `main`** - Missing `main` causes an error
345
+ 2. **run.service cannot use `main`** - Use `pre` for initialization
346
+ 3. **`env` must be string array** - Cannot contain numbers or booleans
347
+ 4. **Input values must be constants** - No variables like `$input` allowed
348
+
349
+ ---
350
+
351
+ ## Best Practices
352
+
353
+ 1. **Name clearly** - Indicate purpose: `data-migration`, `email-proxy`
354
+ 2. **Use env for secrets** - Never hardcode API keys or credentials
355
+ 3. **Keep self-contained** - Include all required tables and functions
356
+ 4. **Seed test data** - Use `items` in table definitions for testing
357
+ 5. **Validate inputs** - Use preconditions in functions for input validation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "MCP server for Xano Headless API documentation and XanoScript code validation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",