Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/app/src/server/transport/base-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { whoAmI, HubApiError, type WhoAmI } from '@huggingface/hub';
import { extractAuthBouquetAndMix } from '../utils/auth-utils.js';
import { getMetricsSafeName } from '../utils/gradio-metrics.js';
import { isGradioTool } from '../utils/gradio-utils.js';
import { GRADIO_FILES_TOOL_CONFIG } from '@llmindset/hf-mcp';

/**
* Result returned by ServerFactory containing the server instance and optional user details
Expand Down Expand Up @@ -269,6 +270,13 @@ export abstract class BaseTransport {

// For tools/call, check if it's a Gradio tool using the dedicated method
if (methodName === 'tools/call') {
const toolName = body?.params?.name;

// Special case: gradio_files needs Gradio setup (for registration) but not streaming
if (toolName === GRADIO_FILES_TOOL_CONFIG.name) {
return false; // Don't skip Gradio setup
}

// Return true (skip) for non-Gradio tools, false (don't skip) for Gradio tools
return !this.isGradioToolCall(requestBody);
}
Expand Down