You now have a Next.js Auth Setup MCP Server project with:
✅ MCP server implementation (src/mcp-server.ts.bak)
✅ Registry-ready README
✅ Package configuration
✅ Type definitions
✅ Utility functions
Create src/templates/authjs.ts and src/templates/betterauth.ts with auth configuration templates (from your original CLI tool).
Create src/setup/authjs-setup.ts and src/setup/betterauth-setup.ts with setup logic (from your original CLI tool).
mv src/mcp-server.ts.bak src/mcp-server.tsnpm installnpm run build- Open Warp Settings > MCP Servers
- Click "+ Add"
- Paste this configuration:
{
"nextjs-auth-setup": {
"command": "npx",
"args": ["-y", "auth-setup"]
}
}Or for local development:
{
"nextjs-auth-setup": {
"command": "node",
"args": [
"/home/officialrajdeepsingh/opensource/auth-setup/dist/mcp-server.js"
]
}
}Once configured in Warp, you can ask:
"Set up Auth.js with Google OAuth in my Next.js project at /path/to/project"
The AI agent will:
- Call
check_nextjs_projectto validate - Call
setup_nextjs_authwith your parameters - Report the created files and next steps
Parameters:
projectPath: "/absolute/path/to/nextjs/project"authLibrary: "authjs" | "better-auth"providers: ["google", "github", "credentials"] (optional, Auth.js only)adapter: "prisma" | "drizzle" | "none" (optional)
Returns:
{
"success": true,
"filesCreated": ["auth.ts", "middleware.ts", ...],
"nextSteps": ["Run: npm install", ...]
}Parameters:
projectPath: "/absolute/path/to/check"
Returns:
{
"valid": true,
"isNextJs": true,
"hasAppRouter": true
}If you have the original auth-setup CLI project, copy these files:
# From original CLI project
cp ../auth-setup-cli/src/templates/* src/templates/
cp ../auth-setup-cli/src/setup/* src/setup/- Update
package.jsonwith your author info - Build:
npm run build - Test locally first
- Publish:
npm publish
Once published, you can submit to the MCP Registry:
- URL: https://github.com/modelcontextprotocol/servers
- Include your README.md
- Reference the package:
nextjs-auth-setup-mcp
MCP Client (Warp Agent)
↓ calls tools
MCP Server (this package)
↓ validates & generates
Next.js Project
← auth files created
| CLI Tool | MCP Server |
|---|---|
| Interactive prompts | Structured tool calls |
| User runs manually | AI agent invokes |
| Terminal output | JSON responses |
inquirer for UI |
No UI - tool parameters |
User: "Add Auth.js to my Next.js app"
Agent internal flow:
- Determines project path
- Calls
check_nextjs_project(projectPath) - Asks user: "Which providers? (Google, GitHub, Credentials)"
- User: "Google and GitHub"
- Calls
setup_nextjs_auth({ projectPath, authLibrary: "authjs", providers: ["google", "github"] }) - Reports success and next steps to user
- Copy/create template files
- Copy/create setup modules
- Build and test
- Publish to npm
- Add to your Warp MCP configuration
- Try it out!
You're building a tool that lets AI agents set up auth automatically. Pretty cool! 🚀