| name | setup-server |
| description | Bootstrap Pierre server with database, admin user, coaches, and test users for development and testing |
| user-invocable | true |
Setup Server Skill
CLAUDE: When this skill is invoked with /setup-server, run the setup script:
./bin/setup-and-start.sh --skip-fresh-start
For a completely fresh start (wipes database):
./bin/setup-and-start.sh
Purpose
Bootstraps the Pierre MCP Server with all required components: database, admin user, coaches, and optionally test users. Essential for development, testing, and iOS Simulator testing.
Usage
/setup-server
Synthetic Provider vs Strava (IMPORTANT)
CLAUDE: Default to synthetic provider. Ask if Strava is needed.
When to Use Synthetic Provider (DEFAULT)
- Most development and testing - no OAuth required
- iOS Simulator testing - works without external accounts
- UI/UX development - realistic data without API limits
- CI/CD pipelines - deterministic, reproducible tests
When Strava is Needed
Only use Strava when:
- Testing OAuth flow specifically
- Validating real Strava API integration
- User explicitly requests Strava data
- Testing webhook sync features
Set Provider in .envrc
export PIERRE_DEFAULT_PROVIDER=synthetic
export PIERRE_DEFAULT_PROVIDER=strava
Default Test Credentials
CRITICAL: These are the default credentials from .envrc. Always use these for testing.
Admin User
Email: admin@pierre.mcp
Password: adminpass123
Regular Test User
Email: user@example.com
Password: userpass123
Environment Variables (from .envrc)
export ADMIN_EMAIL="admin@pierre.mcp"
export ADMIN_PASSWORD="adminpass123"
export OAUTH_DEFAULT_EMAIL="user@example.com"
export OAUTH_DEFAULT_PASSWORD="userpass123"
Admin Token (REQUIRED FOR USER MANAGEMENT)
CLAUDE: To create/approve users via admin API, you need an admin token.
Generate Admin Token
cargo run --bin pierre-cli -- token generate --service claude_test --expires-days 7
Use Admin Token in API Calls
export ADMIN_TOKEN="<token-from-above-command>"
curl -H "Authorization: Bearer $ADMIN_TOKEN" \
http://localhost:8081/admin/users
Automatic Token Handling
The complete-user-workflow.sh script handles admin tokens automatically:
./scripts/complete-user-workflow.sh
This script:
- Generates an admin token (or reuses existing)
- Creates test user
- Approves user with tenant
- Saves all tokens to
.workflow_test_env
After Running Workflow Script
source .workflow_test_env
echo "Admin: $ADMIN_TOKEN"
echo "User JWT: $JWT_TOKEN"
Bootstrap Commands
Quick Start (skip database wipe)
./bin/setup-and-start.sh --skip-fresh-start
Fresh Start (wipes and recreates database)
./bin/setup-and-start.sh
Fresh Start with Workflow Tests
./bin/setup-and-start.sh --run-tests
What Setup Does
- Database Setup - Creates/migrates SQLite database
- Admin User - Creates admin@pierre.mcp with adminpass123
- Seed Coaches - Loads AI coaching personas
- Start Server - Starts on port 8081
- Health Check - Waits for server to be healthy
Note: Basic setup only runs pierre-cli seed coaches. For full test data, run additional seeders below.
Data Seeders (IMPORTANT FOR TESTING)
CLAUDE: Before testing features, run the appropriate seeders to populate test data.
All seeders are consolidated under pierre-cli seed <domain> subcommands.
Available Seeders
| Seeder | Command | What It Creates |
|---|
| Bootstrap | pierre-cli seed bootstrap | Admin + demo users (idempotent; requires ADMIN_PASSWORD) |
| Coaches | pierre-cli seed coaches | 9 AI coaching personas (training, nutrition, recovery, mobility) |
| Demo Data | pierre-cli seed demo-data | Dashboard analytics, API keys, usage time-series data |
| Mobility | pierre-cli seed mobility | Stretching exercises, yoga poses, activity-muscle mappings |
| Social | pierre-cli seed social | Friend connections, shared insights, reactions, feed data |
| Synthetic Activities | pierre-cli seed synthetic-activities | 100+ diverse activities (run, MTB, nordic ski, etc.) |
| LLM Usage | pierre-cli seed llm-usage | 30 days of LLM call records for analytics dashboards |
| Insight Samples | pierre-cli seed insight-samples | Loads and validates insight sample markdown files (no DB writes) |
Synthetic Activities Seeder (For Testing Without Strava)
CRITICAL: Use this seeder for testing without OAuth.
pierre-cli seed synthetic-activities
pierre-cli seed synthetic-activities --count 200
pierre-cli seed synthetic-activities --email alice@example.com
pierre-cli seed synthetic-activities --reset --count 150
Sport types included: Run, Trail Run, Ride, Mountain Bike, Gravel Ride, Nordic Ski, Backcountry Ski, Alpine Ski, Swim, Hike, Walk, Weight Training, Yoga, Rowing, Kayaking, SUP, and more.
Run All Seeders (Full Test Setup)
Option A: Fresh database with ALL seeders (RECOMMENDED)
./bin/reset-dev-db.sh
This wipes the database and runs ALL seeders automatically.
Option B: Run seeders individually (existing database)
pierre-cli seed coaches
pierre-cli seed demo-data
pierre-cli seed mobility
pierre-cli seed social
When to Run Which Seeder
| Testing This Feature | Required Seeders |
|---|
| Mobile app login | seed coaches (minimal) |
| Coach conversations | seed coaches |
| Activity list/analysis | seed synthetic-activities |
| Performance insights | seed synthetic-activities |
| Dashboard/Analytics | seed demo-data |
| Mobility/Stretching | seed mobility |
| Friends/Feed/Social | seed social + seed synthetic-activities |
| Full E2E testing | All seeders |
Complete User Workflow
After server is running, to create a test user with full access:
./scripts/complete-user-workflow.sh
This script:
- Creates/gets admin token
- Registers regular user (user@example.com)
- Approves user with tenant creation
- Tests MCP access
- Saves tokens to
.workflow_test_env
iOS Simulator Testing
When testing the mobile app with iOS Simulator:
1. Reset Database with Full Test Data
./bin/reset-dev-db.sh
This creates a fresh database with ALL seeders (coaches, demo data, mobility, social).
2. Start Server
./bin/start-server.sh
3. Run User Workflow (creates test user)
./scripts/complete-user-workflow.sh
4. Login Credentials for Mobile App
Email: user@example.com
Password: userpass123
5. Start Mobile App
cd frontend-mobile && bun start
Server Endpoints
| Endpoint | Purpose |
|---|
http://localhost:8081/health | Health check |
http://localhost:8081/oauth2/login | Web login page |
http://localhost:8081/oauth/token | OAuth token endpoint |
http://localhost:8081/mcp | MCP protocol endpoint |
http://localhost:8081/admin/* | Admin endpoints |
Manual Server Control
Start Server Only
./bin/start-server.sh
Stop Server
./bin/stop-server.sh
Check Server Status
curl http://localhost:8081/health
Troubleshooting
Server won't start
pkill -f pierre-mcp-server
lsof -i :8081
./bin/setup-and-start.sh
Database errors
./bin/reset-dev-db.sh
Token expired
cargo run --bin pierre-cli -- token generate --service test --expires-days 7
Missing .envrc
cp .envrc.example .envrc
direnv allow
Environment Files After Setup
After running complete-user-workflow.sh:
source .workflow_test_env
curl -H "Authorization: Bearer $JWT_TOKEN" http://localhost:8081/mcp ...
Related Skills
validate-frontend - Frontend validation
validate-mobile - Mobile app validation
create-worktree - Git worktree for feature branches