用于身份验证管理的企业级解决方案:
<a href="https://glama.ai/mcp/servers/7f1irpro2i"><img width="380" height="200" src="https://gips1.baidu.com/it/u=272520364,2803944438&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Better Auth Server MCP服务器" /></a>
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 - 身份验证系统日志克隆并安装:
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
# 必需
BETTER_AUTH_PROJECT_ID=你的项目ID
BETTER_AUTH_API_KEY=你的API密钥
# 可选
BETTER_AUTH_ENV=development|staging|production
LOG_LEVEL=info|debug|error
API密钥管理
访问控制
监控
要通过Smithery自动安装Better Auth MCP服务器到Claude桌面:
npx -y @smithery/cli install @nahmanmate/better-auth-mcp-server --client claude
要在Claude桌面中使用,请添加服务器配置:
在MacOS上:~/Library/Application Support/Claude/claude_desktop_config.json
在Windows上:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"better-auth-mcp-server": {
"command": "node",
"args": ["/path/to/better-auth-mcp-server/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}
由于MCP服务器通过标准I/O通信,调试可能会有挑战。我们建议使用MCP Inspector,它作为包脚本提供:
npm run inspector
Inspector将提供一个URL,以便在浏览器中访问调试工具。
// 在项目中初始化Better-Auth
await mcp.useTool('setup_better_auth', {
projectPath: './my-next-app',
config: {
projectId: process.env.BETTER_AUTH_PROJECT_ID,
apiKey: process.env.BETTER_AUTH_API_KEY
}
});
// 测试核心身份验证流程
await mcp.useTool('test_auth_flows', {
flows: ['login', 'register', '2fa']
});
// 分析当前的身份验证实现
await mcp.useTool('analyze_current_auth', {
projectPath: './my-next-app'
});
// 生成迁移步骤
await mcp.useTool('generate_migration_plan', {
projectPath: './my-next-app',
currentAuthType: 'next-auth'
});