{"record":{"id":"4126e46faae19c66","repo":"langflow-ai/langflow","slug":"failed-to-delete-mcp-server","errorCode":null,"errorMessage":"Failed to delete MCP Server","messagePattern":"Failed to delete MCP Server","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/frontend/src/controllers/API/queries/mcp/use-delete-mcp-server.ts","lineNumber":36,"sourceCode":"  undefined,\n  DeleteMCPServerType,\n  DeleteMCPServerResponse\n> = (options?) => {\n  const { mutate, queryClient } = UseRequestProcessor();\n\n  async function deleteMCPServer(\n    payload: MCPServerType,\n  ): Promise<DeleteMCPServerResponse> {\n    try {\n      const res = await api.delete(\n        `${getURL(\"MCP_SERVERS\", undefined, true)}/${payload.name}`,\n      );\n\n      return {\n        message: res.data?.message || \"MCP Server deleted successfully\",\n      };\n    } catch (error: unknown) {\n      throw new Error(\n        extractApiErrorMessage(\n          error as Parameters<typeof extractApiErrorMessage>[0],\n          \"Failed to delete MCP Server\",\n        ),\n      );\n    }\n  }\n\n  const mutation: UseMutationResult<\n    DeleteMCPServerResponse,\n    any,\n    MCPServerType\n  > = mutate([\"useDeleteMCPServer\"], deleteMCPServer, {\n    ...options,\n    onSuccess: (data, variables, context) => {\n      queryClient.refetchQueries({\n        queryKey: [\"useGetMCPServers\"],\n      });","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/controllers/API/queries/mcp/use-delete-mcp-server.ts#L18-L54","documentation":"500 from the install endpoint when settings.host or settings.port is falsy. The endpoint must build SSE/StreamableHTTP URLs to embed in the client's MCP config, and without a host/port it cannot. This is a server configuration gap, not a request problem.","triggerScenarios":"POST /{project_id}/install when LANGFLOW host/port settings are empty (env vars unset and no defaults populated), regardless of the request body.","commonSituations":"Fresh deployments where the config was started with a bare 'langflow run' and host/port were never materialized into settings; overriding settings with empty strings via env.","solutions":["Set host and port in settings (e.g. LANGFLOW_HOST=127.0.0.1, LANGFLOW_PORT=7860) and restart.","Verify via the settings endpoint that host/port are now populated before retrying install.","If using a public hostname, set host to the externally reachable address so generated MCP URLs work."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"s = await client.get_settings()\nassert s.host and s.port, \"set host/port before running MCP install\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set host/port explicitly in deployment env files, not just bind addresses.","Add a startup smoke-check that host/port settings are populated before advertising MCP features."],"tags":["mcp","install","configuration","http-500"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}