analyze_current_auth
Detect and analyze existing auth.js/next-auth implementation
Assistant-side tooling for an authentication migration — read what auth a project has now, plan the move, then exercise the login, register, reset and 2FA flows.
LABSCO SUMMARY
Analysing the existing auth.js or next-auth setup and producing a plan from it is the part that is hard to do by hand and easy to get wrong halfway through. The testing tools matter for the same reason: after a migration the failure mode is a flow that still works for the happy path and silently broke password reset or 2FA, and those are exactly the flows this exercises.
An MCP server aimed at projects moving onto Better-Auth. It reads a project's structure and its existing auth.js or next-auth implementation, produces a step-by-step migration plan, configures providers, and then tests the resulting flows and checks them against OWASP-aligned rules.
analyze_project, analyze_current_authgenerate_migration_plansetup_better_authtest_auth_flows, test_securityanalyze_logs, monitor_auth_flowsbetter-auth://config and the logs at better-auth://logsA Better-Auth project id and API key, supplied as BETTER_AUTH_PROJECT_ID and BETTER_AUTH_API_KEY. BETTER_AUTH_ENV selects development, staging or production and LOG_LEVEL sets verbosity; both are optional. The npm package name is better-auth-mcp-server (0.1.0) and it is marked private, so install from a clone with npm install and npm run build. Use a different API key per environment, since the same key reaches whatever that environment's auth configuration is.
Build from source — git clone https://github.com/jamesjohnsdev/better-auth-mcp-server.git
USE CASES
Point it at the project and get back the existing auth.js or next-auth implementation it found, before deciding whether to change anything.
Generate a step-by-step migration path from the current auth type, then configure the new providers against your project id.
Exercise login, register, password reset and 2FA together, so the flows that only break for a subset of users get caught in the same pass.
Review the auth logs for the pattern behind the failures and watch authentication activity while you reproduce it.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
analyze_current_authDetect and analyze existing auth.js/next-auth implementation
analyze_logsAnalyze Better-Auth logs for issues
analyze_projectAnalyze project structure and dependencies to recommend Better-Auth setup approach
generate_migration_planCreate step-by-step migration plan from existing auth to Better-Auth
monitor_auth_flowsReal-time monitoring of authentication processes
setup_better_authInstall and configure Better-Auth in the project
test_auth_flowsTest authentication workflows
test_securityRun security tests on Better-Auth setup
BEFORE YOU INSTALL
8 tools when we connected.
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 8 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
git clone https://github.com/jamesjohnsdev/better-auth-mcp-server.git
cd better-auth-mcp-server
npm install
npm run build{
"mcpServers": {
"better-auth-mcp-server": {
"command": "node",
"args": [
"<YOUR_PATH_TO_BETTER_AUTH_MCP_SERVER>/build/index.js"
],
"env": {
"BETTER_AUTH_PROJECT_ID": "<YOUR_BETTER_AUTH_PROJECT_ID>",
"BETTER_AUTH_API_KEY": "<YOUR_BETTER_AUTH_API_KEY>"
},
"disabled": false,
"alwaysAllow": []
}
}
}<YOUR_PATH_TO_BETTER_AUTH_MCP_SERVER> is the full path of your clone (build/index.js appears after npm run build). BETTER_AUTH_ENV (development, staging or production) and LOG_LEVEL are optional.
The server needs BETTER_AUTH_PROJECT_ID and BETTER_AUTH_API_KEY; the Local build block passes them in its env section.