Skip to content

Commit 63b8d7f

Browse files
authored
Merge pull request #79 from evalstate/feat/gradio-config
gradio=none option
2 parents 3a473fa + 78fbb4c commit 63b8d7f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/app/src/server/mcp-proxy.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function parseGradioEndpoints(gradioParam: string): SpaceTool[] {
8585
for (const entry of entries) {
8686
// Validate exactly one slash
8787
const slashCount = (entry.match(/\//g) || []).length;
88-
if (slashCount !== 1) {
88+
if (slashCount !== 1 && 'none' != entry) {
8989
logger.warn(`Skipping invalid gradio entry "${entry}": must contain exactly one slash`);
9090
continue;
9191
}
@@ -152,6 +152,12 @@ export const createProxyServerFactory = (
152152
return result;
153153
}
154154

155+
// Skip Gradio endpoints if explicitly disabled
156+
if (gradio === 'none') {
157+
logger.debug('Gradio endpoints explicitly disabled via gradio="none"');
158+
return result;
159+
}
160+
155161
// Now we have access to userDetails if needed
156162
if (userDetails) {
157163
logger.debug(`Proxy has access to user details for: ${userDetails.name}`);

0 commit comments

Comments
 (0)