---
type: Guide
title: Quickstart
description: Connect what-if to an MCP client, local llama.cpp or Roundhouse gateway, or terminal workflow.
status: stable
tags: [guide, quickstart, mcp, cli]
---

# Quickstart

## Prerequisites

- An upstream decision endpoint (`Roundhouse`, `llama.cpp`, `vLLM`, FastFlowLM, TypeSafe, OpenAI, OpenRouter, or Liquid AI).
- Optional: `ffmpeg` on `PATH` if you pass compressed audio files (`.mp3`, `.m4a`, `.ogg`, `.flac`) instead of `.wav`.

## Connect via MCP (`stdio`)

Configure your MCP client with the `what-if` binary:

```json
{
  "mcpServers": {
    "what-if": {
      "command": "what-if",
      "args": ["mcp"],
      "env": {
        "WHAT_IF_BASE_URL": "http://127.0.0.1:7700",
        "WHAT_IF_API_KEY": "your-api-key",
        "WHAT_IF_MODEL": "clef-flash",
        "WHAT_IF_MODEL_OMNI": "clef-omni"
      }
    }
  }
}
```

## Run as an HTTP service

```bash
# Static bearer guard
WHAT_IF_SERVER_TOKEN="$MCP_GATEWAY_TOKEN" \
  what-if serve --listen 127.0.0.1:8790

# OAuth 2.1 Resource Server (JWKS / RFC 7662) + caller upstream key pass-through
WHAT_IF_AUTH_ISSUER="https://idp.example.com" \
WHAT_IF_AUTH_REQUIRED_SCOPES="decide:read" \
WHAT_IF_AUTH_PASSTHROUGH=true \
  what-if serve --listen 127.0.0.1:8790
```

- MCP Streamable HTTP endpoint: `http://127.0.0.1:8790/_/mcp`
- RFC 9728 Protected Resource Metadata (when OAuth is enabled): `/.well-known/oauth-protected-resource` and `/.well-known/oauth-protected-resource/_/mcp`
- Liveness check: `http://127.0.0.1:8790/healthz`
- With both inbound auth (`server_token` or `[auth]`) and `WHAT_IF_AUTH_PASSTHROUGH=true`, clients send their MCP token in `Authorization: Bearer ...` and their upstream API key in `X-Upstream-API-Key`. With pass-through alone, callers send their upstream key in `Authorization: Bearer ...`.

## Discover the bundled Agent Skill

`what-if` embeds its Agent Skill directly inside the binary and serves it via the `io.modelcontextprotocol/skills` MCP extension (`directoryRead: true`) and standard MCP resources:

- Canonical skill URI: `skill://what-if/SKILL.md` (`text/markdown`)
- Discovery methods: `skills/list`, `skills/get`, `resources/list`, `resources/read`, and `resources/directory/read` (`skill://what-if`)

Clients with Skills over MCP support load guidance directly from the connected server with zero local file installation.

## Run with containers

```bash
# Minimal scratch runtime (< 11 MB, non-root UID 65532)
podman run --rm -p 8790:8790 \
  -e WHAT_IF_BASE_URL=http://host.containers.internal:7700 \
  -e WHAT_IF_API_KEY="$RH_KEY" \
  -e WHAT_IF_SERVER_TOKEN="$MCP_GATEWAY_TOKEN" \
  -v "$PWD:/work:ro" -e WHAT_IF_MEDIA_ROOTS=/work \
  ghcr.io/roundhouse-is/what-if:latest

# Omni runtime (Alpine + ffmpeg for non-WAV audio normalization)
podman run --rm -p 8790:8790 \
  -e WHAT_IF_BASE_URL=http://host.containers.internal:7700 \
  -e WHAT_IF_API_KEY="$RH_KEY" \
  ghcr.io/roundhouse-is/what-if:omni
```

## Run from the CLI

```bash
what-if ask \
  --state "Card charged twice for March invoice." \
  --noul "urgent=Does the customer require a response today?" \
  --choice "team=Route the ticket|billing:Invoices and charges,support:Product help,other:Anything else" \
  --score "tone=Assess politeness|rude,neutral,polite"
```
