Consent issue when using mcp & better auth

Hey, I have an issue when trying to authenticate from MCP client. After successful login, I am redirected to the callback page with content:
{"code":"NO_CONSENT_PAGE_PROVIDED","message":"No consent page provided"}

User is authenticated after it, so when I try again to connect from MCP client, then it will work. The problem is only in situations when the user is not yet authenticated.

My stack:
"better-auth": "1.3.34"
"@convex-dev/better-auth": "^0.9.7"
"@tanstack/react-start": "^1.132.0",

My betterAuth configuration:

betterAuth({
        logger: {
            disabled: optionsOnly,
        },
        baseURL: siteUrl,
        database: authComponent.adapter(ctx),
        socialProviders: {
            github: {
                clientId: process.env.GITHUB_CLIENT_ID as string,
                clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
            },
        },
        plugins: [
            mcp({
                loginPage: "/login",
                oidcConfig: {
                    loginPage: `/login`,
                    consentPage: "/consent",
                                }
            }),
            convex(),
        ],
    })
Was this page helpful?