@xano/developer-mcp 2.2.6 → 2.3.0-beta.1
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 +16 -5
- package/dist/cli_docs/index.js +4 -0
- package/dist/cli_docs/topics/function.js +2 -0
- package/dist/cli_docs/topics/knowledge.js +2 -1
- package/dist/cli_docs/topics/policy.d.ts +2 -0
- package/dist/cli_docs/topics/policy.js +91 -0
- package/dist/cli_docs/topics/skills.d.ts +2 -0
- package/dist/cli_docs/topics/skills.js +57 -0
- package/dist/cli_docs/topics/workspace.js +11 -4
- package/dist/meta_api_docs/index.js +6 -0
- package/dist/meta_api_docs/topics/mcp_primitive.d.ts +13 -0
- package/dist/meta_api_docs/topics/mcp_primitive.js +105 -0
- package/dist/meta_api_docs/topics/mcp_server.js +6 -2
- package/dist/meta_api_docs/topics/policy.d.ts +3 -0
- package/dist/meta_api_docs/topics/policy.js +135 -0
- package/dist/meta_api_docs/topics/prompt.d.ts +2 -0
- package/dist/meta_api_docs/topics/prompt.js +54 -0
- package/dist/meta_api_docs/topics/resource.d.ts +2 -0
- package/dist/meta_api_docs/topics/resource.js +49 -0
- package/dist/meta_api_docs/topics/tool.js +24 -2
- package/dist/tools/validate_xanoscript.js +14 -2
- package/dist/xanoscript.d.ts +5 -0
- package/dist/xanoscript.js +4 -0
- package/dist/xanoscript_docs/README.md +3 -0
- package/dist/xanoscript_docs/database.md +112 -3
- package/dist/xanoscript_docs/docs_index.json +31 -4
- package/dist/xanoscript_docs/essentials.md +12 -0
- package/dist/xanoscript_docs/mcp-servers.md +149 -4
- package/dist/xanoscript_docs/policies.md +308 -0
- package/dist/xanoscript_docs/prompts.md +153 -0
- package/dist/xanoscript_docs/resources.md +178 -0
- package/dist/xanoscript_docs/survival.md +5 -1
- package/dist/xanoscript_docs/tools.md +120 -1
- package/dist/xanoscript_docs/types.md +1 -1
- package/dist/xanoscript_docs/version.json +2 -2
- package/dist/xanoscript_docs/working.md +16 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -78,12 +78,15 @@ Add to your Claude Desktop configuration file:
|
|
|
78
78
|
|
|
79
79
|
## Xano Skills
|
|
80
80
|
|
|
81
|
-
This repo ships
|
|
81
|
+
This repo ships three agent skills under `skills/`:
|
|
82
82
|
|
|
83
83
|
- **`xano-init`** — guided setup that profiles a Xano workspace and builds a sandbox-first development playbook
|
|
84
84
|
- **`xanoscript-docs-expert`** — deep reference for working with XanoScript documentation and this MCP project's architecture
|
|
85
|
+
- **`xano-policies`** — stub for workspace policies: the authoring rules that never change, plus `xano skills pull` to install the live, catalogue-generated skill from your instance
|
|
85
86
|
|
|
86
|
-
**Using Claude Code inside this repo?** You already have
|
|
87
|
+
**Using Claude Code inside this repo?** You already have all three skills. They're committed to `.claude/skills/` and load automatically when Claude Code starts a session in this directory — no install step needed. Just invoke `xano-init`, `xanoscript-docs-expert` or `xano-policies` by name, or describe the task in natural language.
|
|
88
|
+
|
|
89
|
+
> Only the root `skills/` folder is published (skills.sh indexes it, and `npx skills add` installs from it); `.claude/skills/` is the copy this repo's own Claude Code sessions load. Edit `xano-policies` in both places: a test fails when its two copies differ.
|
|
87
90
|
|
|
88
91
|
**Using a different agent, or want the skills available in other projects?** Skills are distributed via the open [Agent Skills standard](https://github.com/vercel-labs/skills) and install with a single `npx` command — no cloning or manual file copying.
|
|
89
92
|
|
|
@@ -100,7 +103,7 @@ npx skills add xano-inc/xano-developer-mcp -s xano-init \
|
|
|
100
103
|
-a claude-code -a codex -a cursor -a opencode -g
|
|
101
104
|
```
|
|
102
105
|
|
|
103
|
-
Drop `-s` to install every skill in the repo, or drop `-g` to scope the install to the current project instead of your user profile. Other supported agents include `gemini-cli`, `windsurf`, `continue`, `cline`, `github-copilot`, and more — see the [skills CLI](https://github.com/vercel-labs/skills) for the full list.
|
|
106
|
+
Drop `-s` to install every skill in the repo, or drop `-g` to scope the install to the current project instead of your user profile. Install `xano-policies` per project for Claude Code (`-s xano-policies -a claude-code`, without `-g`): that is the file `xano skills pull` replaces with your instance's live skill. A global or other-agent install of the stub stays in place after a pull, so remove it then. Other supported agents include `gemini-cli`, `windsurf`, `continue`, `cline`, `github-copilot`, and more — see the [skills CLI](https://github.com/vercel-labs/skills) for the full list.
|
|
104
107
|
|
|
105
108
|
Start a new agent session after installing so the skill manifest is picked up.
|
|
106
109
|
|
|
@@ -325,7 +328,7 @@ import '@xano/developer-mcp/server';
|
|
|
325
328
|
|
|
326
329
|
### 1. `xano_validate_xanoscript`
|
|
327
330
|
|
|
328
|
-
Validates XanoScript code for syntax errors. Supports multiple input methods. The language server auto-detects the object type from the code syntax.
|
|
331
|
+
Validates XanoScript code for syntax errors. Supports multiple input methods. The language server auto-detects the object type from the code syntax, including policy documents (`policies/*.xs`), whose rules are checked against the check catalogue bundled with the language server; a catalogue problem is a warning, since your instance decides on save.
|
|
329
332
|
|
|
330
333
|
**Parameters:**
|
|
331
334
|
| Parameter | Type | Required | Description |
|
|
@@ -412,6 +415,7 @@ Retrieves XanoScript programming language documentation with context-aware suppo
|
|
|
412
415
|
| `middleware` | Request/response interceptors for functions, queries, tasks, and tools |
|
|
413
416
|
| `branch` | Branch-level settings: middleware, history retention, visual styling |
|
|
414
417
|
| `workspace` | Workspace-level settings: environment variables, preferences, realtime |
|
|
418
|
+
| `policies` | Workspace policy documents: syntax, the check catalogue, goals and authoring rules |
|
|
415
419
|
|
|
416
420
|
**Examples:**
|
|
417
421
|
```
|
|
@@ -493,6 +497,7 @@ Get documentation for Xano's Meta API. Use this to understand how to programmati
|
|
|
493
497
|
| `realtime` | Real-time channel operations |
|
|
494
498
|
| `file` | File management |
|
|
495
499
|
| `history` | Version history |
|
|
500
|
+
| `policy` | Workspace policies: check catalogue and goals, parse, save, object lookup, evaluate, runs (whole, summary and findings pages), agent skill |
|
|
496
501
|
| `workflows` | Step-by-step workflow guides |
|
|
497
502
|
|
|
498
503
|
**Examples:**
|
|
@@ -540,6 +545,8 @@ Use this tool to understand CLI commands for local development, code synchroniza
|
|
|
540
545
|
| `tenant` | Tenant management - CRUD, deployments, env vars, backups, clusters |
|
|
541
546
|
| `unit_test` | Unit test management - list and run unit tests |
|
|
542
547
|
| `workflow_test` | Workflow test management - list, run, and manage workflow tests |
|
|
548
|
+
| `policy` | Workspace policies - catalogue, parse, publish, evaluate, status, runs, delete |
|
|
549
|
+
| `skills` | Install the agent skill the instance generates (`skills pull`) |
|
|
543
550
|
| `platform` | Platform management - list and view platform versions |
|
|
544
551
|
| `static_host` | Static hosting - deploy frontend builds |
|
|
545
552
|
| `update` | Update the CLI to the latest version |
|
|
@@ -602,6 +609,7 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
602
609
|
| `xanoscript://docs/middleware` | Request/response interceptors |
|
|
603
610
|
| `xanoscript://docs/branch` | Branch-level settings |
|
|
604
611
|
| `xanoscript://docs/workspace` | Workspace-level settings |
|
|
612
|
+
| `xanoscript://docs/policies` | Workspace policy documents |
|
|
605
613
|
|
|
606
614
|
## npm Scripts
|
|
607
615
|
|
|
@@ -613,6 +621,7 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
|
|
|
613
621
|
| `test` | `vitest run` | Run unit tests |
|
|
614
622
|
| `test:watch` | `vitest` | Run tests in watch mode |
|
|
615
623
|
| `test:coverage` | `vitest run --coverage` | Run tests with coverage report |
|
|
624
|
+
| `gen:policy-docs` | `node scripts/gen-policy-check-docs.mjs` | Regenerate the check catalogue regions of `policies.md` from `scripts/policy-catalogue.json` |
|
|
616
625
|
|
|
617
626
|
## Project Structure
|
|
618
627
|
|
|
@@ -669,7 +678,7 @@ xano-developer-mcp/
|
|
|
669
678
|
| Package | Version | Purpose |
|
|
670
679
|
|---------|---------|---------|
|
|
671
680
|
| `@modelcontextprotocol/sdk` | ^1.26.0 | Official MCP SDK |
|
|
672
|
-
| `@xano/xanoscript-language-server` | ^
|
|
681
|
+
| `@xano/xanoscript-language-server` | ^12.18.0 | XanoScript parser and validation |
|
|
673
682
|
| `minimatch` | ^10.1.2 | Glob pattern matching for context-aware docs |
|
|
674
683
|
|
|
675
684
|
### Dev Dependencies
|
|
@@ -729,6 +738,8 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
|
729
738
|
- **description**: Human-readable description of the topic
|
|
730
739
|
- **aliases**: Alternative names for topic lookup
|
|
731
740
|
- **priority**: Ordering weight for file_path matching
|
|
741
|
+
- **exclusive**: The topic alone documents the files its `applyTo` matches, so file_path mode returns only that topic
|
|
742
|
+
- The check catalogue in `policies.md` is generated between its `BEGIN GENERATED` and `END GENERATED` markers. To refresh it, save the catalogue the platform serves (`xano policy catalogue -o json`, from an instance running the matching platform version) to `scripts/policy-catalogue.json`, then run `npm run gen:policy-docs`; a test fails when the two disagree
|
|
732
743
|
|
|
733
744
|
**Meta API Documentation** (`src/meta_api_docs/`):
|
|
734
745
|
- TypeScript modules with structured documentation
|
package/dist/cli_docs/index.js
CHANGED
|
@@ -24,6 +24,8 @@ import { platformDoc } from "./topics/platform.js";
|
|
|
24
24
|
import { staticHostDoc } from "./topics/static_host.js";
|
|
25
25
|
import { updateDoc } from "./topics/update.js";
|
|
26
26
|
import { integrationDoc } from "./topics/integration.js";
|
|
27
|
+
import { policyDoc } from "./topics/policy.js";
|
|
28
|
+
import { skillsDoc } from "./topics/skills.js";
|
|
27
29
|
/**
|
|
28
30
|
* All available documentation topics
|
|
29
31
|
*/
|
|
@@ -44,6 +46,8 @@ export const topics = {
|
|
|
44
46
|
static_host: staticHostDoc,
|
|
45
47
|
update: updateDoc,
|
|
46
48
|
integration: integrationDoc,
|
|
49
|
+
policy: policyDoc,
|
|
50
|
+
skills: skillsDoc,
|
|
47
51
|
};
|
|
48
52
|
/**
|
|
49
53
|
* Get list of all available topic names
|
|
@@ -87,6 +87,7 @@ Xano CLI commands are SPACE-separated (e.g. \`xano function list\`), not colon-s
|
|
|
87
87
|
{ name: "file", short: "f", type: "string", required: false, description: "Path to file containing XanoScript code (mutually exclusive with --stdin)" },
|
|
88
88
|
{ name: "stdin", short: "s", type: "boolean", required: false, default: "false", description: "Read XanoScript code from stdin (mutually exclusive with --file)" },
|
|
89
89
|
{ name: "edit", short: "e", type: "boolean", required: false, default: "false", description: "Open the file in $EDITOR before creating (requires --file)" },
|
|
90
|
+
{ name: "policy-override", type: "string", required: false, description: "Create the function past a blocking live-branch publish policy gate with an audited reason (requires workspace:policy update). A refusal without it saves nothing and exits 2; pass only the user's own reason" },
|
|
90
91
|
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" },
|
|
91
92
|
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
|
|
92
93
|
],
|
|
@@ -110,6 +111,7 @@ Xano CLI commands are SPACE-separated (e.g. \`xano function list\`), not colon-s
|
|
|
110
111
|
{ name: "stdin", short: "s", type: "boolean", required: false, default: "false", description: "Read updated XanoScript from stdin (mutually exclusive with --file)" },
|
|
111
112
|
{ name: "edit", short: "e", type: "boolean", required: false, default: "false", description: "Open the file in $EDITOR before updating (requires --file)" },
|
|
112
113
|
{ name: "publish", type: "boolean", required: false, default: "true", description: "Publish after editing (use --no-publish to save as draft only)" },
|
|
114
|
+
{ name: "policy-override", type: "string", required: false, description: "Publish past a blocking live-branch publish policy gate with an audited reason (requires workspace:policy update). A refusal without it saves nothing and exits 2; pass only the user's own reason" },
|
|
113
115
|
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" },
|
|
114
116
|
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
|
|
115
117
|
],
|
|
@@ -8,6 +8,7 @@ export const knowledgeDoc = {
|
|
|
8
8
|
- **Knowledge types**: \`agents.md\` (the workspace's AGENTS.md), \`doc\` (standalone markdown docs), and \`skill\` (a SKILL.md plus optional reference files).
|
|
9
9
|
- **Inclusion**: how an item is surfaced to AI — \`always\` (always-on context), \`on demand\` (auto-selected when relevant), or \`manual\` (only when explicitly referenced).
|
|
10
10
|
- **Read via \`knowledge list\`/\`knowledge get\`**; **write via workspace/sandbox push** — there is no \`knowledge push\`/\`knowledge pull\`. Knowledge is synced automatically as part of \`workspace pull/push\` and \`sandbox pull/push\` under the \`knowledge/\` directory.
|
|
11
|
+
- **Not every skill an agent gets is a knowledge record.** The platform's \`xano-policies\` skill never appears in \`knowledge list\` or under \`knowledge/\`; see the \`skills\` topic. A workspace knowledge record of the same name replaces it.
|
|
11
12
|
|
|
12
13
|
## On-Disk Layout (from workspace/sandbox pull)
|
|
13
14
|
|
|
@@ -56,7 +57,7 @@ guid: abc123...
|
|
|
56
57
|
**\`knowledge get\` matching:** the name match is case-insensitive; on a miss the error lists all available names. Use \`--file <path>\` to fetch a skill's reference file instead of its SKILL.md.
|
|
57
58
|
|
|
58
59
|
**Frontmatter caution:** write \`inclusion\` (not \`mode\`) in frontmatter — the CLI writes \`inclusion: always | on demand | manual\` on pull and normalizes those labels back to the backend enum on push.`,
|
|
59
|
-
related_topics: ["workspace", "sandbox"],
|
|
60
|
+
related_topics: ["workspace", "sandbox", "skills"],
|
|
60
61
|
commands: [
|
|
61
62
|
{
|
|
62
63
|
name: "knowledge list",
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const flags = [
|
|
2
|
+
{ name: "workspace", short: "w", type: "string", description: "Workspace ID; defaults to the selected official CLI profile" },
|
|
3
|
+
{ name: "branch", short: "b", type: "string", description: "Branch label; use the same branch for publishing and evaluating" },
|
|
4
|
+
{ name: "profile", short: "p", type: "string", description: "Official CLI profile name" },
|
|
5
|
+
{ name: "output", short: "o", type: "string", default: "summary", description: "summary or json" },
|
|
6
|
+
{ name: "verbose", short: "v", type: "boolean", default: "false", description: "Print the request the CLI makes and the raw platform response beside the normal output; useful when a refusal or a finding needs to be traced to the route that produced it" },
|
|
7
|
+
];
|
|
8
|
+
const messageFlag = { name: "message", short: "m", type: "string", description: "Short label for the Version History entry this publish creates; ignored when the definition is unchanged" };
|
|
9
|
+
const sourceFlags = [
|
|
10
|
+
{ name: "file", short: "f", type: "string", description: "Path to one policy XanoScript document; use this or --stdin. policy parse also accepts the path as a positional argument" },
|
|
11
|
+
{ name: "stdin", type: "boolean", description: "Read one policy document from standard input" },
|
|
12
|
+
];
|
|
13
|
+
export const policyDoc = {
|
|
14
|
+
topic: "policy",
|
|
15
|
+
title: "Xano CLI - Workspace Policies",
|
|
16
|
+
description: `Policy support in the official @xano/cli uses the existing profile and Metadata API client. Requires policy-enabled builds of the CLI and instance. A policy combines its human description with deterministic check rules and lives as workspace XanoScript. The policy language - syntax, fields, rules, refusal messages and versioning - is documented once, in xano_xanoscript_docs({topic: "policies"}) (mode: "quick_reference" for the short form; the full topic carries every check's description); this topic covers the commands.
|
|
17
|
+
|
|
18
|
+
Use the authenticated Xano MCP tools for live tool calls, or these CLI commands for local workspace files. The standalone developer MCP serves this documentation; it does not itself authenticate to your workspace.`,
|
|
19
|
+
ai_hints: `Discover exact check parameters with policy catalogue; each entry carries a human label beside its check id. Native policy parse is the validation authority. The developer MCP's language server checks policy syntax locally, and checks rules only as warnings against its bundled copy of the catalogue, which may be older than the instance. An unknown check id is refused by parse, publish and workspace push with payload.code policy_unknown_check, naming the nearest ids, and the CLI adds a pointer to xano policy catalogue. Do not invent a local policy parser. policy parse prints canonical source, which is sparse and orders params the catalogue's way, so do not read a shorter file as a lost setting.
|
|
20
|
+
|
|
21
|
+
Reads, parsing and evaluation need the workspace:policy permission at read level; creating, updating and deleting need it at create, update or delete level. A refused request prints the platform's message and what to do about it, keyed on the refusal's code: the feature is off, the role lacks the permission (an instance admin grants it; a new token does not help), or the token was created without the scope (create one that has it). workspace push lets unchanged policy files through for any reader; a changed policy file from a caller whose permission does not allow the change refuses the whole push, so exclude them with -e "policies/*" or pull again.
|
|
22
|
+
|
|
23
|
+
Policy source uses active = true or active = false before enforcement. The retired lifecycle field is refused. policy list labels rows Active, Mandatory; Active, Advisory; or Inactive. Inactive policies are saved directly, skipped by branch checks, and reported with status inactive.
|
|
24
|
+
|
|
25
|
+
A parse or validation error in summary output is located at line N, col M, with line 1 the first line, followed by the offending text; -o json keeps the platform payload untouched, whose line and col count from 1 too. Every policy command run with -o json reports its own failure as one object on stdout rather than as prose on stderr: {"error": {"message": "...", "exit": 1}}, and exits 1. Exit 2 is never an error object: it is reserved for blocking findings, which are ordinary results.
|
|
26
|
+
|
|
27
|
+
policy evaluate and workspace push print the platform's policy_check verdict (see the Metadata API policy topic for the statuses). Their exit code follows the import and the blocking policies only: 1 when the import or the request fails, 2 whenever policy_check.blocking is true (an active mandatory policy has findings; an inactive policy never blocks), and 0 otherwise. A pass, a fail and not_applicable (no active policy on the branch) print a headline with the platform's message; disabled, forbidden, unavailable, error or no feedback at all print one warning line on stderr with the platform's status and message, and leave the exit code alone. For CI, key on policy_check.blocking in -o json rather than on status: advisory findings arrive as status fail with blocking false. A policy finding never rolls back imported code on a branch that is not live. A push to the live branch is gated before it commits: a 403 policy_gate refusal exits 2, says nothing was imported, lists the blocking findings and introduced/changed counts, and under -o json prints {imported: false, refused: <payload>}; --policy-override "<reason>" sends an audited override (workspace:policy update), and --no-transaction to live is refused (exit 1). A create past the plan's per-branch cap is refused with policy_plan_limit, naming the plan. Releases carry policies: release create, push and import print the release's stored policy check; tenant deploy_release --check prints the deploy gate's verdict and --override-reason overrides it; tenant_deploy_request set_status and bypass take --override-policy; a refused deploy exits 2. release deploy --set_live and branch set_live exit 2 when the set-live gate refuses (a refused release deploy keeps the new branch and names it), and function create and function edit exit 2 when the live-branch publish gate refuses the save (nothing is saved); each takes --policy-override "<reason>" (workspace:policy update; only with the user's own reason), a blank one is refused before any request, and any other failure exits 1. A workspace push (its --dry-run too), branch set_live, release deploy --set_live or policy delete (of an active mandatory policy) that weakens a mandatory policy without workspace:policy update is refused with policy_weakening_permission_required and exits 1, a permission refusal rather than a blocking finding: the CLI prints the platform's sentence and how to go on (leave the policy files out with -e "policies/*"; a deployed release's branch stays and is named), and --policy-override does not lift it. policy parse and policy publish print rule warnings on stderr.
|
|
28
|
+
|
|
29
|
+
A rule with zero objects checked and no findings has status no_objects and message no objects checked. Older stored runs keep pass with checked: 0; readers accept both. The run and policy_check stay pass when nothing failed, and policy_check.message names the unchecked rules. Merge, publish and deploy gates read findings and are unaffected. The CLI summary renders both as no objects checked, never as an error; policy status keeps its no_objects_checked row status.
|
|
30
|
+
|
|
31
|
+
A run can hold tens of thousands of findings, so large ones are read a page at a time. The policy_check a workspace push answers lists the first 100 findings and blocking findings, beside counts {findings, blocking, errors}, total and truncated; when the lists were cut the push prints the counts, heads each list "first 100 of N" and ends with Listed: the first 100 of N; \`xano policy runs <run_id>\` has them all. policy runs <id> reads a run's summary and one page of its findings (--offset, --limit up to 500, and filters), or every page with --all, and policy status reads the latest run's summary; policy evaluate --summary answers the run summary with its first 50 findings; policy evaluate without it still answers the whole run.
|
|
32
|
+
|
|
33
|
+
Publishing an identical definition writes nothing and prints No changes; JSON output carries unchanged: true. Do not add a cosmetic edit to force a version. Version history is listed, diffed and restored in the Xano dashboard only; there is no CLI command for it. policy status reads the platform's latest_run for each policy: a policy is stale when it changed after the branch's newest run, so that run's findings no longer describe it.
|
|
34
|
+
|
|
35
|
+
workspace pull writes policies to policies/<KEY>.xs when the credential can read them (without workspace:policy read the pull succeeds and omits them) and prints one hint after a pull that included them: Run \`xano skills pull\` to install the policies skill for your coding agent (see the skills topic). workspace push includes policies in the normal multidoc import and reports policy_check afterward; the workspace topic covers its -m/--message. sandbox push and ephemeral push (and their --dry-run) and release push carry policy files while the instance's Policies feature is on: a sandbox or ephemeral push lands them without evaluating them (no policy_check), and release push sends policies/*.xs with the rest and prints the release's stored policy check. A release built by release push carries those files only for a caller holding workspace:policy create and update; for anyone else it carries the workspace's live-branch policies instead, and the push prints the platform's policies_skipped message naming the files when they differ from the live ones. release import of an archive that carries policies needs the same workspace:policy create and update: without them the platform refuses it, nothing is stored, and the CLI prints the platform's message and the remedy for the role or the token. A push to a remote tenant, a push to a tenant created before policies (it has no policy table until its next platform update), or any push while the feature is off leaves them out, and the push prints the platform's policies_skipped message once, as a warning naming the files and why. While the instance's Policies feature is off, workspace pull carries no policies (and prints no skills hint) and workspace push leaves its policy files out, printing the platform's one line instead of a policy count. Existing workspace push deletion/sync behavior remains governed by its normal flags.`,
|
|
36
|
+
related_topics: ["workspace", "profile", "branch", "skills"],
|
|
37
|
+
commands: [
|
|
38
|
+
{ name: "policy catalogue", description: "List built-in checks, their schemas and analysis limitations from the instance. The full catalogue is long; --check narrows it to one check id in either output mode, and an unknown id names the closest matches.", usage: "xano policy catalogue [options]", flags: [...flags, { name: "check", type: "string", description: "Show only this check id" }], examples: ["xano policy catalogue -o json", "xano policy catalogue --check object.auth_required"] },
|
|
39
|
+
{ name: "policy list", description: "List policies on the selected branch, each with its active state, id and current version.", usage: "xano policy list [options]", flags, examples: ["xano policy list -b dev -o json"] },
|
|
40
|
+
{
|
|
41
|
+
name: "policy create",
|
|
42
|
+
description: "Create an independent Active, Advisory policy from a platform goal (the goals in policy catalogue -o json). Copies the goal's sparse settings; every needs path must be filled with --param. Parsed natively before saving. A taken goal key gets a free numeric suffix (case-insensitive); a taken explicit --key is refused. Never updates an existing policy and stores no link to the goal. Rule warnings go to stderr; -o json prints the saved policy.",
|
|
43
|
+
usage: "xano policy create --goal <id> [--key KEY] [--param N.path=JSON ...] [options]",
|
|
44
|
+
flags: [...flags, messageFlag, { name: "goal", type: "string", required: true, description: "Goal id from the catalogue's goals" }, { name: "key", type: "string", description: "Policy key; defaults to the goal's suggested key" }, { name: "param", type: "string", description: "Repeatable N.path=JSON override; rule numbers start at 1, and the N. prefix is optional for a single-rule goal" }],
|
|
45
|
+
examples: ["xano policy create --goal endpoints_need_login -b dev", "xano policy create --goal no_pii_in_responses --key DATA-020 --param 'fields=[\"email\",\"ssn\"]'"],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "policy parse",
|
|
49
|
+
description: "Parse and format source on the instance without saving. Summary output is canonical XanoScript; JSON includes {policy, source}. The file may be given as a positional argument or with --file - they are the same input, and --stdin is unchanged.",
|
|
50
|
+
usage: "xano policy parse [file] [options]",
|
|
51
|
+
args: [{ name: "file", required: false, description: "Path to one policy XanoScript document, the positional form of --file. Omit it and pass --stdin to read the document from standard input" }],
|
|
52
|
+
flags: [...flags, ...sourceFlags],
|
|
53
|
+
examples: ["xano policy parse policies/AUTH-EXAMPLE.xs", "xano policy parse --file policies/AUTH-EXAMPLE.xs", "cat policies/AUTH-EXAMPLE.xs | xano policy parse --stdin -o json"],
|
|
54
|
+
},
|
|
55
|
+
{ name: "policy publish", description: "Parse one policy, then create or update by its stable key on the selected branch using canonical source. Prints Published KEY (Version N), or No changes to KEY (Version N) when the definition already matches what is stored. Use workspace push for an atomic multi-policy import.", usage: "xano policy publish --file <path> [options]", flags: [...flags, ...sourceFlags, messageFlag], examples: ["xano policy publish --file policies/AUTH-EXAMPLE.xs -b dev", "xano policy publish --file policies/AUTH-EXAMPLE.xs -m \"Tightened the scope\""] },
|
|
56
|
+
{ name: "policy evaluate", description: "Evaluate active policies and store a new run, then print the platform's verdict and the run's findings. Exits 2 when policy_check.blocking is true, and 0 for every other verdict; not_applicable (no active policy) prints a headline with the platform's message and is no run: nothing is stored, so there is no Not stored line and nothing new in policy runs. Only a disabled, forbidden, unavailable or errored verdict prints one warning line. A credential that may read but not write gets its findings with nothing stored, and the CLI says Not stored. --policy KEY tries that one policy alone, even if inactive: nothing is stored or audited, the latest run is untouched, nothing is gated, and each rule's clear objects are named; an inactive trial never exits 2, and a blank key is refused before any request.", usage: "xano policy evaluate [options]", flags: [...flags, { name: "policy", type: "string", description: "Try this one policy key alone (a trial: never stored or audited)" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what this run recorded: each policy's statement and each rule's name and resolved settings" }, { name: "summary", type: "boolean", default: "false", description: "Send answer: summary: answer the run summary (counts, each policy's verdict, rule results) and its first 50 findings instead of the whole run, and say which run has the rest. -o json passes that answer through" }], examples: ["xano policy evaluate -b dev -o json", "xano policy evaluate --run-detail", "xano policy evaluate --summary -o json", "xano policy evaluate --policy AUTH-001"] },
|
|
57
|
+
{
|
|
58
|
+
name: "policy runs",
|
|
59
|
+
description: "List the runs the branch retains (only the newest twenty exist), newest first, with status, finding count, objects checked, trigger and start time. With a run id, read that one run, including one older than the latest, which policy status cannot reach: its summary (counts, each policy's verdict, rule results) and one page of its findings in the platform's order, blocking first, 100 unless --limit says otherwise; a page that is not every finding is marked (one page) and names the next page's --offset. --all reads every page instead (500 a request, saying so on stderr when there are more) and prints or returns every matching finding. The filter flags narrow the findings on the instance; a repeated flag matches any of its values. JSON output is the platform's own body: the run summaries for a list, and for one id the run summary with findings, the page's findings as an array (every one with --all), and findings_page {total, offset, limit, next_offset}, next_offset null after the last. The finding flags need a run id. --release <name> reads a release's policy check (stored when it was cut) the same way, plus its shipped policies; --release-id <id> reads it by id (exclusive with --release and --branch); --recheck checks the release again from its archive and stores the run. Needs the workspace:policy permission at read level.",
|
|
60
|
+
usage: "xano policy runs [run_id] [options]",
|
|
61
|
+
flags: [
|
|
62
|
+
...flags,
|
|
63
|
+
{ name: "release", type: "string", description: "Read this release's policy check instead of a branch run" },
|
|
64
|
+
{ name: "release-id", type: "number", description: "Read a release's policy check by release id" },
|
|
65
|
+
{ name: "recheck", type: "boolean", default: "false", description: "With --release or --release-id, check the release again and store the run" },
|
|
66
|
+
{ name: "limit", type: "number", description: "Without a run id, the newest N runs (1-20, default 20); with one, how many findings to print (1-500, default 100)" },
|
|
67
|
+
{ name: "offset", type: "number", default: "0", description: "With a run id, how many findings to skip" },
|
|
68
|
+
{ name: "all", type: "boolean", default: "false", description: "With a run id, read every page and print or return every matching finding; not with --offset or --limit" },
|
|
69
|
+
{ name: "blocking", type: "boolean", default: "false", description: "With a run id, only the blocking findings" },
|
|
70
|
+
{ name: "advisory", type: "boolean", default: "false", description: "With a run id, only the advisory findings" },
|
|
71
|
+
{ name: "policy", type: "string", description: "With a run id, only this policy key's findings; repeatable" },
|
|
72
|
+
{ name: "rule", type: "string", description: "With a run id, only this rule id's findings (AUTH-001.R1); repeatable" },
|
|
73
|
+
{ name: "severity", type: "string", description: "With a run id, only findings of this severity (critical, high, medium, low); repeatable" },
|
|
74
|
+
{ name: "kind", type: "string", description: "With a run id, only findings on this object kind; repeatable" },
|
|
75
|
+
{ name: "object", type: "string", description: "With a run id, only findings on this object, written type:id (query:18); repeatable" },
|
|
76
|
+
{ name: "tag", type: "string", description: "With a run id, only findings whose policy or object carries this tag; repeatable" },
|
|
77
|
+
{ name: "search", type: "string", description: "With a run id, only findings whose policy key or title, rule title, object name or message contains this text" },
|
|
78
|
+
{ name: "run-detail", type: "boolean", default: "false", description: "With a run id, also print the policy statements and rule settings that run recorded" },
|
|
79
|
+
],
|
|
80
|
+
examples: ["xano policy runs", "xano policy runs --limit 5", "xano policy runs 1674 --run-detail -o json", "xano policy runs 1674 --offset 100 --limit 100", "xano policy runs 1674 --all -o json", "xano policy runs 1674 --blocking --policy AUTH-001 --severity critical", "xano policy runs --release v1.2", "xano policy runs --release-id 12 --recheck"],
|
|
81
|
+
},
|
|
82
|
+
{ name: "policy delete", description: "Delete a policy from the selected branch, by policy key or by id; its Version History is kept. An unresolved name is refused naming the policies the branch does have. Prompts before deleting; --force skips the prompt. The delete sends the updated_at it listed, so a policy changed after that (for example while the prompt waited) is refused with policy_stale and nothing is deleted: run the command again. This is the only way to remove a policy from the CLI: workspace push is additive, so deleting policies/KEY.xs and pushing leaves the policy in place. Needs the workspace:policy permission at delete level.", usage: "xano policy delete <key-or-id> [options]", flags: [...flags, { name: "force", short: "f", type: "boolean", default: "false", description: "Skip the confirmation prompt; only with the user's explicit confirmation" }], examples: ["xano policy delete TMP-DX-001", "xano policy delete 922 --force -o json"] },
|
|
83
|
+
{
|
|
84
|
+
name: "policy status",
|
|
85
|
+
description: "Inspect stored policy/run state without evaluating. The Enforcement column reads Mandatory or Advisory, and a finding count reads (blocking) when the latest run judged it blocking: the run evaluated the policy in its current version as active and mandatory. A policy is stale when it changed after the branch's newest run (the platform's latest_run), so that run's findings no longer describe it. Informational (exit 0) by default; with --fail-on-findings it exits 2 when the latest run has blocking findings, else 1 for stale, missing or errored evaluation evidence (advisory findings still exit 0), and a nonzero exit is always explained by one line naming the reason. A blocking reason is a prediction: the merge gate evaluates the branch again before a merge. In -o json each row's status is one of pass, fail, error, stale, not_evaluated, no_checks, no_objects_checked or inactive, with blocking, rules_unchecked (a pass whose rules checked no objects) and counted (whether its findings come from the latest run's evidence); --fail-on-findings adds fail_on_findings: {exit, reason}. It reads the latest run's summary, not the whole run, so in -o json run carries each policy's finding count and verdict rather than the findings; xano policy runs <id> lists them.",
|
|
86
|
+
usage: "xano policy status [options]",
|
|
87
|
+
flags: [...flags, { name: "fail-on-findings", type: "boolean", default: "false", description: "Exit 2 when the latest run has blocking findings; otherwise exit 1 for stale, missing or errored evaluation evidence" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what the latest run recorded: each policy's statement and each rule's name and resolved settings. Summary output only" }],
|
|
88
|
+
examples: ["xano policy status -b dev -o json", "xano policy status --fail-on-findings -o json", "xano policy status --run-detail"],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const flags = [
|
|
2
|
+
{ name: "workspace", short: "w", type: "string", description: "Workspace ID; defaults to the selected official CLI profile" },
|
|
3
|
+
{ name: "branch", short: "b", type: "string", description: "Branch label; defaults to the profile's branch, else live. The platform skill is the same on every branch; the branch only decides which workspace knowledge record named xano-policies, if any, replaces it" },
|
|
4
|
+
{ name: "profile", short: "p", type: "string", description: "Official CLI profile name" },
|
|
5
|
+
{ name: "directory", short: "d", type: "string", default: ".", description: "Project directory to install into (default: current directory). The file is written under its .claude/skills/, not to a positional argument" },
|
|
6
|
+
{ name: "output", short: "o", type: "string", default: "summary", description: "summary or json; summary prints the path written, json prints {branch, bytes, name, path, source, workspace}, where source is platform, or workspace when the workspace's own xano-policies record was installed" },
|
|
7
|
+
{ name: "verbose", short: "v", type: "boolean", default: "false", description: "Print the request the CLI makes and the raw platform response beside the normal output" },
|
|
8
|
+
];
|
|
9
|
+
export const skillsDoc = {
|
|
10
|
+
topic: "skills",
|
|
11
|
+
title: "Xano CLI - Agent Skills",
|
|
12
|
+
description: `\`xano skills pull\` installs the agent skill your Xano instance generates for your coding agent. Today that is one skill, \`xano-policies\`: the workspace policy file format, the authoring and honesty rules, and the instance's own check catalogue, generated from the live registry at request time so it can never describe a check the instance does not have.
|
|
13
|
+
|
|
14
|
+
The skill is fetched from \`GET /api:meta/workspace/{workspace_id}/agent-skills?surface=cli&branch=<label>\` and written to \`.claude/skills/xano-policies/SKILL.md\` under the project directory; nothing else in the project is touched. That replaces the published stub only when the stub was installed into the project for Claude Code (\`npx skills add xano-inc/xano-developer-mcp -s xano-policies -a claude-code\`, without \`-g\`). A stub installed globally (\`-g\`) or for another agent lives where that agent reads it and stays there, so remove it after pulling.
|
|
15
|
+
|
|
16
|
+
The route is one of the policy routes, gated like the others; the \`policy\` topic says what each refusal means. When the workspace has its own enabled knowledge record named \`xano-policies\`, the route serves that record instead of the platform skill, and the command says so.
|
|
17
|
+
|
|
18
|
+
The same generator serves three surfaces. \`surface=studio\` (the default on the route) is the variant Xano's own Studio agent loads; \`surface=mcp\` is the one the authenticated MCP's \`xano_get_policy_skill\` serves; \`surface=cli\` is the variant this command writes, and it is the only one the CLI asks for.
|
|
19
|
+
|
|
20
|
+
This is not workspace knowledge. The generated policy skill is produced by the platform, not stored as a workspace knowledge record, so it does not appear in \`knowledge list\` and it is not written under \`knowledge/\` by \`workspace pull\`.`,
|
|
21
|
+
ai_hints: `Run \`xano skills pull\` once per project, and again after the instance is upgraded, because the skill is generated from the instance's check catalogue, not from the workspace's policies. The command is idempotent: re-running it rewrites the file and prints the path it wrote. \`xano workspace pull\` prints a hint after a pull that included policies: "Run \`xano skills pull\` to install the policies skill for your coding agent."
|
|
22
|
+
|
|
23
|
+
Treat the pulled file as authoritative over any stub: if \`.claude/skills/xano-policies/SKILL.md\` contains a check catalogue section, it came from the instance. Never edit the pulled file by hand - the next pull overwrites it - and never invent check ids or parameters from a stub; \`xano policy catalogue\` and the pulled skill are the only sources of truth for what this instance can check.
|
|
24
|
+
|
|
25
|
+
A profile has to be selected first (\`xano profile use <name> -w <workspace_id> -b <branch>\`), or the workspace and branch given with -w/-b, because the route is addressed by workspace and branch.`,
|
|
26
|
+
related_topics: ["policy", "knowledge", "workspace"],
|
|
27
|
+
commands: [
|
|
28
|
+
{
|
|
29
|
+
name: "skills pull",
|
|
30
|
+
description: "Fetch the CLI variant of the generated xano-policies skill for the selected workspace and branch and write it to .claude/skills/xano-policies/SKILL.md under the project directory. Idempotent: it overwrites whatever is there and prints the path written, and says so when the workspace's own xano-policies record was installed instead of the platform skill. Needs the workspace:policy permission at read level.",
|
|
31
|
+
usage: "xano skills pull [options]",
|
|
32
|
+
flags,
|
|
33
|
+
examples: [
|
|
34
|
+
"xano skills pull",
|
|
35
|
+
"xano skills pull -d ./my-app -b dev",
|
|
36
|
+
"xano skills pull -w 1 -b v1 -o json",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
workflows: [
|
|
41
|
+
{
|
|
42
|
+
name: "Give a coding agent the live policy skill",
|
|
43
|
+
description: "Replace the published stub skill with the skill generated from this instance's check catalogue",
|
|
44
|
+
steps: [
|
|
45
|
+
"Select the workspace and branch: `xano profile use local -w 1 -b v1`",
|
|
46
|
+
"Pull the skill: `xano skills pull -d ./my-app`",
|
|
47
|
+
"The command writes `./my-app/.claude/skills/xano-policies/SKILL.md` and prints that path",
|
|
48
|
+
"Start a new agent session in that directory so the skill manifest is re-read",
|
|
49
|
+
"Remove a stub installed globally or for another agent",
|
|
50
|
+
"Re-run the pull after the instance is upgraded",
|
|
51
|
+
],
|
|
52
|
+
example: `xano profile use local -w 1 -b v1
|
|
53
|
+
xano workspace pull -d ./my-app
|
|
54
|
+
xano skills pull -d ./my-app`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
@@ -75,6 +75,8 @@ After \`workspace pull\`, files are organized using snake_case naming:
|
|
|
75
75
|
|
|
76
76
|
\`workspace pull\` and \`workspace push\` automatically sync knowledge and skills (markdown files under \`knowledge/\`) alongside XanoScript — no extra flag. Knowledge participates in push previews, \`--sync\`/\`--delete\`, and \`--include\`/\`--exclude\` globs. See the \`knowledge\` topic for the file layout and frontmatter format.
|
|
77
77
|
|
|
78
|
+
The platform's generated \`xano-policies\` skill is not workspace knowledge, so pull does not write it; see the \`skills\` topic.
|
|
79
|
+
|
|
78
80
|
## Syntax note
|
|
79
81
|
|
|
80
82
|
Xano CLI commands are SPACE-separated (e.g. \`xano workspace pull\`), not colon-separated.
|
|
@@ -116,6 +118,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
116
118
|
- \`--dry-run\`: Preview what would change without applying
|
|
117
119
|
- \`--include/-i\` and \`--exclude/-e\`: Glob patterns for selective push (repeatable)
|
|
118
120
|
- \`--no-transaction\` and \`--no-guids\` disable the default transaction wrapping and GUID write-back
|
|
121
|
+
- \`-m/--message\`: labels only the Version History entry of each policy the push changes; other objects get no message, and an unchanged policy gets no entry
|
|
119
122
|
|
|
120
123
|
**Knowledge sync (automatic):**
|
|
121
124
|
- \`pull\` writes knowledge/skills markdown under \`knowledge/\`; \`push\` sends it back — no flag needed
|
|
@@ -134,7 +137,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
134
137
|
**When to use sandbox instead:**
|
|
135
138
|
- \`sandbox\` is a lighter-weight alternative for ephemeral, isolated iteration
|
|
136
139
|
- Use workspace pull/push for canonical sync, version control, and CI/CD`,
|
|
137
|
-
related_topics: ["start", "branch", "function", "release", "sandbox", "knowledge", "integration"],
|
|
140
|
+
related_topics: ["start", "branch", "function", "release", "sandbox", "knowledge", "skills", "integration"],
|
|
138
141
|
commands: [
|
|
139
142
|
{
|
|
140
143
|
name: "workspace list",
|
|
@@ -219,7 +222,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
219
222
|
},
|
|
220
223
|
{
|
|
221
224
|
name: "workspace pull",
|
|
222
|
-
description: "Download workspace code to a local directory. Splits the multidoc response into individual .xs files organized by type, and also writes workspace knowledge/skills markdown under knowledge/. The target directory is the -d/--directory flag (default: current directory), not a positional argument.",
|
|
225
|
+
description: "Download workspace code to a local directory. Splits the multidoc response into individual .xs files organized by type, and also writes workspace knowledge/skills markdown under knowledge/. The target directory is the -d/--directory flag (default: current directory), not a positional argument. Policies are written to policies/<KEY>.xs when the credential holds the workspace:policy permission at read level, and omitted otherwise; a policy whose file name differs only in case from another policy or a local file is left out with a warning, and everything else is written. A pull that included policies prints one hint afterwards: Run `xano skills pull` to install the policies skill for your coding agent. Local policy files absent from the export are kept, and pull warns that they are stale only when the credential can list the branch's policies (otherwise it says they were kept because the credential cannot list policies, or because the instance's Policies feature is off, when the export carries none).",
|
|
223
226
|
usage: "xano workspace pull [options]",
|
|
224
227
|
flags: [
|
|
225
228
|
{ name: "directory", short: "d", type: "string", required: false, default: ".", description: "Output directory for pulled documents (defaults to current directory)" },
|
|
@@ -239,7 +242,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
239
242
|
},
|
|
240
243
|
{
|
|
241
244
|
name: "workspace push",
|
|
242
|
-
description: "Upload local XanoScript files to a workspace, including knowledge/skills markdown under knowledge/ (synced automatically, shown in the preview). Default mode is partial (only changed files). Use --sync for a full push. The source directory is the -d/--directory flag (default: current directory), not a positional argument. A partial push is additive, not declarative: it adds and updates but makes no destructive changes (it won't drop a removed column or relax a constraint), so local files and the live workspace can diverge. Use --sync for destructive changes; --dry-run to preview.",
|
|
245
|
+
description: "Upload local XanoScript files to a workspace, including knowledge/skills markdown under knowledge/ (synced automatically, shown in the preview). Default mode is partial (only changed files). Use --sync for a full push. The source directory is the -d/--directory flag (default: current directory), not a positional argument. A partial push is additive, not declarative: it adds and updates but makes no destructive changes (it won't drop a removed column or relax a constraint), so local files and the live workspace can diverge. Use --sync for destructive changes; --dry-run to preview. On a policy-enabled instance the import response carries policy_check feedback, printed after the import: the push exits 2 when policy_check.blocking is true, and the policy topic covers the verdicts and the exit rule. That feedback lists the first 100 findings; when there are more, the push prints their counts and the xano policy runs command that pages through them all. With the Policies feature off the instance leaves the policy files out and the push prints its one line naming them. A policy finding never rolls back the import. If the knowledge sync fails after the import has landed, the import stands: its policy_check is still printed, the push exits 2 when that feedback is blocking and 1 otherwise, and -o json prints the import document with the failure as error ({exit, message}).",
|
|
243
246
|
usage: "xano workspace push [options]",
|
|
244
247
|
flags: [
|
|
245
248
|
{ name: "directory", short: "d", type: "string", required: false, default: ".", description: "Directory containing documents to push (defaults to current directory)" },
|
|
@@ -256,6 +259,8 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
256
259
|
{ name: "guids", type: "boolean", required: false, default: "true", description: "Write server-assigned GUIDs back to local files after push (--no-guids to disable)" },
|
|
257
260
|
{ name: "include", short: "i", type: "string", required: false, description: "Glob pattern to include files, matched against relative paths (repeatable)" },
|
|
258
261
|
{ name: "exclude", short: "e", type: "string", required: false, description: "Glob pattern to exclude files, matched against relative paths (repeatable)" },
|
|
262
|
+
{ name: "message", short: "m", type: "string", required: false, description: "Labels only policies: stored as the Version History message of each policy this push changes. Other objects the push changes get no message, and a policy the push leaves unchanged gets no Version History entry" },
|
|
263
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "summary or json; JSON retains the complete import response and policy_check feedback" },
|
|
259
264
|
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
|
|
260
265
|
],
|
|
261
266
|
examples: [
|
|
@@ -266,7 +271,9 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
266
271
|
"xano workspace push --sync --delete --force",
|
|
267
272
|
'xano workspace push -i "api/**" -i "function/**"',
|
|
268
273
|
'xano workspace push -e "table/**" --records --truncate',
|
|
269
|
-
"xano workspace push --no-transaction --no-guids"
|
|
274
|
+
"xano workspace push --no-transaction --no-guids",
|
|
275
|
+
"xano workspace push --force -o json",
|
|
276
|
+
'xano workspace push -m "Tightened the auth policies"'
|
|
270
277
|
]
|
|
271
278
|
},
|
|
272
279
|
{
|
|
@@ -19,12 +19,15 @@ import { taskDoc } from "./topics/task.js";
|
|
|
19
19
|
import { agentDoc } from "./topics/agent.js";
|
|
20
20
|
import { toolDoc } from "./topics/tool.js";
|
|
21
21
|
import { mcpServerDoc } from "./topics/mcp_server.js";
|
|
22
|
+
import { promptDoc } from "./topics/prompt.js";
|
|
23
|
+
import { resourceDoc } from "./topics/resource.js";
|
|
22
24
|
import { middlewareDoc } from "./topics/middleware.js";
|
|
23
25
|
import { branchDoc } from "./topics/branch.js";
|
|
24
26
|
import { realtimeDoc } from "./topics/realtime.js";
|
|
25
27
|
import { fileDoc } from "./topics/file.js";
|
|
26
28
|
import { historyDoc } from "./topics/history.js";
|
|
27
29
|
import { workflowsDoc } from "./topics/workflows.js";
|
|
30
|
+
import { policyDoc } from "./topics/policy.js";
|
|
28
31
|
/**
|
|
29
32
|
* All available documentation topics
|
|
30
33
|
*/
|
|
@@ -40,12 +43,15 @@ export const topics = {
|
|
|
40
43
|
agent: agentDoc,
|
|
41
44
|
tool: toolDoc,
|
|
42
45
|
mcp_server: mcpServerDoc,
|
|
46
|
+
prompt: promptDoc,
|
|
47
|
+
resource: resourceDoc,
|
|
43
48
|
middleware: middlewareDoc,
|
|
44
49
|
branch: branchDoc,
|
|
45
50
|
realtime: realtimeDoc,
|
|
46
51
|
file: fileDoc,
|
|
47
52
|
history: historyDoc,
|
|
48
53
|
workflows: workflowsDoc,
|
|
54
|
+
policy: policyDoc,
|
|
49
55
|
};
|
|
50
56
|
/**
|
|
51
57
|
* Get list of all available topic names
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EndpointDoc } from "../types.js";
|
|
2
|
+
/** The debug-route description shared by the tool, prompt and resource topics. */
|
|
3
|
+
export declare function debugDescription(kind: "tool" | "prompt" | "resource"): string;
|
|
4
|
+
/**
|
|
5
|
+
* Shared route set for the MCP `prompt` and `resource` objects. Both expose the
|
|
6
|
+
* same CRUD + debug surface in cloud-client (`app/meta/{prompt,resource}.yaml`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function mcpPrimitiveEndpoints(opts: {
|
|
9
|
+
kind: "prompt" | "resource";
|
|
10
|
+
plural: string;
|
|
11
|
+
debugInputDescription: string;
|
|
12
|
+
createExample: string;
|
|
13
|
+
}): EndpointDoc[];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** The debug-route description shared by the tool, prompt and resource topics. */
|
|
2
|
+
export function debugDescription(kind) {
|
|
3
|
+
return `Run the ${kind}'s stack outside MCP and return its result. Requires \`workspace:tool\` read and \`workspace:action:rundebug\` enabled. \`elicit\` simulates mcp.elicit answers keyed by elicit key, e.g. {"confirm":{"action":"accept","content":{"proceed":true}}}; an elicit with no simulated answer gets {"action":"cancel"}. The response's \`mcp\` object lists every elicit asked (with its answer) and every mcp.progress call. The stack runs for real, so its writes happen.`;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Shared route set for the MCP `prompt` and `resource` objects. Both expose the
|
|
7
|
+
* same CRUD + debug surface in cloud-client (`app/meta/{prompt,resource}.yaml`).
|
|
8
|
+
*/
|
|
9
|
+
export function mcpPrimitiveEndpoints(opts) {
|
|
10
|
+
const { kind, plural, debugInputDescription, createExample } = opts;
|
|
11
|
+
const idParam = `${kind}_id`;
|
|
12
|
+
const PascalPlural = plural.charAt(0).toUpperCase() + plural.slice(1);
|
|
13
|
+
const PascalKind = kind.charAt(0).toUpperCase() + kind.slice(1);
|
|
14
|
+
const workspace = { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" };
|
|
15
|
+
const id = { name: idParam, type: "integer", required: true, in: "path", description: `${PascalKind} ID` };
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: `/workspace/{workspace_id}/${kind}`,
|
|
20
|
+
tool_name: `list${PascalPlural}`,
|
|
21
|
+
description: `List MCP ${plural} in a workspace.`,
|
|
22
|
+
parameters: [
|
|
23
|
+
workspace,
|
|
24
|
+
{ name: "branch", type: "string", description: "Filter by branch name" },
|
|
25
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
26
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" },
|
|
27
|
+
{ name: "search", type: "string", description: `Search ${plural}` },
|
|
28
|
+
{ name: "sort", type: "string", default: "created_at", enum: ["created_at", "updated_at", "name"], description: "Sort field" },
|
|
29
|
+
{ name: "order", type: "string", default: "desc", enum: ["asc", "desc"], description: "Sort order" },
|
|
30
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript" },
|
|
31
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft versions" }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: `/workspace/{workspace_id}/${kind}/{${idParam}}`,
|
|
37
|
+
tool_name: `get${PascalKind}`,
|
|
38
|
+
description: `Get one MCP ${kind}.`,
|
|
39
|
+
parameters: [
|
|
40
|
+
workspace,
|
|
41
|
+
id,
|
|
42
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript" },
|
|
43
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include the draft version" }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
method: "POST",
|
|
48
|
+
path: `/workspace/{workspace_id}/${kind}`,
|
|
49
|
+
tool_name: `create${PascalKind}`,
|
|
50
|
+
description: `Create an MCP ${kind} from XanoScript. The body is the raw XanoScript (Content-Type: text/x-xanoscript).`,
|
|
51
|
+
parameters: [
|
|
52
|
+
workspace,
|
|
53
|
+
{ name: "branch", type: "string", description: "Target branch name" },
|
|
54
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript in the response" }
|
|
55
|
+
],
|
|
56
|
+
request_body: {
|
|
57
|
+
type: "text/x-xanoscript",
|
|
58
|
+
description: `The ${kind} definition in XanoScript.`
|
|
59
|
+
},
|
|
60
|
+
example: {
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: `/workspace/1/${kind}`,
|
|
63
|
+
headers: { "Content-Type": "text/x-xanoscript" },
|
|
64
|
+
body: createExample
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
method: "PUT",
|
|
69
|
+
path: `/workspace/{workspace_id}/${kind}/{${idParam}}`,
|
|
70
|
+
tool_name: `update${PascalKind}`,
|
|
71
|
+
description: `Replace an MCP ${kind}'s definition with new XanoScript (Content-Type: text/x-xanoscript).`,
|
|
72
|
+
parameters: [
|
|
73
|
+
workspace,
|
|
74
|
+
id,
|
|
75
|
+
{ name: "publish", type: "boolean", default: true, description: "Publish the change immediately" },
|
|
76
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript in the response" }
|
|
77
|
+
],
|
|
78
|
+
request_body: {
|
|
79
|
+
type: "text/x-xanoscript",
|
|
80
|
+
description: `The full ${kind} definition in XanoScript.`
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
method: "DELETE",
|
|
85
|
+
path: `/workspace/{workspace_id}/${kind}/{${idParam}}`,
|
|
86
|
+
tool_name: `delete${PascalKind}`,
|
|
87
|
+
description: `Delete an MCP ${kind} permanently. MCP servers that list it stop offering it.`,
|
|
88
|
+
parameters: [workspace, id]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
method: "POST",
|
|
92
|
+
path: `/workspace/{workspace_id}/${kind}/{${idParam}}/debug`,
|
|
93
|
+
tool_name: `debug${PascalKind}`,
|
|
94
|
+
description: debugDescription(kind),
|
|
95
|
+
parameters: [workspace, id],
|
|
96
|
+
request_body: {
|
|
97
|
+
type: "application/json",
|
|
98
|
+
properties: {
|
|
99
|
+
input: { type: "object", description: debugInputDescription },
|
|
100
|
+
elicit: { type: "object", description: "Simulated mcp.elicit answers, keyed by elicit key: {action: accept|decline|cancel, content?}" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const mcpServerDoc = {
|
|
2
2
|
topic: "mcp_server",
|
|
3
3
|
title: "MCP Server Management",
|
|
4
|
-
description: `MCP (Model Context Protocol) Servers expose tools to external AI clients like Claude Desktop, Cursor, or other MCP-compatible applications.
|
|
4
|
+
description: `MCP (Model Context Protocol) Servers expose tools, prompts and resources to external AI clients like Claude Desktop, Cursor, or other MCP-compatible applications.
|
|
5
5
|
|
|
6
6
|
## Key Concepts
|
|
7
7
|
- MCP Servers expose Xano tools via the MCP protocol
|
|
@@ -9,6 +9,8 @@ export const mcpServerDoc = {
|
|
|
9
9
|
- Supports authentication for secure access
|
|
10
10
|
- Can have triggers for event-driven invocation
|
|
11
11
|
- Standardized interface for AI tool discovery
|
|
12
|
+
- First-class prompts and resources are attached with \`prompts = [...]\` and \`resources = [...]\` blocks (\`name\`, \`active\`, \`auth\`); agents cannot have these blocks
|
|
13
|
+
- Serves MCP 2026-07-28 and older clients (2024-11-05 through 2025-11-25) on one URL; elicitation input is only collected from 2026-07-28 clients, and list-changed notifications need a Swoole instance
|
|
12
14
|
|
|
13
15
|
## Use Cases
|
|
14
16
|
- Expose Xano functionality to Claude Desktop
|
|
@@ -19,7 +21,9 @@ export const mcpServerDoc = {
|
|
|
19
21
|
- Create tools first, then create MCP server to expose them
|
|
20
22
|
- Authentication settings control who can access the server
|
|
21
23
|
- Use triggers to invoke actions when MCP events occur
|
|
22
|
-
- Check documentation endpoint for client setup instructions
|
|
24
|
+
- Check documentation endpoint for client setup instructions
|
|
25
|
+
- Create prompts (createPrompt) and resources (createResource) before listing them on a server
|
|
26
|
+
- The \`type: "resource"\` tool reference is legacy; use a resource object for new work`,
|
|
23
27
|
endpoints: [
|
|
24
28
|
{
|
|
25
29
|
method: "GET",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TopicDoc } from "../types.js";
|
|
2
|
+
export declare const policyExample = "policy \"AUTH-EXAMPLE\" {\n title = \"Require authentication\"\n statement = \"Endpoints require authentication unless the endpoint or its API group is tagged public.\"\n severity = \"high\"\n active = true\n enforcement = \"advisory\"\n\n rule {\n check = \"object.auth_required\"\n params = {except_tags: [\"public\", \"xano:quick-start\"]}\n }\n}";
|
|
3
|
+
export declare const policyDoc: TopicDoc;
|