{"record":{"id":"4b2762e86332ff0e","repo":"FlowiseAI/Flowise","slug":"missing-slack-credentials-provide-either-an-oauth","errorCode":null,"errorMessage":"Missing Slack credentials. Provide either an OAuth2 access token or a Bot Token with Team ID.","messagePattern":"Missing Slack credentials\\. Provide either an OAuth2 access token or a Bot Token with Team ID\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/Slack/SlackMCP.ts","lineNumber":127,"sourceCode":"                    }\n                },\n                'http'\n            )\n        } else if (botToken && teamId) {\n            const packagePath = getNodeModulesPackagePath('@modelcontextprotocol/server-slack/dist/index.js')\n\n            const serverParams = {\n                command: 'node',\n                args: [packagePath],\n                env: {\n                    SLACK_BOT_TOKEN: botToken,\n                    SLACK_TEAM_ID: teamId\n                }\n            }\n\n            toolkit = new MCPToolkit(serverParams, 'stdio')\n        } else {\n            throw new Error('Missing Slack credentials. Provide either an OAuth2 access token or a Bot Token with Team ID.')\n        }\n\n        await toolkit.initialize()\n\n        const tools = toolkit.tools ?? []\n\n        return tools as Tool[]\n    }\n}\n\nmodule.exports = { nodeClass: Slack_MCP }\n","sourceCodeStart":109,"sourceCodeEnd":139,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/Slack/SlackMCP.ts#L109-L139","documentation":"Thrown by SlackMCP.getTools when neither credential path is satisfied: there is no OAuth2 access_token AND there is no (botToken + teamId) pair. The node supports either an OAuth2 token (HTTP transport to mcp.slack.com/mcp) or a Bot Token + Team ID (stdio transport via @modelcontextprotocol/server-slack), and at least one complete set is required.","triggerScenarios":"Calling getTools with a Slack credential that has no access_token, or has a botToken but no teamId (or vice versa), or a completely empty credential.","commonSituations":"User intended OAuth2 but only entered a bot token; entered bot token but forgot Team ID; credential created but no fields filled; mixed fields from two auth methods incompletely.","solutions":["Choose one auth method: OAuth2 (provide access_token) OR Bot Token (provide BOTH botToken and teamId).","For Bot Token mode, obtain the Team ID (T-prefixed ID) from Slack and fill both botToken and teamId.","For OAuth2, ensure access_token is present (the code also accepts the 'accessToken' alias and refreshes it).","Re-bind the corrected credential and retry."],"exampleFix":"// OAuth2 path (HTTP):\n//   credential.access_token = 'xoxb-...'\n// Bot Token path (stdio):\n//   credential.botToken = 'xoxb-...'\n//   credential.teamId   = 'T12345'","handlingStrategy":"validation","validationCode":"const credentialData = await getCredentialData(nodeData.credential ?? '', options)\nconst accessToken = getCredentialParam('access_token', credentialData, nodeData) || getCredentialParam('accessToken', credentialData, nodeData)\nconst botToken = getCredentialParam('botToken', credentialData, nodeData)\nconst teamId = getCredentialParam('teamId', credentialData, nodeData)\nconst ok = !!accessToken || (!!botToken && !!teamId)\nif (!ok) throw new Error('Missing Slack credentials')","typeGuard":"type SlackCred = { access_token?: string; botToken?: string; teamId?: string }\nfunction hasCompleteSlackCred(c: SlackCred): boolean {\n    return (!!c.access_token && c.access_token.trim().length > 0)\n        || (!!c.botToken && c.botToken.trim().length > 0 && !!c.teamId && c.teamId.trim().length > 0)\n}","tryCatchPattern":"try { await slackMcp.getTools(nodeData, options) }\ncatch (e) { if (e instanceof Error && e.message.startsWith('Missing Slack credentials')) { /* guide user to OAuth2 OR botToken+teamId */ } }","preventionTips":["Validate the credential at save time so partial entries cannot be stored.","Document the two supported auth modes clearly on the credential component.","Make teamId required when botToken is present (conditional required-field validation)."],"tags":["slack","authentication","mcp","credentials","configuration"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}