| name | ai-universe-auth |
| description | Authenticate with AI Universe MCP server for multi-model commands |
| type | setup |
| scope | project |
AI Universe Authentication Setup
This skill provides authentication setup for the AI Universe MCP server, which powers the /secondo command for multi-model AI feedback.
Script Location
IMPORTANT: Always look for auth-cli.mjs in these locations (in order of preference):
| Location | Description | Has node_modules |
|---|
scripts/auth-cli.mjs | Project-local (recommended) | Needs parent project |
~/.claude/scripts/auth-cli.mjs | User-global fallback | Yes (if installed) |
~/projects/ai_universe/scripts/auth-cli.mjs | Source of truth | Yes |
To run the script, use a directory that has node_modules with express installed:
cd ~/projects/ai_universe && node scripts/auth-cli.mjs status
node ~/.claude/scripts/auth-cli.mjs status
Multi-Project Support
The script supports two Firebase projects. Use the correct one for your use case:
| Project | Firebase ID | Use Case | Command |
|---|
| AI Universe | ai-universe-b3551 | /secondo, multi-model synthesis | node scripts/auth-cli.mjs token (default) |
| WorldAI | worldarchitecture-ai | WorldArchitect.AI app auth | node scripts/auth-cli.mjs token --project worldarchitecture-ai |
When to Use Each Project
AI Universe (ai-universe-b3551) - DEFAULT
/secondo command for multi-model second opinions
- AI Universe MCP server calls
- Multi-model synthesis API
node scripts/auth-cli.mjs login
node scripts/auth-cli.mjs token
WorldAI (worldarchitecture-ai)
- WorldArchitect.AI application authentication
- Firebase auth for the RPG game platform
- Direct WorldAI API calls
node scripts/auth-cli.mjs login --project worldarchitecture-ai
node scripts/auth-cli.mjs token --project worldarchitecture-ai
Prerequisites
- Node.js (>=20.0.0) installed
- Express dependency installed (
npm install express)
- Browser for OAuth flow
Authentication Flow
1. Initial Login
node scripts/auth-cli.mjs login
node scripts/auth-cli.mjs login --project worldarchitecture-ai
What happens:
- Starts local callback server on port 9005
- Opens browser to Firebase Google sign-in
- User signs in with Google account
- ID token and refresh token saved to
~/.ai-universe/auth-token-<project-id>.json
- ID token expires after 1 hour (Firebase security policy)
- Refresh token enables automatic token renewal
2. Check Authentication Status
node scripts/auth-cli.mjs status
Output includes:
- User information (name, email, UID)
- Firebase Project being used
- Token creation time
- Token expiration time
- Current validity status
3. Get Token for Scripts
TOKEN=$(node scripts/auth-cli.mjs token)
echo $TOKEN
TOKEN=$(node scripts/auth-cli.mjs token --project worldarchitecture-ai)
Token Behavior:
- Token Valid: Returns it immediately
- Token Expired: Auto-refreshes using refresh token (silent, no browser popup)
- Refresh Token Expired: Prompts for login (browser OAuth)
This enables seamless 30+ day sessions.
4. Manual Token Refresh
node scripts/auth-cli.mjs refresh
5. Test MCP Connection
node scripts/auth-cli.mjs test
6. Logout
node scripts/auth-cli.mjs logout
Troubleshooting
Script Not Found or Missing Dependencies
cd ~/projects/ai_universe && node scripts/auth-cli.mjs status
cd ~/.claude && npm install express
cp ~/projects/ai_universe/scripts/auth-cli.mjs ~/.claude/scripts/
PROJECT_NUMBER_MISMATCH Error
This means the token was created for a different Firebase project than you're trying to use.
node scripts/auth-cli.mjs status
node scripts/auth-cli.mjs login
node scripts/auth-cli.mjs login --project worldarchitecture-ai
Port 9005 Already in Use
lsof -ti:9005 | xargs kill -9
Token Expired
TOKEN=$(node scripts/auth-cli.mjs token)
node scripts/auth-cli.mjs refresh
node scripts/auth-cli.mjs login
Token Storage
- Location:
~/.ai-universe/auth-token-<project-id>.json (separate file per project)
- ID Token: 1-hour expiration (Firebase policy)
- Refresh Token: ~30 days, enables silent renewal
- Security: Never commit tokens, localhost OAuth only
Integration with Commands
| Command | Project | Authentication |
|---|
/secondo | AI Universe | node scripts/auth-cli.mjs token (default) |
| WorldAI API | WorldAI | node scripts/auth-cli.mjs token --project worldarchitecture-ai |
Keeping Scripts in Sync
The source of truth for auth-cli.mjs is ~/projects/ai_universe/scripts/auth-cli.mjs.
To sync to other locations:
cp ~/projects/ai_universe/scripts/auth-cli.mjs .claude/scripts/
cp ~/projects/ai_universe/scripts/auth-cli.mjs ~/.claude/scripts/
Related Skills