{"record":{"id":"b4774f464e18545d","repo":"FlowiseAI/Flowise","slug":"missing-github-access-token","errorCode":null,"errorMessage":"Missing Github Access Token","messagePattern":"Missing Github Access Token","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/Github/GithubMCP.ts","lineNumber":116,"sourceCode":"        const accessToken = getCredentialParam('accessToken', credentialData, nodeData)\n        const githubEnterpriseUrl = nodeData.inputs?.githubEnterpriseUrl\n\n        let url = 'https://api.githubcopilot.com/mcp/'\n        if (githubEnterpriseUrl) {\n            // Transform e.g. https://octocorp.ghe.com -> https://copilot-api.octocorp.ghe.com/mcp\n            const trimmed = githubEnterpriseUrl.trim().replace(/\\/+$/, '')\n            try {\n                const parsed = new URL(trimmed)\n                parsed.hostname = `copilot-api.${parsed.hostname}`\n                parsed.pathname = '/mcp'\n                url = parsed.toString().replace(/\\/$/, '')\n            } catch {\n                url = `${trimmed}/mcp`\n            }\n        }\n\n        if (!accessToken) {\n            throw new Error('Missing Github Access Token')\n        }\n\n        const serverParams = {\n            type: 'http',\n            url,\n            headers: {\n                Authorization: `Bearer ${accessToken}`\n            }\n        }\n\n        const toolkit = new MCPToolkit(serverParams, 'http')\n        await toolkit.initialize()\n\n        const tools = toolkit.tools ?? []\n\n        return tools as Tool[]\n    }\n}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/Github/GithubMCP.ts#L98-L134","documentation":"Thrown by GithubMCP.getTools when the bound GitHub credential has no 'accessToken' value. The node needs a valid GitHub access token to call the GitHub Copilot MCP endpoint (https://api.githubcopilot.com/mcp/ or a transformed Enterprise URL) with an Authorization: Bearer header. Without it, the request cannot authenticate and the node refuses to initialize the MCPToolkit.","triggerScenarios":"Calling getTools/init on the Github_MCP node with a credential that omits or blanks the 'accessToken' field (e.g. credential not selected, selected credential deleted, or the credential component never saved a token).","commonSituations":"User creates the node but forgets to attach a credential; credential is attached but the token field is empty; credential was renamed/removed so nodeData.credential resolves to nothing; migration left an old credential object with no accessToken key.","solutions":["Open the Github_MCP node in the editor and confirm a credential is selected in the credential dropdown.","Open that credential and ensure the 'accessToken' field is populated with a GitHub Personal Access Token (or OAuth token) that has the required scopes.","If using a credential that lacks the accessToken field, create a new GitHub credential of the correct type and re-bind it on the node.","Verify the credential is not saved with a blank/whitespace-only token; re-paste and save."],"exampleFix":"// before: nodeData.credential points to a credential with empty accessToken\n// after: bind a credential whose accessToken is set\nconst accessToken = getCredentialParam('accessToken', credentialData, nodeData)\nif (!accessToken) {\n    throw new Error('Missing Github Access Token')\n}\n// ensure the credential record has accessToken populated before selecting it on the node","handlingStrategy":"validation","validationCode":"const credentialData = await getCredentialData(nodeData.credential ?? '', options)\nconst accessToken = getCredentialParam('accessToken', credentialData, nodeData)\nif (!accessToken || !accessToken.trim()) {\n    // surface a user-facing config error before calling the MCP toolkit\n    throw new Error('Bind a GitHub credential with a non-empty accessToken.')\n}","typeGuard":"function hasGithubAccessToken(cred: unknown): cred is { accessToken: string } {\n    return typeof cred === 'object' && cred !== null\n        && typeof (cred as any).accessToken === 'string'\n        && (cred as any).accessToken.trim().length > 0\n}","tryCatchPattern":"try {\n    const tools = await githubMcp.getTools(nodeData, options)\n} catch (e) {\n    if (e instanceof Error && e.message === 'Missing Github Access Token') {\n        // prompt user to bind a credential; do not retry without input change\n    }\n}","preventionTips":["Make the accessToken field required in the credential component so the UI blocks saving without it.","Validate credentials at node-save time rather than at runtime.","Display the bound credential name on the node so missing bindings are visible."],"tags":["github","authentication","mcp","credentials","configuration"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}