npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

auth-setup-mcp

v0.0.1

Published

MCP server for setting up authentication in Next.js projects

Readme

🔐 auth-setup — MCP Server

auth setup is a custom Model Context Protocol (MCP) server that helps developers set up authentication in a Next.js application through an interactive, adapter-aware flow.

Instead of copy-pasting auth docs, developers answer a few guided questions and get a fully configured authentication system tailored to their stack.


✨ What This MCP Server Does

  • Guides authentication setup for Next.js (App Router first)
  • Supports multiple authentication libraries
  • Asks only relevant questions based on the selected auth library
  • Automatically configures:
    • Adapters (ORM / database)
    • Providers
    • API routes
    • Helpers
    • Environment variables
  • Outputs production-ready auth code

🔧 Supported Authentication Libraries

The MCP server is library-agnostic and currently supports:

  • Auth.js (v5)
  • Better Auth

Designed to be easily extended to Clerk, Lucia, Supabase Auth, custom auth, etc.


🧠 How It Works

Interactive Tool Flow

When the MCP server runs, it exposes tools that AI agents can call:

  1. check_nextjs_project - Validates if a directory is a Next.js project with App Router
  2. setup_nextjs_auth - Sets up authentication with the specified library and configuration

The AI agent can:

  1. Detect or ask for the authentication library
  2. Ask library-specific questions, such as:
    • Which database or ORM adapter are you using?
      • Prisma
      • Drizzle
      • None (JWT / hosted auth)
  3. Skip unnecessary prompts automatically

🔌 MCP Integration

Add this server to your MCP client (like Warp):

CLI Server (Command) Configuration

{
  "auth-setup": {
    "command": "npx",
    "args": ["-y", "auth-setup"]
  }
}

Or with a local installation:

{
  "auth-setup": {
    "command": "node",
    "args": ["/path/to/auth-setup/dist/mcp-server.js"]
  }
}

🛠️ Available Tools

setup_nextjs_auth

Set up authentication in a Next.js application.

Parameters:

  • projectPath (string, required): Absolute path to the Next.js project
  • authLibrary (string, required): "authjs" or "better-auth"
  • providers (array, optional): OAuth providers like ["google", "github", "credentials"] (Auth.js only)
  • adapter (string, optional): Database adapter: "prisma", "drizzle", or "none"

Example:

{
  "projectPath": "/home/user/my-nextjs-app",
  "authLibrary": "authjs",
  "providers": ["google", "github"],
  "adapter": "prisma"
}

check_nextjs_project

Verify if a directory is a valid Next.js project.

Parameters:

  • projectPath (string, required): Path to check

Returns:

{
  "isNextJs": true,
  "hasAppRouter": true,
  "valid": true,
  "message": "Valid Next.js project with App Router"
}

📁 Generated Output (Example)

After running setup_nextjs_auth:

{
  "success": true,
  "authLibrary": "authjs",
  "providers": ["google", "github"],
  "adapter": "prisma",
  "filesCreated": [
    "auth.ts",
    "middleware.ts",
    "app/api/auth/[...nextauth]/route.ts",
    "app/auth/signin/page.tsx",
    ".env.local"
  ],
  "nextSteps": [
    "Run: npm install",
    "Update .env.local with OAuth credentials",
    "Generate auth secret: openssl rand -base64 32"
  ]
}

🧩 Design Principles

  • Interactive, not verbose
  • Adapter-aware
  • Library-agnostic core
  • Next.js App Router first
  • Minimal developer effort
  • Zero copy-paste boilerplate

🚀 Developer Experience with AI Agents

In Warp or other MCP clients, developers can simply ask:

"Set up Auth.js authentication with Google and GitHub in my Next.js project at /home/user/my-app"

The AI agent will:

  1. Validate the project
  2. Call the setup tool
  3. Generate all necessary files
  4. Provide next steps

No guessing. No broken tutorials.


🛣️ Roadmap

Planned extensions:

  • Clerk Auth support
  • Lucia Auth
  • Supabase Auth
  • Role & permission scaffolding
  • Multi-tenant auth
  • OAuth provider auto-setup

📦 Installation

As MCP Server (Recommended)

Add to your MCP client configuration (see MCP Integration above).

As CLI Tool

npx auth-setup init

🔧 Development

Building

npm install
npm run build

Testing Locally

node dist/mcp-server.js

📜 License

MIT


🤝 Contributing

Contributions welcome! Please see CONTRIBUTING.md for guidelines.


🆘 Support

  • GitHub Issues for bugs
  • GitHub Discussions for questions
  • MCP Registry for discoverability

Built for the Next.js and MCP community 🚀