diff --git a/packages/app/src/server/mcp-proxy.ts b/packages/app/src/server/mcp-proxy.ts index 1fea510..a6846e6 100644 --- a/packages/app/src/server/mcp-proxy.ts +++ b/packages/app/src/server/mcp-proxy.ts @@ -85,7 +85,7 @@ function parseGradioEndpoints(gradioParam: string): SpaceTool[] { for (const entry of entries) { // Validate exactly one slash const slashCount = (entry.match(/\//g) || []).length; - if (slashCount !== 1) { + if (slashCount !== 1 && 'none' != entry) { logger.warn(`Skipping invalid gradio entry "${entry}": must contain exactly one slash`); continue; } @@ -152,6 +152,12 @@ export const createProxyServerFactory = ( return result; } + // Skip Gradio endpoints if explicitly disabled + if (gradio === 'none') { + logger.debug('Gradio endpoints explicitly disabled via gradio="none"'); + return result; + } + // Now we have access to userDetails if needed if (userDetails) { logger.debug(`Proxy has access to user details for: ${userDetails.name}`);