Better Auth MCP Server

Better Auth MCP Server

实现企业级身份验证管理,具有安全的凭据处理和多协议身份验证支持,并提供用于分析、设置和测试身份验证系统的工具。

Category
访问服务器

Tools

analyze_project

Analyze project structure and dependencies to recommend Better-Auth setup approach

setup_better_auth

Install and configure Better-Auth in the project

analyze_current_auth

Detect and analyze existing auth.js/next-auth implementation

generate_migration_plan

Create step-by-step migration plan from existing auth to Better-Auth

test_auth_flows

Test authentication workflows

test_security

Run security tests on Better-Auth setup

analyze_logs

Analyze Better-Auth logs for issues

monitor_auth_flows

Real-time monitoring of authentication processes

README

better-auth-mcp-server MCP 服务器

smithery badge

用于身份验证管理的 MCP 服务器

企业级身份验证解决方案,提供:

  • 🔐 使用 AES-256 加密的安全凭证管理
  • ⚙️ 多协议身份验证(OAuth2、SAML、LDAP)
  • 🛡️ 实时威胁检测和预防

<a href="https://glama.ai/mcp/servers/7f1irpro2i"><img width="380" height="200" src="https://glama.ai/mcp/servers/7f1irpro2i/badge" alt="Better Auth Server MCP server" /></a>

功能

核心工具

  • analyze_project - 分析项目结构,获取身份验证设置建议
  • setup_better_auth - 使用项目 ID 和 API 密钥配置身份验证提供程序
  • analyze_current_auth - 检测现有的 auth.js/next-auth 实现
  • generate_migration_plan - 创建逐步迁移路径

测试与安全

  • test_auth_flows - 验证登录/注册/重置/2fa 流程
  • 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=your-project-id
BETTER_AUTH_API_KEY=your-api-key

# 可选
BETTER_AUTH_ENV=development|staging|production
LOG_LEVEL=info|debug|error

安全最佳实践

  1. API 密钥管理

    • 将 API 密钥存储在环境变量中
    • 定期轮换密钥
    • 每个环境使用不同的密钥
  2. 访问控制

    • 实施速率限制
    • 配置 IP 允许列表
    • 使用最小权限原则
  3. 监控

    • 启用审计日志记录
    • 监控身份验证失败
    • 为可疑活动设置警报

安装

通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 Better Auth MCP Server:

npx -y @smithery/cli install @nahmanmate/better-auth-mcp-server --client claude

要与 Claude Desktop 一起使用,请添加服务器配置:

在 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 服务器通过 stdio 进行通信,因此调试可能具有挑战性。 我们建议使用 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']
});

从 Auth.js/NextAuth 迁移

// 分析当前的身份验证实现
await mcp.useTool('analyze_current_auth', {
  projectPath: './my-next-app'
});

// 生成迁移步骤
await mcp.useTool('generate_migration_plan', {
  projectPath: './my-next-app',
  currentAuthType: 'next-auth'
});

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选