AI Universe MCP 服务器认证
ai-universe-auth
通过 AI Universe MCP 服务器进行身份验证,以执行多模型命令。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- type
- setup
- scope
- project
- description
- Authenticate with AI Universe MCP server for multi-model commands
03 SKILL.md 正文
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:
# From ai_universe project (always works)
cd ~/projects/ai_universe && node scripts/auth-cli.mjs status
# Or from ~/.claude if deps installed
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 |
Your Project app auth | node scripts/auth-cli.mjs token --project worldarchitecture-ai |
When to Use Each Project
AI Universe (ai-universe-b3551) - DEFAULT
/secondocommand for multi-model second opinions- AI Universe MCP server calls
- Multi-model synthesis API
# Default - no flag needed
node scripts/auth-cli.mjs login
node scripts/auth-cli.mjs token
WorldAI (worldarchitecture-ai)
- Your Project application authentication
- Firebase auth for the RPG game platform
- Direct WorldAI API calls
# Explicit project flag required
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
# AI Universe (default) - for /secondo
node scripts/auth-cli.mjs login
# WorldAI - for Your Project
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
# Get token (auto-refreshes if expired, does nothing if valid)
TOKEN=$(node scripts/auth-cli.mjs token)
echo $TOKEN
# For WorldAI project
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
# Option 1: Run from ai_universe project
cd ~/projects/ai_universe && node scripts/auth-cli.mjs status
# Option 2: Install deps in ~/.claude
cd ~/.claude && npm install express
# Option 3: Copy working script
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.
# Check which project your token is for
node scripts/auth-cli.mjs status
# Look for "Firebase Project:" line
# Re-login for the correct project
node scripts/auth-cli.mjs login # AI Universe
node scripts/auth-cli.mjs login --project worldarchitecture-ai # WorldAI
Port 9005 Already in Use
lsof -ti:9005 | xargs kill -9
Token Expired
# Auto-refresh (silent)
TOKEN=$(node scripts/auth-cli.mjs token)
# Or manual refresh
node scripts/auth-cli.mjs refresh
# If refresh token expired, re-login
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:
# Sync to project .claude/scripts/
cp ~/projects/ai_universe/scripts/auth-cli.mjs .claude/scripts/
# Sync to user ~/.claude/scripts/
cp ~/projects/ai_universe/scripts/auth-cli.mjs ~/.claude/scripts/
Related Skills
- ai-universe-httpie.md - HTTPie usage examples
- secondo-dependencies.md - /secondo command dependencies
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.