{"record":{"id":"8efbe4dea7fe233c","repo":"FlowiseAI/Flowise","slug":"mcp-server-is-required","errorCode":null,"errorMessage":"MCP Server is required","messagePattern":"MCP Server is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/CustomMcpServerTool/CustomMcpServerTool.ts","lineNumber":121,"sourceCode":"        const tools = await this.getTools(nodeData, options)\n\n        const _mcpActions = nodeData.inputs?.mcpActions\n        let mcpActions: string[] = []\n        if (_mcpActions) {\n            try {\n                mcpActions = typeof _mcpActions === 'string' ? JSON.parse(_mcpActions) : _mcpActions\n            } catch (error) {\n                console.error('Error parsing mcp actions:', error)\n            }\n        }\n\n        return tools.filter((tool: any) => mcpActions.includes(tool.name))\n    }\n\n    async getTools(nodeData: INodeData, options: ICommonObject): Promise<Tool[]> {\n        const serverId = nodeData.inputs?.mcpServerId as string\n        if (!serverId) {\n            throw new Error('MCP Server is required')\n        }\n\n        const appDataSource = options.appDataSource as DataSource\n        const databaseEntities = options.databaseEntities as IDatabaseEntity\n        if (!appDataSource || !databaseEntities?.['CustomMcpServer']) {\n            throw new Error('Database not available')\n        }\n\n        const workspaceId =\n            (options.workspaceId as string | undefined) ??\n            ((options.searchOptions as ICommonObject | undefined)?.workspaceId as string | undefined)\n        if (!workspaceId) {\n            throw new Error('Workspace context is required to load MCP server')\n        }\n\n        const serverRecord = await appDataSource.getRepository(databaseEntities['CustomMcpServer']).findOneBy({ id: serverId, workspaceId })\n        if (!serverRecord) {\n            throw new Error(`MCP server ${serverId} not found`)","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/CustomMcpServerTool/CustomMcpServerTool.ts#L103-L139","documentation":"Thrown by CustomMcpServerTool.getTools when nodeData.inputs.mcpServerId is falsy. Unlike CustomMCP (inline config), this node references a managed server record by ID from the CustomMcpServer DB table. The serverId is set when a user picks a configured server in the node dropdown; an empty value means no server was selected.","triggerScenarios":"The MCP Server dropdown on the node has no selection; the serverId input is cleared; the flow references a serverId from a variable that resolves empty; the node was duplicated without re-selecting a server.","commonSituations":"First-time node configuration before selecting a server; a deleted server leaving the node pointing at nothing; programmatic flow building without setting mcpServerId.","solutions":["Open the node and select a server from the MCP Server dropdown.","If the expected server is missing, create/authorize it first on the Tools page (see error 399).","If wiring mcpServerId from a variable, ensure it resolves to a non-empty UUID.","After deleting a server, update or remove any node that referenced it."],"exampleFix":"// before\nnodeData.inputs = { mcpServerId: '' }\n// after\nnodeData.inputs = { mcpServerId: '<server-uuid-from-tools-page>' }","handlingStrategy":"validation","validationCode":"function assertServerId(id: unknown): asserts id is string {\n  if (typeof id !== 'string' || !id.trim()) throw new Error('Select a managed MCP server on the node (mcpServerId is empty)')\n}","typeGuard":"function isServerId(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Select a server in the node's MCP Server dropdown before running.","Create/authorize the server on the Tools page first if none exists.","Re-select the server after it's recreated or its id changes.","Don't leave mcpServerId bound to an empty upstream variable."],"tags":["mcp","custom-mcp-server","config","validation","required-field"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}