From 4c1692ea332ece543b7cdf9f9d1968b9d9fb44f8 Mon Sep 17 00:00:00 2001 From: Satya Patel <14907857+saddlepaddle@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:11:24 +0000 Subject: [PATCH 1/4] refactor(cli): parse an MCP plugin ref with the shared plugin ref parser --- packages/cli/src/lib/plugins/mcp-client.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/lib/plugins/mcp-client.ts b/packages/cli/src/lib/plugins/mcp-client.ts index 1e60a2caba2..2fcaf3f6cd6 100644 --- a/packages/cli/src/lib/plugins/mcp-client.ts +++ b/packages/cli/src/lib/plugins/mcp-client.ts @@ -4,19 +4,16 @@ import { CLIError } from "@superset/cli-framework"; import { ORGANIZATION_HEADER } from "@superset/shared/constants"; import { DEFAULT_MARKETPLACE } from "@superset/shared/plugins"; import { getApiUrl } from "../config"; +import { parsePluginRef as parseRef } from "./host"; export interface PluginRef { plugin: string; marketplace: string; } -export function parsePluginRef(name: string): PluginRef { - const at = name.lastIndexOf("@"); - if (at <= 0) return { plugin: name, marketplace: DEFAULT_MARKETPLACE }; - return { - plugin: name.slice(0, at), - marketplace: name.slice(at + 1), - }; +export function parsePluginRef(ref: string): PluginRef { + const { name, marketplace } = parseRef(ref); + return { plugin: name, marketplace: marketplace ?? DEFAULT_MARKETPLACE }; } export function pluginMcpUrl(ref: PluginRef, connection?: string): URL { From 58a16eff9abf9ebe5bda7f2129cd189bedbc3cdd Mon Sep 17 00:00:00 2001 From: Satya Patel <14907857+saddlepaddle@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:14:05 +0000 Subject: [PATCH 2/4] feat(cli): show a plugin tool's schemas and resolve a plugin by the name its owner types --- docs/plugins.md | 2 +- .../src/commands/mcp/tools/command.test.ts | 110 ++++++++++++++++++ .../cli/src/commands/mcp/tools/command.ts | 100 +++++++++++++--- .../src/commands/mcp/tools/schemaFields.ts | 41 +++++++ .../cli/src/lib/plugins/mcp-client.test.ts | 67 +++++++++++ packages/cli/src/lib/plugins/mcp-client.ts | 53 ++++++++- plugins/superset/skills/integrations/SKILL.md | 23 ++-- 7 files changed, 364 insertions(+), 32 deletions(-) create mode 100644 packages/cli/src/commands/mcp/tools/command.test.ts create mode 100644 packages/cli/src/commands/mcp/tools/schemaFields.ts create mode 100644 packages/cli/src/lib/plugins/mcp-client.test.ts diff --git a/docs/plugins.md b/docs/plugins.md index 959d886bd77..b95cf738931 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -226,6 +226,6 @@ superset plugins connect|connections # credentials superset plugins marketplace list|add|remove # marketplace sources superset plugins organization list|access # an organization's own plugins superset plugins organization sources add|list|remove|sync # their GitHub sources -superset mcp tools|call-tool # call a plugin's tools through the proxy +superset mcp tools [tool]|call-tool # list a plugin's tools, read one's schema, call it superset skills list ``` diff --git a/packages/cli/src/commands/mcp/tools/command.test.ts b/packages/cli/src/commands/mcp/tools/command.test.ts new file mode 100644 index 00000000000..794b9fa3a37 --- /dev/null +++ b/packages/cli/src/commands/mcp/tools/command.test.ts @@ -0,0 +1,110 @@ +import { afterAll, afterEach, beforeEach, expect, test } from "bun:test"; +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js"; +import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js"; +import { env } from "../../../lib/env"; +import { withTempSupersetHome } from "../../../lib/settings/test-helpers"; +import toolsCommand from "./command"; + +const createIssue = { + name: "create_issue", + description: "Create an issue.", + inputSchema: { + type: "object" as const, + properties: { + title: { type: "string", description: "Issue title" }, + labels: { type: "array", items: { type: "string" } }, + priority: { enum: [1, 2, 3], default: 2 }, + }, + required: ["title"], + }, + outputSchema: { + type: "object" as const, + properties: { id: { type: "string", description: "New issue id" } }, + }, +}; + +const proxy = Bun.serve({ + port: 0, + async fetch(request) { + const transport = new WebStandardStreamableHTTPServerTransport({ + enableJsonResponse: true, + }); + const server = new Server( + { name: "stub", version: "1.0.0" }, + { capabilities: { tools: {} } }, + ); + server.setRequestHandler(ListToolsRequestSchema, async () => ({ + tools: [ + createIssue, + { name: "ping", inputSchema: { type: "object" as const } }, + ], + })); + await server.connect(transport); + return transport.handleRequest(request); + }, +}); +afterAll(() => proxy.stop(true)); + +withTempSupersetHome("superset-cli-mcp-tools-"); +const originalApiUrl = env.SUPERSET_API_URL; +beforeEach(() => { + env.SUPERSET_API_URL = `http://localhost:${proxy.port}`; +}); +afterEach(() => { + env.SUPERSET_API_URL = originalApiUrl; +}); + +async function listTools(tool?: string): Promise<{ data: unknown }> { + return (await toolsCommand.run({ + ctx: { bearer: "test-key", config: {} }, + args: { tool }, + options: { plugin: "stub" }, + signal: new AbortController().signal, + } as never)) as { data: unknown }; +} + +test("the list carries each tool's schemas as the server sent them", async () => { + const { data } = await listTools(); + + expect(data).toEqual([ + { + plugin: "stub", + tool: "create_issue", + description: "Create an issue.", + inputSchema: createIssue.inputSchema, + outputSchema: createIssue.outputSchema, + }, + { + plugin: "stub", + tool: "ping", + description: "", + inputSchema: { type: "object" }, + outputSchema: undefined, + }, + ]); +}); + +test("one tool shows its arguments and output as fields", async () => { + const { data } = await listTools("create_issue"); + const text = toolsCommand.display?.(data) ?? ""; + + expect(text).toContain("create_issue (stub)"); + expect(text).toMatch(/title\s+string\s+yes\s+Issue title/); + expect(text).toMatch(/labels\s+string\[\]/); + expect(text).toMatch(/priority\s+1 \| 2 \| 3\s+2/); + expect(text).toMatch(/Output:\nNAME.*\nid\s+string\s+New issue id/); +}); + +test("a tool with no arguments and no output says so", async () => { + const text = toolsCommand.display?.((await listTools("ping")).data) ?? ""; + + expect(text).toContain("Arguments:\nNone."); + expect(text).toContain("Output:\nNot declared by the server."); +}); + +test("an unknown tool names the closest one", async () => { + await expect(listTools("create_isue")).rejects.toThrow( + expect.objectContaining({ suggestion: "Did you mean create_issue?" }), + ); +}); diff --git a/packages/cli/src/commands/mcp/tools/command.ts b/packages/cli/src/commands/mcp/tools/command.ts index f38099966f4..6699da1fef0 100644 --- a/packages/cli/src/commands/mcp/tools/command.ts +++ b/packages/cli/src/commands/mcp/tools/command.ts @@ -1,12 +1,53 @@ -import { string, table } from "@superset/cli-framework"; +import type { Tool } from "@modelcontextprotocol/sdk/types.js"; +import { + CLIError, + positional, + string, + suggestSimilar, + table, +} from "@superset/cli-framework"; import { command } from "../../../lib/command"; import { resolveOrganizationId } from "../../../lib/config"; import { resolvePluginName } from "../../../lib/plugins/connection-ref"; import { connectPluginMcp } from "../../../lib/plugins/mcp-client"; +import { schemaFields } from "./schemaFields"; + +interface ToolRow { + plugin: string; + tool: string; + description: string; + inputSchema: Tool["inputSchema"]; + outputSchema?: Tool["outputSchema"]; +} + +function fieldTable(schema: Tool["inputSchema"]): string { + const fields = schemaFields(schema); + if (fields.length === 0) return "None."; + return table( + fields as unknown as Record[], + ["name", "type", "required", "default", "description"], + ["NAME", "TYPE", "REQUIRED", "DEFAULT", "DESCRIPTION"], + [30, 24, 8, 16, 80], + ); +} + +function describeTool(row: ToolRow): string { + return [ + `${row.tool} (${row.plugin})`, + row.description, + `Arguments:\n${fieldTable(row.inputSchema)}`, + `Output:\n${row.outputSchema ? fieldTable(row.outputSchema) : "Not declared by the server."}`, + ] + .filter(Boolean) + .join("\n\n"); +} export default command({ - description: "List the tools a connected plugin exposes", - args: [], + description: + "List the tools a connected plugin exposes, or show one tool's arguments and output", + args: [ + positional("tool").desc("Tool name, to show its arguments and output"), + ], options: { plugin: string().desc("Plugin name from `paradev plugins list`"), account: string().desc( @@ -16,13 +57,15 @@ export default command({ pluginId: string().desc("Deprecated alias for --plugin"), }, display: (data) => - table( - (data ?? []) as Record[], - ["plugin", "tool", "description"], - ["PLUGIN", "TOOL", "DESCRIPTION"], - [16, 30, 70], - ), - run: async ({ ctx, options }) => { + Array.isArray(data) + ? table( + data as Record[], + ["plugin", "tool", "description"], + ["PLUGIN", "TOOL", "DESCRIPTION"], + [16, 30, 70], + ) + : describeTool(data as ToolRow), + run: async ({ ctx, args, options }) => { const pluginName = resolvePluginName({ plugin: options.plugin as string | undefined, connection: options.connection as string | undefined, @@ -39,14 +82,35 @@ export default command({ ); try { const { tools } = await client.listTools(); - return { - data: tools.map((tool) => ({ - plugin: ref.plugin, - tool: tool.name, - description: tool.description ?? "", - })), - message: `${tools.length} tool${tools.length === 1 ? "" : "s"} on ${ref.plugin}.`, - }; + const rows: ToolRow[] = tools.map((tool) => ({ + plugin: ref.plugin, + tool: tool.name, + description: tool.description ?? "", + inputSchema: tool.inputSchema, + outputSchema: tool.outputSchema, + })); + + const name = args.tool as string | undefined; + if (name === undefined) { + return { + data: rows, + message: `${rows.length} tool${rows.length === 1 ? "" : "s"} on ${ref.plugin}.`, + }; + } + const row = rows.find((candidate) => candidate.tool === name); + if (!row) { + const similar = suggestSimilar( + name, + rows.map((candidate) => candidate.tool), + ); + throw new CLIError( + `${ref.plugin} has no tool "${name}".`, + similar + ? `Did you mean ${similar}?` + : `Run: paradev mcp tools --plugin ${pluginName}`, + ); + } + return { data: row }; } finally { await client.close(); } diff --git a/packages/cli/src/commands/mcp/tools/schemaFields.ts b/packages/cli/src/commands/mcp/tools/schemaFields.ts new file mode 100644 index 00000000000..9178c17c688 --- /dev/null +++ b/packages/cli/src/commands/mcp/tools/schemaFields.ts @@ -0,0 +1,41 @@ +interface PropertySchema { + type?: string | string[]; + enum?: unknown[]; + items?: PropertySchema; + default?: unknown; + description?: string; +} + +export interface SchemaField { + name: string; + type: string; + required: string; + default: string; + description: string; +} + +function typeLabel(property: PropertySchema): string { + if (property.enum) return property.enum.map(String).join(" | "); + if (Array.isArray(property.type)) return property.type.join(" | "); + if (property.type === "array" && property.items) { + return `${typeLabel(property.items)}[]`; + } + return property.type ?? "any"; +} + +export function schemaFields(schema: { + properties?: Record; + required?: string[]; +}): SchemaField[] { + return Object.entries(schema.properties ?? {}).map(([name, value]) => { + const property = value as PropertySchema; + return { + name, + type: typeLabel(property), + required: schema.required?.includes(name) ? "yes" : "", + default: + property.default === undefined ? "" : JSON.stringify(property.default), + description: property.description ?? "", + }; + }); +} diff --git a/packages/cli/src/lib/plugins/mcp-client.test.ts b/packages/cli/src/lib/plugins/mcp-client.test.ts new file mode 100644 index 00000000000..d020b306262 --- /dev/null +++ b/packages/cli/src/lib/plugins/mcp-client.test.ts @@ -0,0 +1,67 @@ +import { describe, expect, test } from "bun:test"; +import type { InstalledPlugin } from "./host"; +import { resolveMcpPluginRef } from "./mcp-client"; + +const ORG = "organization-0f9c"; + +function install(name: string, marketplace: string): InstalledPlugin { + return { + name, + marketplace, + version: "1.0.0", + installedAt: "2026-11-24T00:00:00.000Z", + enabled: true, + }; +} + +describe("resolveMcpPluginRef", () => { + test("a bare name takes the marketplace of its one install", () => { + expect( + resolveMcpPluginRef("admin", "0f9c", [ + install("linear", "superset"), + install("admin", ORG), + ]), + ).toEqual({ plugin: "admin", marketplace: ORG }); + }); + + test("a bare name with no install asks the default marketplace", () => { + expect(resolveMcpPluginRef("linear", undefined, [])).toEqual({ + plugin: "linear", + marketplace: "superset", + }); + }); + + test("a bare name installed twice fails with both refs", () => { + expect(() => + resolveMcpPluginRef("linear", undefined, [ + install("linear", "superset"), + install("linear", ORG), + ]), + ).toThrow( + expect.objectContaining({ + suggestion: `Name one: --plugin linear@superset or --plugin linear@${ORG}`, + }), + ); + }); + + test("name@organization is the active organization's marketplace", () => { + expect(resolveMcpPluginRef("admin@organization", "0f9c", [])).toEqual({ + plugin: "admin", + marketplace: ORG, + }); + }); + + test("name@organization with no active organization fails", () => { + expect(() => + resolveMcpPluginRef("admin@organization", undefined, []), + ).toThrow("no organization is active"); + }); + + test("a named marketplace is kept as given", () => { + expect( + resolveMcpPluginRef("linear@acme", undefined, [ + install("linear", "superset"), + ]), + ).toEqual({ plugin: "linear", marketplace: "acme" }); + }); +}); diff --git a/packages/cli/src/lib/plugins/mcp-client.ts b/packages/cli/src/lib/plugins/mcp-client.ts index 2fcaf3f6cd6..591c618a6a4 100644 --- a/packages/cli/src/lib/plugins/mcp-client.ts +++ b/packages/cli/src/lib/plugins/mcp-client.ts @@ -2,18 +2,55 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; import { CLIError } from "@superset/cli-framework"; import { ORGANIZATION_HEADER } from "@superset/shared/constants"; -import { DEFAULT_MARKETPLACE } from "@superset/shared/plugins"; +import { + DEFAULT_MARKETPLACE, + organizationMarketplace, +} from "@superset/shared/plugins"; import { getApiUrl } from "../config"; -import { parsePluginRef as parseRef } from "./host"; +import { + type InstalledPlugin, + parsePluginRef, + readInstalledPlugins, +} from "./host"; export interface PluginRef { plugin: string; marketplace: string; } -export function parsePluginRef(ref: string): PluginRef { - const { name, marketplace } = parseRef(ref); - return { plugin: name, marketplace: marketplace ?? DEFAULT_MARKETPLACE }; +export function resolveMcpPluginRef( + ref: string, + organizationId: string | undefined, + installed: InstalledPlugin[], +): PluginRef { + const { name, marketplace } = parsePluginRef(ref); + if (marketplace === "organization") { + if (!organizationId) { + throw new CLIError( + `"${ref}" names your organization's marketplace, but no organization is active.`, + "Run: paradev organization switch ", + ); + } + return { + plugin: name, + marketplace: organizationMarketplace(organizationId), + }; + } + if (marketplace !== undefined) return { plugin: name, marketplace }; + + const matches = installed.filter( + (entry) => entry.name === name && entry.enabled, + ); + if (matches.length > 1) { + throw new CLIError( + `"${name}" is installed from more than one marketplace.`, + `Name one: ${matches.map((entry) => `--plugin ${name}@${entry.marketplace}`).join(" or ")}`, + ); + } + return { + plugin: name, + marketplace: matches[0]?.marketplace ?? DEFAULT_MARKETPLACE, + }; } export function pluginMcpUrl(ref: PluginRef, connection?: string): URL { @@ -44,7 +81,11 @@ export async function connectPluginMcp( transport: StreamableHTTPClientTransport; ref: PluginRef; }> { - const ref = parsePluginRef(name); + const ref = resolveMcpPluginRef( + name, + auth.organizationId, + readInstalledPlugins(), + ); const client = new Client({ name: "superset-cli", version: "1.0.0" }); const transport = new StreamableHTTPClientTransport( pluginMcpUrl(ref, connection), diff --git a/plugins/superset/skills/integrations/SKILL.md b/plugins/superset/skills/integrations/SKILL.md index ae3703863be..07ab2480c9a 100644 --- a/plugins/superset/skills/integrations/SKILL.md +++ b/plugins/superset/skills/integrations/SKILL.md @@ -30,20 +30,27 @@ is gone: the credential is still live, and the `PLUGIN` column holds the connect to. `CONNECTION` holds the connection id, empty on a row with no connection yet. A plugin with two connected accounts has two rows. -## 2. List the tools before calling one +## 2. List the tools, then read the one you will call ```bash superset mcp tools --plugin linear superset mcp tools --plugin linear | jq -r '.[].tool' # names only; descriptions run long +superset mcp tools create_issue --plugin linear # its arguments and output ``` -Names and descriptions come from the plugin's own server, not from anything in this repo, and -they change between plugin versions. Never call a tool you have not listed. +Names, descriptions and schemas come from the plugin's own server, not from anything in this +repo, and they change between plugin versions. Never call a tool you have not listed. -The listing gives a name and a description, but **no input schema**. The description is where -the plugin documents its arguments, so read the full description of the tool you are about to -call rather than the filtered name list. If the shape is still ambiguous, a wrong call comes -back as a tool error naming the offending field; correct it from there. +Before you call a tool, read it by name. That view lists each argument with its type, whether it +is required, its default and its description, then the fields of the output when the server +declares them. Under `--json` every tool carries `inputSchema` and `outputSchema` as the server +sent them, so `superset mcp tools --plugin linear | jq '.[] | select(.tool=="create_issue")'` +gives the full JSON Schema. + +`--plugin` takes the name from the `PLUGIN` column. A name installed from only one marketplace +needs nothing more, whichever marketplace that is. Use `name@organization` for your +organization's own plugin, and `name@` when the CLI says the name is installed +from more than one. ## 3. Call it @@ -91,6 +98,8 @@ a good triage still applies. Only the transport changes. | `"x" is not connected. Connect an account first.` | Nothing is authorized under that name. Also what an uninstalled plugin looks like. Run `superset plugins connect x`, or install it first. | | `--connection takes a plugin name now, not a connection id.` | You passed a UUID. The handle is the plugin name: `--plugin `. | | `Pass --plugin .` | `superset mcp tools` with no target. | +| `"x" is installed from more than one marketplace.` | Pass one of the `--plugin x@` refs the hint lists. | +| ` has no tool "x".` | The name is not in the listing. Take the hint, or list the tools again. | | `Missing required argument: ` | `call-tool` takes the tool name first; the plugin goes in `--plugin`. | | `Arguments must be JSON: ...` | The second positional is a JSON object, quoted as one shell word. Passing the plugin as a positional lands here. | | 401 or 403 from the tool itself | Read the error before acting. Reconnect only when it names an invalid, revoked, or expired credential. A 403 that names a scope, a permission, or a resource means the connected account lacks that access, and reconnecting the same account changes nothing. | From 2763d87a898a759abb9490dc28d065b123bdbc58 Mon Sep 17 00:00:00 2001 From: Satya Patel <14907857+saddlepaddle@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:17:07 +0000 Subject: [PATCH 3/4] fix(cli): name union types and keep long fields whole in a tool's detail view --- packages/cli/src/commands/mcp/tools/command.test.ts | 2 ++ packages/cli/src/commands/mcp/tools/command.ts | 2 +- packages/cli/src/commands/mcp/tools/schemaFields.ts | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/mcp/tools/command.test.ts b/packages/cli/src/commands/mcp/tools/command.test.ts index 794b9fa3a37..797a9ebb60a 100644 --- a/packages/cli/src/commands/mcp/tools/command.test.ts +++ b/packages/cli/src/commands/mcp/tools/command.test.ts @@ -15,6 +15,7 @@ const createIssue = { title: { type: "string", description: "Issue title" }, labels: { type: "array", items: { type: "string" } }, priority: { enum: [1, 2, 3], default: 2 }, + due: { anyOf: [{ type: "string" }, { type: "null" }] }, }, required: ["title"], }, @@ -93,6 +94,7 @@ test("one tool shows its arguments and output as fields", async () => { expect(text).toMatch(/title\s+string\s+yes\s+Issue title/); expect(text).toMatch(/labels\s+string\[\]/); expect(text).toMatch(/priority\s+1 \| 2 \| 3\s+2/); + expect(text).toMatch(/due\s+string \| null/); expect(text).toMatch(/Output:\nNAME.*\nid\s+string\s+New issue id/); }); diff --git a/packages/cli/src/commands/mcp/tools/command.ts b/packages/cli/src/commands/mcp/tools/command.ts index 6699da1fef0..745869ccb66 100644 --- a/packages/cli/src/commands/mcp/tools/command.ts +++ b/packages/cli/src/commands/mcp/tools/command.ts @@ -27,7 +27,7 @@ function fieldTable(schema: Tool["inputSchema"]): string { fields as unknown as Record[], ["name", "type", "required", "default", "description"], ["NAME", "TYPE", "REQUIRED", "DEFAULT", "DESCRIPTION"], - [30, 24, 8, 16, 80], + [30, 48, 8, 16, 400], ); } diff --git a/packages/cli/src/commands/mcp/tools/schemaFields.ts b/packages/cli/src/commands/mcp/tools/schemaFields.ts index 9178c17c688..c907d9e3c1b 100644 --- a/packages/cli/src/commands/mcp/tools/schemaFields.ts +++ b/packages/cli/src/commands/mcp/tools/schemaFields.ts @@ -2,6 +2,8 @@ interface PropertySchema { type?: string | string[]; enum?: unknown[]; items?: PropertySchema; + anyOf?: PropertySchema[]; + oneOf?: PropertySchema[]; default?: unknown; description?: string; } @@ -16,6 +18,8 @@ export interface SchemaField { function typeLabel(property: PropertySchema): string { if (property.enum) return property.enum.map(String).join(" | "); + const union = property.anyOf ?? property.oneOf; + if (union) return union.map(typeLabel).join(" | "); if (Array.isArray(property.type)) return property.type.join(" | "); if (property.type === "array" && property.items) { return `${typeLabel(property.items)}[]`; From 33b92fdeec6b832cb15b516a3a9da96182c71287 Mon Sep 17 00:00:00 2001 From: Satya Patel <14907857+saddlepaddle@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:17:46 +0000 Subject: [PATCH 4/4] refactor(cli): share the organization marketplace alias between install and mcp --- packages/cli/src/commands/plugins/install/command.ts | 4 +--- packages/cli/src/lib/plugins/host.ts | 3 +++ packages/cli/src/lib/plugins/mcp-client.ts | 3 ++- plugins/superset/skills/integrations/SKILL.md | 5 ++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/commands/plugins/install/command.ts b/packages/cli/src/commands/plugins/install/command.ts index 90a72ac2252..81deb30ce1b 100644 --- a/packages/cli/src/commands/plugins/install/command.ts +++ b/packages/cli/src/commands/plugins/install/command.ts @@ -18,7 +18,7 @@ import { command } from "../../../lib/command"; import { canReachDesktop, openUrl } from "../../../lib/open-url"; import { authorizeUrl, chooseAuthMethod } from "../../../lib/plugins/connect"; import { withPluginHints } from "../../../lib/plugins/errors"; -import { resolvePluginRef } from "../../../lib/plugins/host"; +import { ORGANIZATION, resolvePluginRef } from "../../../lib/plugins/host"; import { type AuthInputSpec, missingInputsError, @@ -32,8 +32,6 @@ type ConnectFirst = | { status: "ready"; connection: string } | { status: "authorize"; url: string }; -const ORGANIZATION = "organization"; - async function organizationPlugin( api: ApiClient, name: string, diff --git a/packages/cli/src/lib/plugins/host.ts b/packages/cli/src/lib/plugins/host.ts index e0477b9d072..31095d50604 100644 --- a/packages/cli/src/lib/plugins/host.ts +++ b/packages/cli/src/lib/plugins/host.ts @@ -23,6 +23,9 @@ export { DEFAULT_MARKETPLACE_REPO, } from "@superset/shared/plugins"; +/** What a user types after `@` to name their organization's marketplace. */ +export const ORGANIZATION = "organization"; + export function parsePluginRef(ref: string): { name: string; marketplace?: string; diff --git a/packages/cli/src/lib/plugins/mcp-client.ts b/packages/cli/src/lib/plugins/mcp-client.ts index 591c618a6a4..637e95af12b 100644 --- a/packages/cli/src/lib/plugins/mcp-client.ts +++ b/packages/cli/src/lib/plugins/mcp-client.ts @@ -9,6 +9,7 @@ import { import { getApiUrl } from "../config"; import { type InstalledPlugin, + ORGANIZATION, parsePluginRef, readInstalledPlugins, } from "./host"; @@ -24,7 +25,7 @@ export function resolveMcpPluginRef( installed: InstalledPlugin[], ): PluginRef { const { name, marketplace } = parsePluginRef(ref); - if (marketplace === "organization") { + if (marketplace === ORGANIZATION) { if (!organizationId) { throw new CLIError( `"${ref}" names your organization's marketplace, but no organization is active.`, diff --git a/plugins/superset/skills/integrations/SKILL.md b/plugins/superset/skills/integrations/SKILL.md index 07ab2480c9a..98e6b4e4088 100644 --- a/plugins/superset/skills/integrations/SKILL.md +++ b/plugins/superset/skills/integrations/SKILL.md @@ -43,9 +43,8 @@ repo, and they change between plugin versions. Never call a tool you have not li Before you call a tool, read it by name. That view lists each argument with its type, whether it is required, its default and its description, then the fields of the output when the server -declares them. Under `--json` every tool carries `inputSchema` and `outputSchema` as the server -sent them, so `superset mcp tools --plugin linear | jq '.[] | select(.tool=="create_issue")'` -gives the full JSON Schema. +declares them. Under `--json` it, and every row of the listing, carries `inputSchema` and +`outputSchema` as the server sent them: the full JSON Schema, nested fields included. `--plugin` takes the name from the `PLUGIN` column. A name installed from only one marketplace needs nothing more, whichever marketplace that is. Use `name@organization` for your