analyze_current_auth
Detect and analyze existing auth.js/next-auth implementations to assess compatibility, identify configurations, and ensure security integration with Better Auth MCP Server for enhanced credential management.
Instructions
Detect and analyze existing auth.js/next-auth implementation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the project root |
Implementation Reference
- src/index.ts:233-243 (handler)Handler function for the 'analyze_current_auth' tool. Extracts projectPath from arguments, logs the analysis start, and returns a text response indicating completion. Currently a stub implementation.case "analyze_current_auth": { const { projectPath } = request.params.arguments as { projectPath: string }; logger.info(`Analyzing existing auth in ${projectPath}`); // Implementation would detect and analyze current auth setup return { content: [{ type: "text", text: `Auth analysis complete for ${projectPath}` }] }; }
- src/index.ts:99-112 (schema)Tool schema definition registered in ListToolsRequestHandler, including name, description, and input schema requiring 'projectPath'.{ name: "analyze_current_auth", description: "Detect and analyze existing auth.js/next-auth implementation", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project root" } }, required: ["projectPath"] } },
- src/index.ts:56-199 (registration)Registration of all tools including 'analyze_current_auth' in the ListToolsRequestHandler.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ // Installation & Setup Tools { name: "analyze_project", description: "Analyze project structure and dependencies to recommend Better-Auth setup approach", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project root" } }, required: ["projectPath"] } }, { name: "setup_better_auth", description: "Install and configure Better-Auth in the project", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project root" }, config: { type: "object", description: "Better-Auth configuration options", properties: { projectId: { type: "string" }, apiKey: { type: "string" }, environment: { type: "string" } }, required: ["projectId", "apiKey"] } }, required: ["projectPath", "config"] } }, // Migration Tools { name: "analyze_current_auth", description: "Detect and analyze existing auth.js/next-auth implementation", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project root" } }, required: ["projectPath"] } }, { name: "generate_migration_plan", description: "Create step-by-step migration plan from existing auth to Better-Auth", inputSchema: { type: "object", properties: { projectPath: { type: "string", description: "Path to the project root" }, currentAuthType: { type: "string", description: "Current authentication system type", enum: ["auth.js", "next-auth"] } }, required: ["projectPath", "currentAuthType"] } }, // Testing Tools { name: "test_auth_flows", description: "Test authentication workflows", inputSchema: { type: "object", properties: { flows: { type: "array", items: { type: "string", enum: ["login", "register", "password-reset", "2fa"] }, description: "Authentication flows to test" } }, required: ["flows"] } }, { name: "test_security", description: "Run security tests on Better-Auth setup", inputSchema: { type: "object", properties: { tests: { type: "array", items: { type: "string", enum: ["password-policy", "rate-limiting", "session-management"] } } }, required: ["tests"] } }, // Debugging Tools { name: "analyze_logs", description: "Analyze Better-Auth logs for issues", inputSchema: { type: "object", properties: { timeRange: { type: "string", description: "Time range to analyze (e.g. '24h', '7d')" } }, required: ["timeRange"] } }, { name: "monitor_auth_flows", description: "Real-time monitoring of authentication processes", inputSchema: { type: "object", properties: { duration: { type: "string", description: "Monitoring duration (e.g. '1h', '30m')" } }, required: ["duration"] } } ] }; });