npm package: @striderlabs/mcp-planetfitness
Description: MCP server for Planet Fitness gym membership management
Author: StrideLabs
Latest version: 1.0.0

# @striderlabs/mcp-planetfitness

MCP (Model Context Protocol) server for Planet Fitness gym membership management. Automates interactions with [planetfitness.com](https://www.planetfitness.com) using Playwright browser automation.

## Tools

| Tool | Description | Login Required |
|------|-------------|----------------|
| `get_membership` | Get membership details, status, plan, home club | Yes |
| `check_in` | Check in at a club location | Yes |
| `find_clubs` | Search nearby Planet Fitness locations | No |
| `get_club_hours` | Get hours for a specific club | No |
| `book_class` | Book a fitness class (PE@PF program) | Yes |

## Installation

```bash
npm install @striderlabs/mcp-planetfitness
# or from tarball:
npm install striderlabs-mcp-planetfitness-1.0.0.tgz
```

## Configuration

### Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `PF_EMAIL` | For auth tools | Your Planet Fitness account email |
| `PF_PASSWORD` | For auth tools | Your Planet Fitness account password |
| `BROWSERBASE_CDP_URL` | Optional | Browserbase CDP WebSocket URL for remote browser |

### Browserbase Setup

For production use, connect via [Browserbase](https://browserbase.com):

```bash
export BROWSERBASE_CDP_URL="wss://connect.browserbase.com?apiKey=YOUR_KEY&sessionId=SESSION_ID"
```

Without `BROWSERBASE_CDP_URL`, the server falls back to a local headless Chromium instance (requires Playwright browsers to be installed: `npx playwright install chromium`).

## Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "planetfitness": {
      "command": "node",
      "args": ["/path/to/node_modules/@striderlabs/mcp-planetfitness/dist/index.js"],
      "env": {
        "PF_EMAIL": "your@email.com",
        "PF_PASSWORD": "yourpassword",
        "BROWSERBASE_CDP_URL": "wss://connect.browserbase.com?apiKey=..."
      }
    }
  }
}
```

## Usage with MCP CLI

```bash
PF_EMAIL=your@email.com PF_PASSWORD=pass node dist/index.js
```

## Tool Details

### `get_membership`

Returns member name, status, plan type, home club, member number, join date, and next billing date.

```json
{}
```

### `check_in`

Check in at your home club or a specific club.

```json
{
  "club_id": "optional-club-id"
}
```

### `find_clubs`

Search for Planet Fitness locations near you.

```json
{
  "location": "Austin, TX",
  "radius_miles": 10,
  "limit": 10
}
```

### `get_club_hours`

Get operating hours for a specific club.

```json
{
  "club_id": "club-id-from-find-clubs"
}
```

### `book_class`

Book a PE@PF group fitness class (available at select locations).

```json
{
  "club_id": "optional-club-id",
  "class_name": "Yoga",
  "date": "2025-01-15",
  "time_preference": "morning"
}
```

## Browser Automation Pattern

All tools use Playwright to automate a browser session:

```typescript
// Connect via Browserbase CDP
const browser = await chromium.connectOverCDP(process.env.BROWSERBASE_CDP_URL);

// Or local headless
const browser = await chromium.launch({ headless: true });
```

The server navigates `planetfitness.com`, performs login when needed (storing credentials only in environment variables), and extracts data from the rendered page.

## Notes

- **Group fitness classes (PE@PF)** are only available at select Planet Fitness locations
- Check-in via web automation may vary by club — the Planet Fitness app barcode scanner is the primary check-in method
- Web scraping selectors may need updates if Planet Fitness changes their website structure
- For production deployments, Browserbase is recommended over local headless for reliability and anti-bot bypass

## License

MIT