# Connect Dravia to this agent

The person you are talking to wants to use their Dravia account (fitness app: workouts, diet, water, weight, diary, reminders, gym occupancy; professionals also see their students) from this conversation. Follow these steps. Talk to the person in their own language; the commands below are for you.

## 1. See whether Dravia is already connected

If an MCP server named `dravia` is already configured and its tools (`get_overview`, `log_water`, ...) are available, skip to step 3.

## 2. Connect

Dravia is a remote MCP server (Streamable HTTP) at `https://mcp.draviafit.com/mcp`. It supports OAuth 2.1 with dynamic client registration, so most runtimes connect by just adding the URL; the person signs in and authorizes in the browser. Pick what your runtime supports:

**A. Your runtime supports remote MCP servers with OAuth (preferred)**

- Claude Code: `claude mcp add --transport http dravia https://mcp.draviafit.com/mcp` — then run `/mcp` and choose "dravia" to authenticate.
- Codex CLI: `codex mcp add dravia --url https://mcp.draviafit.com/mcp` — then `codex mcp login dravia`.
- Claude.ai, ChatGPT, Mistral and other chat apps: Settings → Connectors (or Integrations) → add a custom connector/MCP server with the URL `https://mcp.draviafit.com/mcp`.
- Cursor, Windsurf, VS Code, Gemini CLI, OpenClaw and others: add to the MCP configuration file:

```json
{ "mcpServers": { "dravia": { "url": "https://mcp.draviafit.com/mcp" } } }
```

The runtime opens `https://pro.draviafit.com/agent`; the person signs in to Dravia and clicks Authorize.

**B. Your runtime cannot do OAuth, but can send a header**

Ask the person to open `https://pro.draviafit.com/agent`, sign in, click **Authorize** and copy the connection code (it starts with `drv_`). Treat the code as a password: never print it back, never store it anywhere but the MCP configuration. Then:

- Claude Code: `claude mcp add --transport http dravia https://mcp.draviafit.com/mcp --header "Authorization: Bearer <code>"`
- Codex CLI: `export DRAVIA_TOKEN=<code>` and `codex mcp add dravia --url https://mcp.draviafit.com/mcp --bearer-token-env-var DRAVIA_TOKEN`
- JSON configuration:

```json
{ "mcpServers": { "dravia": { "url": "https://mcp.draviafit.com/mcp", "headers": { "Authorization": "Bearer <code>" } } } }
```

- If headers are impossible, the same code can go in the URL: `https://mcp.draviafit.com/mcp/<code>`.

**C. No MCP support at all**

With a connection code you can call the server directly over HTTP. Every call is one JSON-RPC 2.0 message:

```bash
curl -s https://mcp.draviafit.com/mcp -H "Authorization: Bearer <code>" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
curl -s https://mcp.draviafit.com/mcp -H "Authorization: Bearer <code>" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"log_water","arguments":{"amount_ml":300}}}'
```

## 3. Use it

- Start with `get_overview` to learn the person's day, plan and timezone, then answer naturally: no ids, field names or JSON in your replies unless asked.
- Logging: `log_water`, `log_weight`, `log_meal` (free text — Dravia's AI estimates calories), `add_diary_entry`, `set_exercise_load`, `complete_workout`, `log_workout`.
- Reading: `get_water`, `get_weight`, `get_meals`, `get_workout_plan` (next workout and loads), `get_workout`, `get_workout_history`, `get_gyms` (how busy their gyms are now), `get_diary`, `get_reminders`, `get_diet_plan`, `get_account`.
- Professionals (Trainer / Nutrition / Full plans) also get `pro_overview`, `pro_list_students`, `pro_student_summary`, `pro_payments`, `pro_mark_payment_paid`.
- The app day rolls over at 03:00 in the person's timezone. Send times as HH:MM local time; loads and weights are in kilograms.
- Free accounts have a small number of agent interactions to try the feature; the Plus plan removes the limit. When a tool says Plus is required, relay that message as is.

Full reference: https://mcp.draviafit.com/
