Skip to content

Commit 4bb5c19

Browse files
committed
feat: add mcpUI feature flag
1 parent f1d668e commit 4bb5c19

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/common/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const previewFeatureValues = ["search"] as const;
1+
export const previewFeatureValues = ["search", "mcpUI"] as const;
22
export type PreviewFeature = (typeof previewFeatureValues)[number];
33

44
export const similarityValues = ["cosine", "euclidean", "dotProduct"] as const;

src/tools/tool.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ export abstract class ToolBase {
728728
* @returns The result with UIResource appended if conditions are met, otherwise unchanged
729729
*/
730730
private appendUIResourceIfAvailable(result: CallToolResult): CallToolResult {
731+
if (!this.isFeatureEnabled("mcpUI")) {
732+
return result;
733+
}
734+
731735
const uiHtml = this.getUI();
732736
if (!uiHtml || !result.structuredContent) {
733737
return result;

0 commit comments

Comments
 (0)