用于身份验证管理的企业级解决方案,提供安全可靠的身份验证管控,支持多协议认证,还具备实时威胁检测与防护功能,为企业的信息安全保驾护航。
git clone https://github.com/better-auth-mcp-server/better-auth-mcp-server.git
cd better-auth-mcp-server
npm install
npm run build
npm run watch
analyze_project
- 分析项目结构,提供身份验证设置建议。setup_better_auth
- 使用项目 ID 和 API 密钥配置认证提供者。analyze_current_auth
- 检测现有 auth.js/next-auth 实现。generate_migration_plan
- 生成分步迁移计划。test_auth_flows
- 验证登录、注册、重置密码和两步验证流程。test_security
- 执行符合 OWASP 标准的安全检查。analyze_logs
- 查看身份验证系统日志以发现潜在问题。monitor_auth_flows
- 实时监控认证活动。better-auth://config
- 当前 Better-Auth 配置设置。better-auth://logs
- 身份验证系统日志。要自动使用 Smithery 安装 Better Auth MCP Server for Claude Desktop:
npx -y @smithery/cli install @nahmanmate/better-auth-mcp-server --client claude
要在 Claude Desktop 上使用,请添加服务器配置:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"better-auth-mcp-server": {
"type": "better-auth",
"projectID": "your-project-id",
"apiKey": "your-api-key"
}
}
}
# 必填
BETTER_AUTH_PROJECT_ID=your-project-id
BETTER_AUTH_API_KEY=your-api-key
# 可选
BETTER_AUTH_ENV=development|staging|production
LOG_LEVEL=info|debug|error
调试时,请运行以下命令:
npm run debug
更好的调试方法是使用 MCP Inspector,这是一个用于调试和故障排除的工具。
要在新项目中设置 Better Auth,请运行:
better-auth init
然后根据提示完成配置。
要从旧系统迁移身份验证到 Better Auth,请参考文档中的迁移指南。