You now have a fully functional Next.js Auth Setup MCP Server that can be used by AI agents in Warp to automatically set up authentication in Next.js projects.
auth-setup/
├── dist/ # ✅ Built and ready
│ ├── mcp-server.js # Main MCP server
│ ├── setup/ # Setup modules
│ └── templates/ # Code templates
├── src/ # Source code
│ ├── mcp-server.ts # MCP server implementation
│ ├── setup/ # Auth.js & Better Auth setup
│ ├── templates/ # File generation templates
│ ├── types.ts # TypeScript types
│ └── utils.ts # Utilities
├── README.md # Registry-ready documentation
├── WARP_INTEGRATION.md # How to use in Warp
├── MCP_SETUP_GUIDE.md # Technical details
├── package.json # ✅ Configured for MCP
└── LICENSE # MIT License
Open Warp → Settings → MCP Servers → + Add
Paste this:
{
"auth-setup": {
"command": "node",
"args": [
"/home/officialrajdeepsingh/opensource/auth-setup/dist/mcp-server.js"
]
}
}Then click Start and you're ready to go!
In Warp Agent Mode, try:
"Set up Auth.js authentication in my Next.js project at /path/to/your/project"
The agent will use your MCP server to set everything up!
When ready to share:
# 1. Update package.json with your author info
# 2. Test thoroughly
# 3. Publish
npm publishThen others can use:
{
"auth-setup": {
"command": "npx",
"args": ["-y", "auth-setup"]
}
}Share with the MCP community:
- Repository: https://github.com/modelcontextprotocol/servers
- Include your README.md
- Get discovered by developers worldwide!
Your server exposes two tools:
Sets up authentication with Auth.js or Better Auth
Parameters:
projectPath- Path to Next.js projectauthLibrary- "authjs" or "better-auth"providers- Array of providers (optional)adapter- Database adapter (optional)
Validates a Next.js project
Parameters:
projectPath- Path to check
- README.md - Main documentation (registry-ready)
- WARP_INTEGRATION.md - How to use in Warp with examples
- MCP_SETUP_GUIDE.md - Technical architecture and testing
✅ Auth.js (v5) Support
- Google OAuth
- GitHub OAuth
- Credentials-based auth
- Middleware generation
- API routes
✅ Better Auth Support
- Email/password
- OAuth providers
- SQLite database
- Client and server setup
✅ Smart Configuration
- Validates Next.js projects
- Updates package.json
- Generates all necessary files
- Creates environment templates
✅ AI Agent Ready
- JSON-RPC protocol
- Structured tool calls
- Clear error messages
- Helpful responses
Before publishing, test:
- Add to Warp MCP servers
- Server starts successfully
- Tools appear in Warp
- Ask agent to check a Next.js project
- Ask agent to set up Auth.js
- Ask agent to set up Better Auth
- Verify generated files are correct
- Test with different providers
- Check error handling (invalid paths, non-Next.js projects)
- Quick prototyping - "Add auth to my app" and it's done
- Learning - See how auth is configured
- Consistency - Same auth setup across projects
- Time-saving - No more copying boilerplate
- AI-powered development - Let the agent handle config
To make changes:
# 1. Edit source files in src/
# 2. Rebuild
npm run build
# 3. Restart in Warp (MCP Servers settings)
# 4. Test with agent- Language: TypeScript
- Dependencies: @modelcontextprotocol/sdk, chalk
- Build Size: ~10KB
- Node Version: >=18.0.0
- License: MIT
- First of its kind - Auth setup via MCP
- AI-native - Built for agent interaction
- Production-ready - Real code generation
- Extensible - Easy to add more auth libraries
- Developer-friendly - Clear docs and examples
Consider adding:
- Clerk Auth support
- Lucia Auth support
- Supabase Auth support
- Role/permission scaffolding
- Database migration generation
- OAuth callback URL helpers
- Auth testing utilities
- TypeScript config generation
Want to improve this? Great!
- Fork the repo
- Make your changes
- Test thoroughly
- Submit a PR
- Check logs:
~/.local/state/warp-terminal/mcp/ - Rebuild:
npm run build - Restart server in Warp settings
You've built a professional MCP server that lets AI agents set up authentication automatically. This is cutting-edge stuff!
Now go try it in Warp! 🚀
Built with MCP for the Next.js community ❤️