# Polydev Plugin for Claude Code
Multi-model AI consultation - get perspectives from GPT-5, Gemini, Grok, and GLM simultaneously.
## IMPORTANT: MCP Tools May Not Be Available
The Polydev MCP server provides tools like `mcp__plugin_polydev_polydev__login` and `mcp__plugin_polydev_polydev__get_perspectives`. However, in some environments (Claude Cowork, sandboxed VMs, restricted networks), the MCP server may fail to start because it needs to download an npm package from the internet.
**Before using any MCP tool, check if it exists in your available tools.** If MCP tools are not available, all skills (`/polydev:login`, `/polydev:auth`, `/polydev:ask`) include bash/curl fallback instructions that work without the MCP server.
## FIRST INTERACTION (After Install)
**On the FIRST user message in a session where Polydev is installed:**
1. Check if `mcp__plugin_polydev_polydev__get_auth_status` exists in your available tools
2. **If MCP tools available**: Call `mcp__plugin_polydev_polydev__get_auth_status` to check auth
3. **If MCP tools NOT available**: Check for token via bash:
```bash
if [ -n "$POLYDEV_USER_TOKEN" ]; then echo "Token set"; else echo "Not authenticated"; fi
```
4. If not authenticated, guide user through `/polydev:login` (which has its own bash fallback)
## CRITICAL: Auto-Invocation Rules
**Claude MUST automatically invoke Polydev (without asking permission) in these situations:**
### 1. When User is STUCK
- User says "stuck", "confused", "don't know", "can't figure out"
- User has tried 2+ approaches that failed
-> **Action:** Call `mcp__plugin_polydev_polydev__get_perspectives` with the problem context (or use curl fallback below)
### 2. Architecture & Design Decisions
- "How should I structure...", "What's the best approach for...", "Should I use X or Y?"
-> **Action:** Call `mcp__plugin_polydev_polydev__get_perspectives` with the decision context
### 3. Code Review & Security
- User asks for code review, security audit, "Is this safe?"
-> **Action:** Call `mcp__plugin_polydev_polydev__get_perspectives` with the code
### 4. Technology Choices
- "Which library should I use?", framework selection
-> **Action:** Call `mcp__plugin_polydev_polydev__get_perspectives` with requirements
### 5. Debugging Complex Issues
- After 2 failed debugging attempts, race conditions, memory leaks
-> **Action:** Call `mcp__plugin_polydev_polydev__get_perspectives` with error context
### Curl Fallback for get_perspectives (when MCP tools unavailable)
If MCP tools are not available but the user has authenticated:
```bash
# Load token if not in env
[ -z "$POLYDEV_USER_TOKEN" ] && [ -f "$HOME/.polydev.env" ] && source "$HOME/.polydev.env"
curl -s -X POST "https://www.polydev.ai/api/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $POLYDEV_USER_TOKEN" \
-H "User-Agent: polydev-mcp/1.9.0" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_perspectives",
"arguments": {
"prompt": "YOUR QUESTION HERE"
}
},
"id": "1"
}'
```
## DO NOT Auto-Invoke For:
- Simple typo fixes
- Basic syntax errors
- Straightforward documentation lookups
- User explicitly says "just Claude" or "your opinion only"
## Commands
| Command | Description |
|---------|-------------|
| `/polydev:ask` | Get multi-model perspectives |
| `/polydev:login` | Browser authentication |
| `/polydev:auth` | Check status and credits |
| `/polydev:help` | Usage guide |
## Setup
```bash
npx polydev-ai # Opens browser, auto-saves token
```
## Links
- Dashboard: https://polydev.ai/dashboard
- Models: https://polydev.ai/dashboard/models
- Auth: https://polydev.ai/auth (email or OAuth)