new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

mcp/session

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

withMcpAuth helper function for session handling

The withMcpAuth helper function gets the session and handles unauthenticated calls automatically. It takes the auth instance and a callback function that receives req and session parameters. The session contains the access token record with scopes and user ID. This approach requires the Better Auth instance to be in the same process as the MCP server.

auth.api.getMcpSession method for session retrieval

The auth.api.getMcpSession method retrieves the session using the access token sent from the MCP client. It accepts an object with a headers property containing the request headers. If session is null, a 401 response must be returned. The session contains the access token record with scopes and user ID.

Give your agent this brain