langflow-ai/langflow · error · Error
Failed to delete MCP Server
Error message
Failed to delete MCP Server
What it means
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.
Source
Thrown at src/frontend/src/controllers/API/queries/mcp/use-delete-mcp-server.ts:36
undefined,
DeleteMCPServerType,
DeleteMCPServerResponse
> = (options?) => {
const { mutate, queryClient } = UseRequestProcessor();
async function deleteMCPServer(
payload: MCPServerType,
): Promise<DeleteMCPServerResponse> {
try {
const res = await api.delete(
`${getURL("MCP_SERVERS", undefined, true)}/${payload.name}`,
);
return {
message: res.data?.message || "MCP Server deleted successfully",
};
} catch (error: unknown) {
throw new Error(
extractApiErrorMessage(
error as Parameters<typeof extractApiErrorMessage>[0],
"Failed to delete MCP Server",
),
);
}
}
const mutation: UseMutationResult<
DeleteMCPServerResponse,
any,
MCPServerType
> = mutate(["useDeleteMCPServer"], deleteMCPServer, {
...options,
onSuccess: (data, variables, context) => {
queryClient.refetchQueries({
queryKey: ["useGetMCPServers"],
});View on GitHub (pinned to 976ec789d2)
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.
Defensive patterns
Strategy: validation
Validate before calling
s = await client.get_settings() assert s.host and s.port, "set host/port before running MCP install"
Prevention
- 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.
When it happens
Trigger: POST /{project_id}/install when LANGFLOW host/port settings are empty (env vars unset and no defaults populated), regardless of the request body.
Common situations: 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.
Related errors
- Failed to download files: ${response.statusText}
- Failed to patch MCP Server
- Langflow was not able to connect to the server. Please make
- Multiple files are not allowed
- Restored version contains no flow data
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/4126e46faae19c66.
Report an issue: GitHub.