Skip to content

Latest commit

 

History

History
209 lines (140 loc) · 4.54 KB

File metadata and controls

209 lines (140 loc) · 4.54 KB

🚀 Warp Integration Guide

Add MCP Server to Warp

Method 1: Using Local Path (Development)

  1. Open WarpSettingsMCP Servers
  2. Click "+ Add"
  3. Paste this configuration:
{
  "auth-setup": {
    "command": "node",
    "args": [
      "/home/officialrajdeepsingh/opensource/auth-setup/dist/mcp-server.js"
    ]
  }
}
  1. Click Start to activate the server

Method 2: Using npx (After Publishing)

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

✅ Verify It's Working

After adding the server, you should see:

  • ✅ Server status: Running
  • ✅ Tools available:
    • setup_nextjs_auth
    • check_nextjs_project

🎯 How to Use with Warp Agent

Open Warp Agent Mode and try these commands:

Example 1: Basic Setup

Set up Auth.js authentication in my Next.js project at /home/user/my-app

The agent will:

  1. Validate the project
  2. Ask which providers you want
  3. Set everything up automatically

Example 2: Specific Configuration

Set up Auth.js with Google and GitHub OAuth in my Next.js project at /home/user/my-app using Prisma adapter

Example 3: Better Auth

Set up Better Auth in my Next.js project at /home/user/my-app

Example 4: Check Project First

Check if /home/user/my-app is a valid Next.js project with App Router

🧪 Testing the MCP Server

Manual Test (Without Warp)

You can test the MCP server directly:

# Start the MCP server (it uses stdio)
node dist/mcp-server.js

Then send MCP protocol messages (JSON-RPC format).

With Warp Logs

Check MCP server logs in Warp:

Linux:

cd "${XDG_STATE_HOME:-$HOME/.local/state}/warp-terminal/mcp"
ls -la
# View logs for your server
cat nextjs-auth-setup.log

🎨 Example Agent Conversations

Conversation 1: First Time Setup

You: "I need to add authentication to my Next.js app"

Agent: "I can help you set up authentication. What's the path to your Next.js project?"

You: "/home/user/my-project"

Agent: [Checks project] "This is a valid Next.js project with App Router. Which authentication library would you like to use: Auth.js or Better Auth?"

You: "Auth.js with Google login"

Agent: [Sets up auth] "✅ Done! I've set up Auth.js with Google OAuth. Here's what I created:

  • auth.ts
  • middleware.ts
  • app/api/auth/[...nextauth]/route.ts
  • app/auth/signin/page.tsx
  • .env.local

Next steps:

  1. Run: npm install
  2. Update .env.local with your Google OAuth credentials
  3. Generate AUTH_SECRET: openssl rand -base64 32"

Conversation 2: Quick Setup

You: "Add Auth.js with GitHub to /home/user/my-blog"

Agent: [Validates and sets up] "✅ Auth.js with GitHub is now configured in /home/user/my-blog. Don't forget to add your GitHub OAuth credentials to .env.local!"

🔧 Troubleshooting

Server Not Starting

  1. Check logs in Warp MCP settings
  2. Verify the path is correct
  3. Make sure Node.js is installed: node --version

Tools Not Showing

  1. Restart the MCP server in Warp
  2. Check that the build completed: ls dist/mcp-server.js
  3. Rebuild if needed: npm run build

Permission Errors

Make sure the MCP server can write to your Next.js project directory.

📊 What the Agent Can Do

The Warp agent, using this MCP server, can:

✅ Validate Next.js projects
✅ Set up Auth.js with multiple providers
✅ Set up Better Auth
✅ Configure database adapters (Prisma, Drizzle)
✅ Generate all necessary files
✅ Update package.json automatically
✅ Provide environment variable templates
✅ Give clear next steps

🚫 What It Cannot Do

❌ Install npm packages (you need to run npm install)
❌ Create OAuth credentials for you
❌ Start your dev server
❌ Set up the database schema (you need to run migrations)

📝 Advanced: Custom Prompts

You can be very specific with the agent:

Set up Auth.js in /home/user/my-app with:
- Google OAuth
- GitHub OAuth
- Credentials-based login
- Prisma adapter for PostgreSQL

The agent will use the MCP server to configure everything exactly as specified.

🎓 Pro Tips

  1. Always provide absolute paths for best results
  2. Be specific about providers you want
  3. Mention your database if you're using one
  4. Ask the agent to check first if you're unsure about your project structure

🔄 Updating the Server

After making changes to the code:

npm run build

Then restart the server in Warp MCP settings.


You're now ready to use AI-powered auth setup! 🎉