@xano/developer-mcp 2.2.2-beta.2 → 2.2.2

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.
@@ -12,6 +12,7 @@ import { xanoscriptDocs, xanoscriptDocsTool, xanoscriptDocsToolSpec, getXanoscri
12
12
  import { mcpVersion, mcpVersionTool, mcpVersionToolSpec, getServerVersion, setServerVersion, } from "./mcp_version.js";
13
13
  import { metaApiDocs, metaApiDocsTool, metaApiDocsToolSpec, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, } from "./meta_api_docs.js";
14
14
  import { cliDocs, cliDocsTool, cliDocsToolSpec, cliTopics, getCliTopicNames, getCliTopicDescriptions, } from "./cli_docs.js";
15
+ import { xanoKnowledgeList, xanoKnowledgeListTool, xanoKnowledgeListToolSpec, xanoKnowledgeGet, xanoKnowledgeGetTool, xanoKnowledgeGetToolSpec, } from "./xano_knowledge.js";
15
16
  import { toMcpResponse } from "./types.js";
16
17
  // =============================================================================
17
18
  // Standalone Tool Functions (for library usage)
@@ -26,11 +27,13 @@ mcpVersion, getServerVersion, setServerVersion,
26
27
  // Meta API Documentation
27
28
  metaApiDocs, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions,
28
29
  // CLI Documentation
29
- cliDocs, cliTopics, getCliTopicNames, getCliTopicDescriptions, toMcpResponse, };
30
+ cliDocs, cliTopics, getCliTopicNames, getCliTopicDescriptions,
31
+ // Workspace Knowledge
32
+ xanoKnowledgeList, xanoKnowledgeGet, toMcpResponse, };
30
33
  // =============================================================================
31
34
  // Tool Result Functions (for internal MCP usage)
32
35
  // =============================================================================
33
- export { validateXanoscriptTool, xanoscriptDocsTool, mcpVersionTool, metaApiDocsTool, cliDocsTool, };
36
+ export { validateXanoscriptTool, xanoscriptDocsTool, mcpVersionTool, metaApiDocsTool, cliDocsTool, xanoKnowledgeListTool, xanoKnowledgeGetTool, };
34
37
  // =============================================================================
35
38
  // Tool Registry — single source of truth
36
39
  // =============================================================================
@@ -45,6 +48,8 @@ export const toolSpecs = {
45
48
  xano_version: mcpVersionToolSpec,
46
49
  xano_meta_api_docs: metaApiDocsToolSpec,
47
50
  xano_cli_docs: cliDocsToolSpec,
51
+ xano_knowledge_list: xanoKnowledgeListToolSpec,
52
+ xano_knowledge_get: xanoKnowledgeGetToolSpec,
48
53
  };
49
54
  /**
50
55
  * Tool definitions array (derived from toolSpecs). Kept for callers that
@@ -104,6 +109,18 @@ const dispatch = {
104
109
  return parsed.error;
105
110
  return cliDocsTool(parsed.data);
106
111
  },
112
+ async xano_knowledge_list(args) {
113
+ const parsed = parseWithSpec(xanoKnowledgeListToolSpec, args);
114
+ if (!parsed.ok)
115
+ return parsed.error;
116
+ return xanoKnowledgeListTool(parsed.data);
117
+ },
118
+ async xano_knowledge_get(args) {
119
+ const parsed = parseWithSpec(xanoKnowledgeGetToolSpec, args);
120
+ if (!parsed.ok)
121
+ return parsed.error;
122
+ return xanoKnowledgeGetTool(parsed.data);
123
+ },
107
124
  };
108
125
  function isToolName(name) {
109
126
  return name in dispatch;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Xano Workspace Knowledge Tools
3
+ *
4
+ * This MCP server has no shell access, so these tools don't run the CLI
5
+ * themselves — they return the exact `xano knowledge list` / `xano knowledge
6
+ * get` command to run, along with a short pointer on what it does.
7
+ */
8
+ import { z } from "zod";
9
+ import type { ToolResult } from "./types.js";
10
+ export interface XanoKnowledgeListArgs {
11
+ workspace?: string;
12
+ branch?: string;
13
+ type?: "skill" | "doc" | "agents.md";
14
+ enabled_only?: boolean;
15
+ output?: "markdown" | "json";
16
+ profile?: string;
17
+ }
18
+ export interface XanoKnowledgeGetArgs {
19
+ name: string;
20
+ workspace?: string;
21
+ branch?: string;
22
+ file?: string;
23
+ output?: "text" | "json";
24
+ profile?: string;
25
+ }
26
+ export interface XanoKnowledgeListResult {
27
+ command: string;
28
+ }
29
+ export interface XanoKnowledgeGetResult {
30
+ command: string;
31
+ }
32
+ export declare function xanoKnowledgeList(args: XanoKnowledgeListArgs): XanoKnowledgeListResult;
33
+ export declare function xanoKnowledgeGet(args: XanoKnowledgeGetArgs): XanoKnowledgeGetResult;
34
+ export declare function xanoKnowledgeListTool(args: XanoKnowledgeListArgs): ToolResult;
35
+ export declare function xanoKnowledgeGetTool(args: XanoKnowledgeGetArgs): ToolResult;
36
+ export declare const xanoKnowledgeListToolSpec: import("./define_tool.js").BuiltTool<{
37
+ workspace: z.ZodOptional<z.ZodString>;
38
+ branch: z.ZodOptional<z.ZodString>;
39
+ type: z.ZodOptional<z.ZodEnum<{
40
+ "agents.md": "agents.md";
41
+ doc: "doc";
42
+ skill: "skill";
43
+ }>>;
44
+ enabled_only: z.ZodOptional<z.ZodBoolean>;
45
+ output: z.ZodOptional<z.ZodEnum<{
46
+ json: "json";
47
+ markdown: "markdown";
48
+ }>>;
49
+ profile: z.ZodOptional<z.ZodString>;
50
+ }, {
51
+ command: z.ZodString;
52
+ }>;
53
+ export declare const xanoKnowledgeGetToolSpec: import("./define_tool.js").BuiltTool<{
54
+ name: z.ZodString;
55
+ workspace: z.ZodOptional<z.ZodString>;
56
+ branch: z.ZodOptional<z.ZodString>;
57
+ file: z.ZodOptional<z.ZodString>;
58
+ output: z.ZodOptional<z.ZodEnum<{
59
+ json: "json";
60
+ text: "text";
61
+ }>>;
62
+ profile: z.ZodOptional<z.ZodString>;
63
+ }, {
64
+ command: z.ZodString;
65
+ }>;
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Xano Workspace Knowledge Tools
3
+ *
4
+ * This MCP server has no shell access, so these tools don't run the CLI
5
+ * themselves — they return the exact `xano knowledge list` / `xano knowledge
6
+ * get` command to run, along with a short pointer on what it does.
7
+ */
8
+ import { z } from "zod";
9
+ import { defineTool } from "./define_tool.js";
10
+ // =============================================================================
11
+ // Command building
12
+ // =============================================================================
13
+ /** Quote an argv entry for display in a copy-pasteable shell command. */
14
+ function shellQuote(value) {
15
+ return /[^\w./-]/.test(value) ? `"${value.replace(/(["\\$`])/g, "\\$1")}"` : value;
16
+ }
17
+ function formatCommand(args) {
18
+ return args.map(shellQuote).join(" ");
19
+ }
20
+ export function xanoKnowledgeList(args) {
21
+ const cliArgs = ["xano", "knowledge", "list"];
22
+ if (args.workspace)
23
+ cliArgs.push("-w", args.workspace);
24
+ if (args.branch)
25
+ cliArgs.push("-b", args.branch);
26
+ if (args.type)
27
+ cliArgs.push("-t", args.type);
28
+ if (args.enabled_only === false)
29
+ cliArgs.push("--no-enabled-only");
30
+ cliArgs.push("-o", args.output ?? "markdown");
31
+ if (args.profile)
32
+ cliArgs.push("-p", args.profile);
33
+ return { command: formatCommand(cliArgs) };
34
+ }
35
+ export function xanoKnowledgeGet(args) {
36
+ const cliArgs = ["xano", "knowledge", "get", args.name];
37
+ if (args.workspace)
38
+ cliArgs.push("-w", args.workspace);
39
+ if (args.branch)
40
+ cliArgs.push("-b", args.branch);
41
+ if (args.file)
42
+ cliArgs.push("-f", args.file);
43
+ cliArgs.push("-o", args.output ?? "text");
44
+ if (args.profile)
45
+ cliArgs.push("-p", args.profile);
46
+ return { command: formatCommand(cliArgs) };
47
+ }
48
+ // =============================================================================
49
+ // Tool Result Functions (for internal MCP usage)
50
+ // =============================================================================
51
+ export function xanoKnowledgeListTool(args) {
52
+ const { command } = xanoKnowledgeList(args);
53
+ return {
54
+ success: true,
55
+ data: `Run this command to list the workspace's knowledge base (skills, docs, agents.md):\n\n${command}`,
56
+ structuredContent: { command },
57
+ };
58
+ }
59
+ export function xanoKnowledgeGetTool(args) {
60
+ if (!args?.name) {
61
+ return {
62
+ success: false,
63
+ error: "Error: 'name' parameter is required.",
64
+ };
65
+ }
66
+ const { command } = xanoKnowledgeGet(args);
67
+ return {
68
+ success: true,
69
+ data: `Run this command to fetch the knowledge item's content:\n\n${command}`,
70
+ structuredContent: { command },
71
+ };
72
+ }
73
+ // =============================================================================
74
+ // Tool Definitions (Zod shapes -> JSON Schema)
75
+ // =============================================================================
76
+ export const xanoKnowledgeListToolSpec = defineTool({
77
+ name: "xano_knowledge_list",
78
+ description: `Get the CLI command to list a Xano workspace's knowledge base: skills, docs, and the agents.md file. This tool does not run the command itself — it returns the exact \`xano knowledge list\` command to run in a shell, so you can invoke it and read its output.
79
+
80
+ Use this to get an overview of what knowledge/skills exist before answering questions about workspace conventions, or before deciding whether a new skill/doc needs to be created (to avoid duplicating existing ones).
81
+
82
+ Always-on items (mode=always) are returned by the command with full content; on-demand items are returned with just name+description — use xano_knowledge_get to get the command for fetching an on-demand item's full content when it becomes relevant.`,
83
+ annotations: {
84
+ readOnlyHint: true,
85
+ destructiveHint: false,
86
+ idempotentHint: true,
87
+ openWorldHint: false,
88
+ },
89
+ inputShape: {
90
+ workspace: z
91
+ .string()
92
+ .optional()
93
+ .describe("Workspace ID. Optional if the active profile has a default workspace configured."),
94
+ branch: z
95
+ .string()
96
+ .optional()
97
+ .describe("Branch ID to read knowledge from. Optional; defaults to the workspace's live branch."),
98
+ type: z
99
+ .enum(["skill", "doc", "agents.md"])
100
+ .optional()
101
+ .describe("Filter to a single knowledge type. Omit to list all types."),
102
+ enabled_only: z
103
+ .boolean()
104
+ .optional()
105
+ .describe("When true (default), only enabled items are returned. Set to false to include disabled items too."),
106
+ output: z
107
+ .enum(["markdown", "json"])
108
+ .optional()
109
+ .describe("markdown is human-readable (always-on items inline, on-demand items as a name+description index). " +
110
+ "json returns the full raw item array — prefer json when you need structured fields " +
111
+ "(id, guid, mode, references, etc.) for further processing. Default: markdown."),
112
+ profile: z
113
+ .string()
114
+ .optional()
115
+ .describe("CLI credential profile to use. Optional; falls back to XANO_PROFILE env var or the credentials file default."),
116
+ },
117
+ outputShape: {
118
+ command: z.string().describe("The `xano knowledge list` command to run to get the workspace's knowledge base."),
119
+ },
120
+ });
121
+ export const xanoKnowledgeGetToolSpec = defineTool({
122
+ name: "xano_knowledge_get",
123
+ description: `Get the CLI command to fetch the full content of one named knowledge item (a skill, doc, or agents.md), or one of a skill's attached reference files. This tool does not run the command itself — it returns the exact \`xano knowledge get\` command to run in a shell, so you can invoke it and read its output.
124
+
125
+ Use this after xano_knowledge_list has identified an on-demand item whose full content is now needed, or when a skill's step tells you to consult a specific reference file (via @filename syntax in the skill content).`,
126
+ annotations: {
127
+ readOnlyHint: true,
128
+ destructiveHint: false,
129
+ idempotentHint: true,
130
+ openWorldHint: false,
131
+ },
132
+ inputShape: {
133
+ name: z
134
+ .string()
135
+ .describe("The knowledge item's name (case-insensitive exact match). Required."),
136
+ workspace: z
137
+ .string()
138
+ .optional()
139
+ .describe("Workspace ID. Optional if the active profile has a default workspace configured."),
140
+ branch: z
141
+ .string()
142
+ .optional()
143
+ .describe("Branch ID. Optional; defaults to the workspace's live branch."),
144
+ file: z
145
+ .string()
146
+ .optional()
147
+ .describe("Path of a reference file attached to the item (as listed in that item's `references` array from " +
148
+ "xano_knowledge_list), fetched instead of the item's own content."),
149
+ output: z
150
+ .enum(["text", "json"])
151
+ .optional()
152
+ .describe("text returns the raw markdown content. json wraps it with metadata (item: full object; " +
153
+ "file: {content, name, path}). Default: text."),
154
+ profile: z
155
+ .string()
156
+ .optional()
157
+ .describe("CLI credential profile to use."),
158
+ },
159
+ outputShape: {
160
+ command: z.string().describe("The `xano knowledge get` command to run to fetch the knowledge item's content."),
161
+ },
162
+ });
@@ -125,12 +125,6 @@
125
125
  "priority": 3,
126
126
  "aliases": ["mcp", "model-context-protocol"]
127
127
  },
128
- "knowledge": {
129
- "file": "knowledge.md",
130
- "description": "Agent Knowledge: Skills, Docs, and AGENTS.md Context that steer the Xano AI agent (disclosure modes, scopes, authoring)",
131
- "applyTo": [],
132
- "aliases": ["skills", "skill", "docs", "agent-knowledge", "agents-md", "context"]
133
- },
134
128
  "unit-testing": {
135
129
  "file": "unit-testing.md",
136
130
  "description": "Unit tests, mocks, and assertions within functions, APIs, and middleware",