diff --git a/src/mcplocal/src/http/project-mcp-endpoint.ts b/src/mcplocal/src/http/project-mcp-endpoint.ts index 4a38d37..274b6b7 100644 --- a/src/mcplocal/src/http/project-mcp-endpoint.ts +++ b/src/mcplocal/src/http/project-mcp-endpoint.ts @@ -147,10 +147,14 @@ export function registerProjectMcpEndpoint(app: FastifyInstance, mcpdClient: Mcp providerRegistry: effectiveRegistry, }; if (resolvedModel) pluginConfig.modelOverride = resolvedModel; - // Route gate prompt-selection through this project's server Llm (mcpd - // inference proxy) so cloud/server keys stay at the k8s level; the local - // personal-token provider is the fallback. See credential-tiering. - if (mcpdConfig.llmProvider) pluginConfig.llmProvider = mcpdConfig.llmProvider; + // Route gate prompt-selection through a server Llm (mcpd inference proxy) + // so cloud/server keys stay at the k8s level; the local personal-token + // provider is the fallback. See credential-tiering. A dedicated fast + // (no-think) selection Llm can be pinned globally via + // MCPCTL_GATE_SELECTION_LLM — it overrides the project's chat llmProvider so + // selection stays fast while chat keeps its (thinking) model. + const gateSelectionLlm = process.env['MCPCTL_GATE_SELECTION_LLM'] || mcpdConfig.llmProvider; + if (gateSelectionLlm) pluginConfig.llmProvider = gateSelectionLlm; const basePlugin = createDefaultPlugin(pluginConfig); // Optional favourite-index presentation: curated favourite/ + full // all// + a "prefer favourite/" instruction. Composed AFTER