@xano/developer-mcp 1.0.28 → 1.0.30

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.
@@ -9,6 +9,7 @@ import { formatDocumentation } from "./format.js";
9
9
  import { startDoc } from "./topics/start.js";
10
10
  import { profileDoc } from "./topics/profile.js";
11
11
  import { workspaceDoc } from "./topics/workspace.js";
12
+ import { branchDoc } from "./topics/branch.js";
12
13
  import { functionDoc } from "./topics/function.js";
13
14
  import { runDoc } from "./topics/run.js";
14
15
  import { staticHostDoc } from "./topics/static_host.js";
@@ -20,6 +21,7 @@ export const topics = {
20
21
  start: startDoc,
21
22
  profile: profileDoc,
22
23
  workspace: workspaceDoc,
24
+ branch: branchDoc,
23
25
  function: functionDoc,
24
26
  run: runDoc,
25
27
  static_host: staticHostDoc,
@@ -0,0 +1,2 @@
1
+ import type { TopicDoc } from "../types.js";
2
+ export declare const branchDoc: TopicDoc;
@@ -0,0 +1,195 @@
1
+ export const branchDoc = {
2
+ topic: "branch",
3
+ title: "Xano CLI - Branch Management",
4
+ description: `Branch commands let you manage Xano workspace branches from the CLI. Branches allow you to work on different versions of your workspace (development, staging, production, etc.) without affecting the live version.
5
+
6
+ ## Key Concepts
7
+
8
+ - **v1 branch**: The default branch that always exists. Cannot be deleted or renamed.
9
+ - **Live branch**: The branch serving production API requests. Can be changed with \`branch:set-live\`.
10
+ - **Backup branches**: Created by automated backup features, marked as backup in listings.
11
+
12
+ ## Branch Identification
13
+
14
+ Branches are identified by their **label** (e.g., "v1", "dev", "staging"), not numeric IDs.`,
15
+ ai_hints: `**Key concepts:**
16
+ - Branches are identified by label (string), not ID
17
+ - "v1" is the default branch and cannot be deleted
18
+ - Live branch handles all production API traffic
19
+ - Use \`branch:list\` to see all branches in a workspace
20
+ - Use \`branch:set-live\` carefully - it affects production traffic
21
+
22
+ **Typical workflow:**
23
+ 1. \`xano branch:list\` - see available branches
24
+ 2. \`xano branch:create --label dev\` - create new branch from v1
25
+ 3. Work on dev branch (pull/push with -b flag)
26
+ 4. \`xano branch:set-live dev\` - promote to production
27
+
28
+ **Workspace ID:**
29
+ - Most commands need a workspace ID
30
+ - Pass via \`--workspace\` flag or configure in profile
31
+ - Use \`xano workspace:list\` to find workspace IDs`,
32
+ related_topics: ["workspace", "profile", "integration"],
33
+ commands: [
34
+ {
35
+ name: "branch:list",
36
+ description: "List all branches in a workspace",
37
+ usage: "xano branch:list [workspace_id] [options]",
38
+ args: [
39
+ { name: "workspace_id", required: false, description: "Workspace ID (uses profile workspace if not provided)" }
40
+ ],
41
+ flags: [
42
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
43
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
44
+ ],
45
+ examples: [
46
+ "xano branch:list",
47
+ "xano branch:list 123",
48
+ "xano branch:list --output json"
49
+ ]
50
+ },
51
+ {
52
+ name: "branch:get",
53
+ description: "Get details for a specific branch",
54
+ usage: "xano branch:get <branch_label> [options]",
55
+ args: [
56
+ { name: "branch_label", required: true, description: 'Branch label (e.g., "v1", "dev")' }
57
+ ],
58
+ flags: [
59
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
60
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
61
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
62
+ ],
63
+ examples: [
64
+ "xano branch:get v1",
65
+ "xano branch:get dev -w 123",
66
+ "xano branch:get staging --output json"
67
+ ]
68
+ },
69
+ {
70
+ name: "branch:create",
71
+ description: "Create a new branch by cloning from an existing branch",
72
+ usage: "xano branch:create --label <label> [options]",
73
+ flags: [
74
+ { name: "label", short: "l", type: "string", required: true, description: "Label for the new branch" },
75
+ { name: "source", short: "s", type: "string", required: false, default: "v1", description: 'Source branch to clone from (defaults to "v1")' },
76
+ { name: "description", short: "d", type: "string", required: false, description: "Description for the new branch" },
77
+ { name: "color", short: "c", type: "string", required: false, description: 'Color hex code for the branch (e.g., "#ebc346")' },
78
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
79
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
80
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
81
+ ],
82
+ examples: [
83
+ "xano branch:create --label dev",
84
+ 'xano branch:create -l feature-auth -s dev -d "Authentication feature"',
85
+ 'xano branch:create --label staging --color "#ebc346" --output json'
86
+ ]
87
+ },
88
+ {
89
+ name: "branch:edit",
90
+ description: 'Update an existing branch (cannot update "v1" label)',
91
+ usage: "xano branch:edit <branch_label> [options]",
92
+ args: [
93
+ { name: "branch_label", required: true, description: 'Branch label to edit (cannot edit "v1" label)' }
94
+ ],
95
+ flags: [
96
+ { name: "label", short: "l", type: "string", required: false, description: "New label for the branch" },
97
+ { name: "description", short: "d", type: "string", required: false, description: "New description for the branch" },
98
+ { name: "color", short: "c", type: "string", required: false, description: 'New color hex code for the branch (e.g., "#ff5733")' },
99
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
100
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
101
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
102
+ ],
103
+ examples: [
104
+ "xano branch:edit dev --label development",
105
+ 'xano branch:edit feature-auth -l feature-authentication --color "#ff5733"',
106
+ 'xano branch:edit staging --description "Staging environment" -o json'
107
+ ]
108
+ },
109
+ {
110
+ name: "branch:delete",
111
+ description: 'Delete a branch (cannot delete "v1" or the live branch)',
112
+ usage: "xano branch:delete <branch_label> [options]",
113
+ args: [
114
+ { name: "branch_label", required: true, description: 'Branch label to delete (cannot delete "v1" or the live branch)' }
115
+ ],
116
+ flags: [
117
+ { name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
118
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
119
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
120
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
121
+ ],
122
+ examples: [
123
+ "xano branch:delete feature-old",
124
+ "xano branch:delete dev --force",
125
+ "xano branch:delete staging -f -o json"
126
+ ]
127
+ },
128
+ {
129
+ name: "branch:set-live",
130
+ description: "Set a branch as the live (active) branch for API requests",
131
+ usage: "xano branch:set-live <branch_label> [options]",
132
+ args: [
133
+ { name: "branch_label", required: true, description: 'Branch label to set as live (use "v1" for default branch)' }
134
+ ],
135
+ flags: [
136
+ { name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
137
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
138
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
139
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
140
+ ],
141
+ examples: [
142
+ "xano branch:set-live staging",
143
+ "xano branch:set-live v1 --force",
144
+ "xano branch:set-live production -f -o json"
145
+ ]
146
+ }
147
+ ],
148
+ workflows: [
149
+ {
150
+ name: "Development Branch Setup",
151
+ description: "Create a development branch for safe experimentation",
152
+ steps: [
153
+ "List existing branches: `xano branch:list`",
154
+ "Create dev branch from v1: `xano branch:create --label dev`",
155
+ "Pull dev branch code: `xano workspace:pull ./dev-code -b dev`",
156
+ "Make changes and push: `xano workspace:push ./dev-code -b dev`",
157
+ "Test changes in dev environment"
158
+ ],
159
+ example: `xano branch:list
160
+ xano branch:create --label dev
161
+ xano workspace:pull ./dev -b dev
162
+ # Make changes...
163
+ xano workspace:push ./dev -b dev`
164
+ },
165
+ {
166
+ name: "Feature Branch Workflow",
167
+ description: "Work on a feature in isolation before merging",
168
+ steps: [
169
+ "Create feature branch from dev: `xano branch:create -l feature-auth -s dev`",
170
+ "Pull and work on feature branch",
171
+ "Test feature thoroughly",
172
+ "Delete feature branch when done: `xano branch:delete feature-auth`"
173
+ ]
174
+ },
175
+ {
176
+ name: "Promote to Production",
177
+ description: "Deploy tested changes to production",
178
+ steps: [
179
+ "Verify staging branch is ready",
180
+ "Check current live branch: `xano branch:list`",
181
+ "Set staging as live: `xano branch:set-live staging`",
182
+ "Monitor for issues",
183
+ "Rollback if needed: `xano branch:set-live v1 --force`"
184
+ ],
185
+ example: `# Check branches
186
+ xano branch:list
187
+
188
+ # Promote staging to live
189
+ xano branch:set-live staging
190
+
191
+ # If issues occur, rollback
192
+ xano branch:set-live v1 --force`
193
+ }
194
+ ]
195
+ };
@@ -44,6 +44,79 @@ When you pull, the CLI splits these into individual \`.xs\` files organized by t
44
44
  usage: "xano workspace:list [-p <profile>]",
45
45
  examples: ["xano workspace:list", "xano workspace:list -p production"]
46
46
  },
47
+ {
48
+ name: "workspace:get",
49
+ description: "Get details of a specific workspace",
50
+ usage: "xano workspace:get [workspace_id] [options]",
51
+ args: [
52
+ { name: "workspace_id", required: false, description: "Workspace ID (uses profile workspace if not provided)" }
53
+ ],
54
+ flags: [
55
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
56
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
57
+ ],
58
+ examples: [
59
+ "xano workspace:get 123",
60
+ "xano workspace:get --output json",
61
+ "xano workspace:get 456 -p production -o json"
62
+ ]
63
+ },
64
+ {
65
+ name: "workspace:create",
66
+ description: "Create a new workspace via the Xano Metadata API",
67
+ usage: "xano workspace:create --name <name> [options]",
68
+ flags: [
69
+ { name: "name", short: "n", type: "string", required: true, description: "Name of the workspace" },
70
+ { name: "description", short: "d", type: "string", required: false, description: "Description for the workspace" },
71
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
72
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
73
+ ],
74
+ examples: [
75
+ 'xano workspace:create --name "my-workspace"',
76
+ 'xano workspace:create --name "my-app" --description "My application workspace"',
77
+ 'xano workspace:create -n "new-project" -d "New project workspace" -o json'
78
+ ]
79
+ },
80
+ {
81
+ name: "workspace:edit",
82
+ description: "Edit an existing workspace via the Xano Metadata API",
83
+ usage: "xano workspace:edit [workspace_id] [options]",
84
+ args: [
85
+ { name: "workspace_id", required: false, description: "Workspace ID to edit (uses profile workspace if not provided)" }
86
+ ],
87
+ flags: [
88
+ { name: "name", short: "n", type: "string", required: false, description: "New name for the workspace" },
89
+ { name: "description", short: "d", type: "string", required: false, description: "New description for the workspace" },
90
+ { name: "swagger", type: "boolean", required: false, description: "Enable or disable swagger documentation (--swagger or --no-swagger)" },
91
+ { name: "require-token", type: "boolean", required: false, description: "Require token for documentation access (--require-token or --no-require-token)" },
92
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
93
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
94
+ ],
95
+ examples: [
96
+ 'xano workspace:edit 123 --name "new-name"',
97
+ 'xano workspace:edit --name "updated-workspace" --description "Updated description"',
98
+ "xano workspace:edit 123 --swagger --require-token",
99
+ "xano workspace:edit 123 --no-swagger -o json"
100
+ ]
101
+ },
102
+ {
103
+ name: "workspace:delete",
104
+ description: "Delete a workspace via the Xano Metadata API. Cannot delete workspaces with active tenants.",
105
+ usage: "xano workspace:delete <workspace_id> [options]",
106
+ args: [
107
+ { name: "workspace_id", required: true, description: "Workspace ID to delete" }
108
+ ],
109
+ flags: [
110
+ { name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
111
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
112
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
113
+ ],
114
+ examples: [
115
+ "xano workspace:delete 123",
116
+ "xano workspace:delete 123 --force",
117
+ "xano workspace:delete 123 -f -o json"
118
+ ]
119
+ },
47
120
  {
48
121
  name: "workspace:pull",
49
122
  description: "Download workspace code to local directory",
@@ -4,22 +4,23 @@ export const branchDoc = {
4
4
  description: `Branches provide environment separation for your Xano workspace. Use branches for development, staging, and production environments.
5
5
 
6
6
  ## Key Concepts
7
- - Default branch is "v1" (cannot be deleted)
7
+ - Default branch is "v1" (cannot be deleted or renamed)
8
8
  - Branches contain separate databases and configurations
9
9
  - One branch is designated as "live" (production)
10
+ - Create branches by cloning from existing branches
10
11
  - Useful for safe development without affecting production
11
- - Import schema to create new branches from exports
12
12
 
13
13
  ## Common Workflow
14
- 1. Create a development branch
15
- 2. Make and test changes on dev branch
16
- 3. Export schema from dev
17
- 4. Import schema to production branch`,
14
+ 1. Create a development branch by cloning from "v1"
15
+ 2. Make and test changes on the dev branch
16
+ 3. Set the dev branch as live when ready
17
+ 4. Or merge changes back to production manually`,
18
18
  ai_hints: `- Cannot delete the "v1" branch or the live branch
19
- - Use branch parameter in list endpoints to filter by branch
20
- - Import schema creates a new branch from export file
21
- - Always verify branch before making changes (dev vs prod)
22
- - Export before major changes for backup`,
19
+ - Cannot update/rename the "v1" branch label
20
+ - Use "v1" as the source_branch when cloning from the default branch
21
+ - The "live" property indicates which branch is active for API requests
22
+ - "backup" property indicates if branch was created as a backup
23
+ - Always verify branch before making changes (dev vs prod)`,
23
24
  endpoints: [
24
25
  {
25
26
  method: "GET",
@@ -30,11 +31,78 @@ export const branchDoc = {
30
31
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
31
32
  ]
32
33
  },
34
+ {
35
+ method: "GET",
36
+ path: "/workspace/{workspace_id}/branch/{branch_label}",
37
+ tool_name: "getBranch",
38
+ description: "Retrieve details for a specific branch by label. Use 'v1' for the default branch.",
39
+ parameters: [
40
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
41
+ { name: "branch_label", type: "string", required: true, in: "path", description: "Branch label (use 'v1' for default branch)" }
42
+ ]
43
+ },
44
+ {
45
+ method: "POST",
46
+ path: "/workspace/{workspace_id}/branch",
47
+ tool_name: "createBranch",
48
+ description: "Create a new branch by cloning from an existing branch. Use 'v1' as source_branch for the default branch.",
49
+ parameters: [
50
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
51
+ ],
52
+ request_body: {
53
+ type: "object",
54
+ properties: {
55
+ source_branch: { type: "string", description: "Label of the branch to clone from. Defaults to 'v1'", required: false },
56
+ label: { type: "string", description: "Label for the new branch", required: true },
57
+ description: { type: "string", description: "Description for the new branch", required: false },
58
+ color: { type: "string", description: "Color hex code for the branch (e.g., '#ebc346')", required: false }
59
+ },
60
+ example: {
61
+ source_branch: "v1",
62
+ label: "feature-branch",
63
+ description: "A new feature branch",
64
+ color: "#ebc346"
65
+ }
66
+ }
67
+ },
68
+ {
69
+ method: "PUT",
70
+ path: "/workspace/{workspace_id}/branch/{branch_label}",
71
+ tool_name: "updateBranch",
72
+ description: "Update an existing branch's label, description, or color. Cannot update the default 'v1' branch label.",
73
+ parameters: [
74
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
75
+ { name: "branch_label", type: "string", required: true, in: "path", description: "Current label of the branch to update" }
76
+ ],
77
+ request_body: {
78
+ type: "object",
79
+ properties: {
80
+ label: { type: "string", description: "New label for the branch", required: false },
81
+ description: { type: "string", description: "New description for the branch", required: false },
82
+ color: { type: "string", description: "New color hex code for the branch", required: false }
83
+ },
84
+ example: {
85
+ label: "updated-branch",
86
+ description: "Updated description",
87
+ color: "#ff5733"
88
+ }
89
+ }
90
+ },
91
+ {
92
+ method: "POST",
93
+ path: "/workspace/{workspace_id}/branch/{branch_label}/live",
94
+ tool_name: "setBranchLive",
95
+ description: "Set a branch as the live (active) branch for the workspace. The live branch is the default branch used for API requests.",
96
+ parameters: [
97
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
98
+ { name: "branch_label", type: "string", required: true, in: "path", description: "Label of the branch to set as live (use 'v1' for default)" }
99
+ ]
100
+ },
33
101
  {
34
102
  method: "DELETE",
35
103
  path: "/workspace/{workspace_id}/branch/{branch_label}",
36
104
  tool_name: "deleteBranch",
37
- description: "Delete a branch. Cannot delete 'v1' or the live branch.",
105
+ description: "Delete a branch. Cannot delete the 'v1' branch or the currently live branch.",
38
106
  parameters: [
39
107
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
40
108
  { name: "branch_label", type: "string", required: true, in: "path", description: "Branch label/name to delete" }
@@ -45,9 +113,10 @@ export const branchDoc = {
45
113
  Branch: {
46
114
  type: "object",
47
115
  properties: {
116
+ created_at: { type: "string", format: "date-time", description: "When the branch was created" },
48
117
  label: { type: "string", description: "Branch identifier (e.g., 'v1', 'dev')" },
49
- is_live: { type: "boolean", description: "Whether this is the live/production branch" },
50
- created_at: { type: "string", format: "date-time" }
118
+ backup: { type: "boolean", description: "Whether this branch was created as a backup" },
119
+ live: { type: "boolean", description: "Whether this is the live/production branch" }
51
120
  }
52
121
  }
53
122
  },
@@ -60,12 +129,79 @@ export const branchDoc = {
60
129
  path: "/workspace/1/branch",
61
130
  headers: { "Authorization": "Bearer <token>" }
62
131
  },
132
+ response: [
133
+ { created_at: "2024-01-15T10:30:00Z", label: "v1", backup: false, live: true },
134
+ { created_at: "2024-02-01T14:20:00Z", label: "dev", backup: false, live: false },
135
+ { created_at: "2024-02-10T09:15:00Z", label: "staging", backup: false, live: false }
136
+ ]
137
+ },
138
+ {
139
+ title: "Get a specific branch",
140
+ description: "Retrieve details for a single branch",
141
+ request: {
142
+ method: "GET",
143
+ path: "/workspace/1/branch/dev",
144
+ headers: { "Authorization": "Bearer <token>" }
145
+ },
146
+ response: {
147
+ created_at: "2024-02-01T14:20:00Z",
148
+ label: "dev",
149
+ backup: false,
150
+ live: false
151
+ }
152
+ },
153
+ {
154
+ title: "Create a new branch",
155
+ description: "Clone from v1 to create a development branch",
156
+ request: {
157
+ method: "POST",
158
+ path: "/workspace/1/branch",
159
+ headers: { "Authorization": "Bearer <token>" },
160
+ body: {
161
+ source_branch: "v1",
162
+ label: "feature-auth",
163
+ description: "Authentication feature development",
164
+ color: "#ebc346"
165
+ }
166
+ },
167
+ response: {
168
+ created_at: "2024-02-11T10:00:00Z",
169
+ label: "feature-auth",
170
+ backup: false,
171
+ live: false
172
+ }
173
+ },
174
+ {
175
+ title: "Update a branch",
176
+ description: "Rename a branch and update its color",
177
+ request: {
178
+ method: "PUT",
179
+ path: "/workspace/1/branch/feature-auth",
180
+ headers: { "Authorization": "Bearer <token>" },
181
+ body: {
182
+ label: "feature-authentication",
183
+ color: "#ff5733"
184
+ }
185
+ },
186
+ response: {
187
+ created_at: "2024-02-11T10:00:00Z",
188
+ label: "feature-authentication",
189
+ backup: false
190
+ }
191
+ },
192
+ {
193
+ title: "Set branch as live",
194
+ description: "Make a branch the active production branch",
195
+ request: {
196
+ method: "POST",
197
+ path: "/workspace/1/branch/staging/live",
198
+ headers: { "Authorization": "Bearer <token>" }
199
+ },
63
200
  response: {
64
- items: [
65
- { label: "v1", is_live: true },
66
- { label: "dev", is_live: false },
67
- { label: "staging", is_live: false }
68
- ]
201
+ created_at: "2024-02-10T09:15:00Z",
202
+ label: "staging",
203
+ backup: false,
204
+ live: true
69
205
  }
70
206
  }
71
207
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "MCP server for Xano Headless API documentation and XanoScript code validation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",