Better Auth MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Implements OWASP-aligned security checks through the test_security tool to validate authentication flows against security standards.

better-auth-mcp-server MCP 서버

인증 관리를 위한 MCP 서버

엔터프라이즈급 인증 솔루션 제공:

  • 🔐 AES-256 암호화를 통한 안전한 자격 증명 관리
  • ⚙️ 다중 프로토콜 인증(OAuth2, SAML, LDAP)
  • 🛡️ 실시간 위협 탐지 및 예방

특징

핵심 도구

  • 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 - 인증 시스템 로그

개발

복제하고 설치하세요:

지엑스피1

서버를 빌드하세요:

npm run build

자동 재빌드를 사용한 개발의 경우:

npm run watch

구성

환경 변수

# Required BETTER_AUTH_PROJECT_ID=your-project-id BETTER_AUTH_API_KEY=your-api-key # Optional 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

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

사용 예

프로젝트 설정

// Initialize Better-Auth in your project 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 } }); // Test core authentication flows await mcp.useTool('test_auth_flows', { flows: ['login', 'register', '2fa'] });

Auth.js/NextAuth에서 마이그레이션

// Analyze current auth implementation await mcp.useTool('analyze_current_auth', { projectPath: './my-next-app' }); // Generate migration steps await mcp.useTool('generate_migration_plan', { projectPath: './my-next-app', currentAuthType: 'next-auth' });

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

보안 자격 증명 처리 및 다중 프로토콜 인증 지원을 통해 엔터프라이즈급 인증 관리가 가능하며, 인증 시스템을 분석, 설정 및 테스트하기 위한 도구도 완비되어 있습니다.

  1. Features
    1. Core Tools
    2. Testing & Security
    3. Available Resources
  2. Development
    1. Configuration
      1. Environment Variables
      2. Security Best Practices
    2. Installation
      1. Installing via Smithery
      2. Debugging
    3. Usage Examples
      1. Project Setup
      2. Migration from Auth.js/NextAuth
    ID: 7f1irpro2i