{"record":{"id":"ad4147b9f7441329","repo":"FlowiseAI/Flowise","slug":"missing-credentials-provide-bearer-token-from-flo","errorCode":null,"errorMessage":"Missing credentials: provide Bearer token from flow/credentials OR username/password from credentials","messagePattern":"Missing credentials: provide Bearer token from flow/credentials OR username/password from credentials","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/Teradata/TeradataMCP.ts","lineNumber":122,"sourceCode":"        if (!mcpUrl) {\n            throw new Error('Missing MCP Server URL')\n        }\n        // Determine auth method from credentials\n        let serverParams: any = {\n            url: mcpUrl,\n            headers: {}\n        }\n        // Get Bearer token from node input (from agent flow) or credential store\n        const bearerToken = nodeData.inputs?.bearerToken || getCredentialParam('token', credentialData, nodeData)\n        const username = getCredentialParam('tdUsername', credentialData, nodeData)\n        const password = getCredentialParam('tdPassword', credentialData, nodeData)\n\n        if (bearerToken) {\n            serverParams.headers['Authorization'] = `Bearer ${bearerToken}`\n        } else if (username && password) {\n            serverParams.headers['Authorization'] = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64')\n        } else {\n            throw new Error('Missing credentials: provide Bearer token from flow/credentials OR username/password from credentials')\n        }\n        const workspaceId = options?.searchOptions?.workspaceId?._value || options?.workspaceId || 'tdws_default'\n        let sandbox: ICommonObject = {}\n        const cacheKey = hash({ workspaceId, serverParams, sandbox })\n        if (options.cachePool) {\n            const cachedResult = await options.cachePool.getMCPCache(cacheKey)\n            if (cachedResult) {\n                if (cachedResult.tools.length > 0) {\n                    return cachedResult.tools\n                }\n            }\n        }\n\n        // Use SSE for remote HTTP MCP servers\n        const toolkit = new MCPToolkit(serverParams, 'sse')\n        await toolkit.initialize()\n        const tools = toolkit.tools ?? []\n        if (options.cachePool) {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/Teradata/TeradataMCP.ts#L104-L140","documentation":"Thrown by the Teradata MCP node when none of the three credential sources resolves. The node first looks for a bearerToken on nodeData.inputs.bearerToken, then getCredentialParam('token'), then falls back to username (tdUsername) + password (tdPassword) from the credential store. If all are falsy it cannot build an Authorization header for the Teradata MCP server, so it aborts before constructing the MCPToolkit.","triggerScenarios":"Teradata_MCP.getTools runs with: nodeData.inputs.bearerToken empty AND credential has no 'token' field AND (credential missing tdUsername OR missing tdPassword). Also fires when the credential id in nodeData.credential does not resolve (getCredentialData returns empty) so every getCredentialParam returns undefined.","commonSituations":"Wrong credential type attached to the node (e.g. a generic API key cred instead of the Teradata cred); credential saved without the token/username/password fields; bearerToken input not wired from an upstream agent flow node; credential deleted but node still references it.","solutions":["Open the Teradata MCP node and attach a credential of the correct type containing either a token field or tdUsername+tdPassword fields.","If using agent-flow auth, wire an upstream node's output into the node's bearerToken input so nodeData.inputs.bearerToken is non-empty.","Verify the credential id in nodeData.credential still exists in the credential store and was saved with the expected field names.","Re-save the credential after correcting the field names to exactly 'token', 'tdUsername', 'tdPassword'."],"exampleFix":"// before: no auth wired\nconst bearerToken = nodeData.inputs?.bearerToken || getCredentialParam('token', credentialData, nodeData) // both undefined\n\n// after: attach credential with token, or wire flow input\n// In Flowise UI: set node credential to a Teradata credential containing { token: '...' }\n// or map an upstream node output to the bearerToken input.","handlingStrategy":"validation","validationCode":"const hasBearer = !!(nodeData.inputs?.bearerToken || getCredentialParam('token', credentialData, nodeData))\nconst hasBasic = !!(getCredentialParam('tdUsername', credentialData, nodeData) && getCredentialParam('tdPassword', credentialData, nodeData))\nif (!hasBearer && !hasBasic) {\n  throw new Error('Attach a Teradata credential with token, or tdUsername+tdPassword, or wire bearerToken from flow')\n}","typeGuard":"const hasTeradataAuth = (cred: Record<string, any> | undefined, inputs: any): boolean =>\n  !!(inputs?.bearerToken || cred?.token || (cred?.tdUsername && cred?.tdPassword))","tryCatchPattern":"try {\n  const tools = await teradataNode.getTools(nodeData, options)\n} catch (e) {\n  if (e.message.startsWith('Missing credentials')) {\n    // prompt user to attach/wire credentials before retrying\n  }\n  throw e\n}","preventionTips":["Make the bearerToken input required in the UI when no credential is attached.","Standardize on one Teradata credential type and document its exact field names.","In tests, assert getCredentialData returns the expected keys before invoking getTools."],"tags":["mcp","teradata","credentials","authentication"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}