Get the FREE Ultimate OpenClaw Setup Guide →

better-auth

MCP server from dabhivijay2478/better-auth-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dabhivijay2478-better-auth-mcp-server node path/to/dist/index.js \
  --env NODE_ENV="production"

How to use

The Better Auth MCP Server exposes a modern, MCP-compliant interface for configuring and exploring authentication providers, database adapters, and plugins used by the Better Auth framework. With this server, you can generate complete auth configurations, fetch provider and plugin details, browse integration guides, and view usage examples tailored to your framework (e.g., Next.js, Nuxt, Remix, SvelteKit). Core tools include list_better_auth_features to surface available features, get_feature_details for deep dives into a specific provider or plugin, search_better_auth to quickly locate relevant docs, and get_auth_examples for practical code snippets. This combination makes it easy to scaffold secure, production-ready auth setups and keep documentation synchronized with available capabilities.

To use these capabilities, run the MCP server (as configured in mcp_config) and invoke the tooling endpoints or handlers provided by the server. Typical workflows involve generating a complete auth config for your stack (providers, adapter, plugins), retrieving a provider-specific setup flow, or pulling framework-specific integration steps to implement in your frontend or backend. The server is designed to be framework-agnostic, offering structured docs and examples you can adapt to your project.

How to install

Prerequisites:

  • Node.js (LTS) and npm installed
  • Git installed
  • Basic familiarity with MCP (Model Context Protocol) and your chosen framework

Installation steps:

  1. Clone the repository or install via the Smithery CLI (as recommended):
# Option A: Smithery (recommended)
npx -y @smithery/cli install @dabhivijay2478/auth --client claude
  1. If installing manually from source, clone and install dependencies:
git clone <repository-url>
cd better-auth-mcp-server
npm install
  1. Build the project (if required by the project setup):
npm run build
  1. Run the server (as configured in mcp_config):
# If using the provided dist entry point
node path/to/dist/index.js
  1. Update your claude desktop configuration to reference the MCP server, for example:
{
  "mcpServers": {
    "better-auth": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

Prerequisites recap: ensure your environment has Node.js and npm installed, and that any database adapters or providers you plan to use are accessible and properly configured in your environment.

Additional notes

Tips and common considerations:

  • Environment variables: NODE_ENV, database URLs, and provider credentials may be required by your setup. Use a dedicated environment file or secret manager in production.
  • If you upgrade Better Auth features, remember to update AUTH_PROVIDERS, DATABASE_ADAPTERS, and PLUGINS mappings in your configuration and re-generate docs/configs as needed.
  • When migrating configurations, validate generated setups with validate_auth_setup for your target framework.
  • Ensure network access to your database and any external authentication providers (OAuth, etc.) configured for your MCP server.
  • For production deployments, consider enabling CSRF protection, secure cookies, and rate limiting as described in the security features of Better Auth.

Related MCP Servers

Sponsor this space

Reach thousands of developers