Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: keep SSE MCP servers as SSE when importing a data recipe (#13659)

Nilay2a03c22812f4
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/helpers.ts b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/helpers.ts
index e3965a23f0e..b179b61e91e 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/helpers.ts
+++ b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/helpers.ts
@@ -61,7 +61,7 @@ export function toApiProvider(
}
return {
// biome-ignore lint/style/useNamingConvention: api schema
- provider_type: "streamable_http",
+ provider_type: provider.provider_type,
name: provider.name.trim(),
endpoint: provider.endpoint?.trim() ?? "",
// biome-ignore lint/style/useNamingConvention: api schema
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
index 14ad4648f86..d4ad03108e5 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
@@ -110,7 +110,11 @@ function McpServerCard({
: [{ key: "", value: "" }];
const summaryTitle = provider.name.trim() || `Tool server ${index + 1}`;
const transportLabel =
- provider.provider_type === "stdio" ? "Local command" : "HTTP";
+ provider.provider_type === "stdio"
+ ? "Local command"
+ : provider.provider_type === "sse"
+ ? "SSE"
+ : "HTTP";
const toolsLabel = typeof toolsCount === "number" ? `${toolsCount} tools` : null;
const description =
provider.provider_type === "stdio"
@@ -183,13 +187,17 @@ function McpServerCard({
onValueChange={(value) =>
onUpdateProviderAt(index, {
// biome-ignore lint/style/useNamingConvention: ui schema
- provider_type: value === "stdio" ? "stdio" : "streamable_http",
+ provider_type:
+ value === "stdio" || value === "sse"
+ ? value
+ : "streamable_http",
})
}
>
<TabsList className="w-full">
<TabsTrigger value="stdio">Local command</TabsTrigger>
<TabsTrigger value="streamable_http">HTTP endpoint</TabsTrigger>
+ <TabsTrigger value="sse">SSE endpoint</TabsTrigger>
</TabsList>
</Tabs>
diff --git a/studio/frontend/src/features/recipe-studio/types/index.ts b/studio/frontend/src/features/recipe-studio/types/index.ts
index 4035dcff02b..994f14bf200 100644
--- a/studio/frontend/src/features/recipe-studio/types/index.ts
+++ b/studio/frontend/src/features/recipe-studio/types/index.ts
@@ -155,7 +155,7 @@ export type Score = {
options: ScoreOption[];
};
-export type McpProviderType = "stdio" | "streamable_http";
+export type McpProviderType = "stdio" | "sse" | "streamable_http";
export type McpEnvVar = {
key: string;
diff --git a/studio/frontend/src/features/recipe-studio/utils/import/importer.ts b/studio/frontend/src/features/recipe-studio/utils/import/importer.ts
index abf7171ba8e..dd564ed8703 100644
--- a/studio/frontend/src/features/recipe-studio/utils/import/importer.ts
+++ b/studio/frontend/src/features/recipe-studio/utils/import/importer.ts
@@ -151,7 +151,9 @@ function parseMcpProviders(input: unknown): Map<string, LlmMcpProviderConfig> {
}
const providerTypeRaw = readString(item.provider_type);
const providerType =
- providerTypeRaw === "stdio" ? "stdio" : "streamable_http";
+ providerTypeRaw === "stdio" || providerTypeRaw === "sse"
+ ? providerTypeRaw
+ : "streamable_http";
const args = Array.isArray(item.args)
? item.args.map((value) => String(value))
: [];
diff --git a/studio/frontend/src/features/recipe-studio/utils/payload/builders-llm.ts b/studio/frontend/src/features/recipe-studio/utils/payload/builders-llm.ts
index daede8cae2b..9e15f85fe2f 100644
--- a/studio/frontend/src/features/recipe-studio/utils/payload/builders-llm.ts
+++ b/studio/frontend/src/features/recipe-studio/utils/payload/builders-llm.ts
@@ -157,7 +157,7 @@ export function buildLlmMcpProvider(
}
return {
// biome-ignore lint/style/useNamingConvention: api schema
- provider_type: "streamable_http",
+ provider_type: provider.provider_type,
name,
endpoint,
// biome-ignore lint/style/useNamingConvention: api schema
diff --git a/studio/frontend/tests/recipe-mcp-provider-transport.test.ts b/studio/frontend/tests/recipe-mcp-provider-transport.test.ts
new file mode 100644
index 00000000000..0a0994368cd
--- /dev/null
+++ b/studio/frontend/tests/recipe-mcp-provider-transport.test.ts
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { registerBundlerResolver } from "./helpers/kit.ts";
+
+registerBundlerResolver();
+
+const { importRecipePayload } = await import(
+ "../src/features/recipe-studio/utils/import/importer.ts"
+);
+const { buildRecipePayload } = await import(
+ "../src/features/recipe-studio/utils/payload/build-payload.ts"
+);
+const { toApiProvider } = await import(
+ "../src/features/recipe-studio/dialogs/tool-profile/helpers.ts"
+);
+
+function rebuiltProviderTypes(providerType: string): unknown[] {
+ const recipe = {
+ recipe: {
+ model_providers: [
+ {
+ name: "local",
+ endpoint: "http://localhost:8000/v1",
+ provider_type: "openai",
+ },
+ ],
+ model_configs: [{ alias: "writer", model: "m", provider: "local" }],
+ mcp_providers: [
+ {
+ name: "docs",
+ provider_type: providerType,
+ endpoint: "http://localhost:8931/sse",
+ },
+ ],
+ tool_configs: [{ tool_alias: "docs-tools", providers: ["docs"] }],
+ columns: [
+ {
+ column_type: "llm-text",
+ name: "answer",
+ model_alias: "writer",
+ prompt: "Answer a question.",
+ tool_alias: "docs-tools",
+ },
+ ],
+ },
+ };
+ const imported = importRecipePayload(JSON.stringify(recipe));
+ assert.deepEqual(imported.errors, []);
+ assert.ok(imported.snapshot);
+ const {
+ configs,
+ nodes,
+ edges,
+ processors,
+ layoutDirection,
+ auxNodePositions,
+ } = imported.snapshot;
+ const built = buildRecipePayload(
+ configs,
+ nodes,
+ edges,
+ processors,
+ layoutDirection,
+ auxNodePositions,
+ );
+ const providers = built.payload.recipe.mcp_providers as Record<
+ string,
+ unknown
+ >[];
+ assert.equal(providers.length, 1);
+ const toolConfig = Object.values(configs).find(
+ (config) => config.kind === "tool_config",
+ );
+ assert.ok(toolConfig?.kind === "tool_config");
+ return [
+ providers[0].provider_type,
+ toApiProvider(toolConfig.mcp_providers[0]).provider_type,
+ ];
+}
+
+test("an imported MCP provider keeps its transport in the run payload and tool list", () => {
+ for (const providerType of ["sse", "streamable_http"]) {
+ assert.deepEqual(rebuiltProviderTypes(providerType), [
+ providerType,
+ providerType,
+ ]);
+ }
+});