---
title: "Authentication & scopes | Fitaily Docs"
description: "OAuth 2.1 with PKCE, HS256 tokens and scopes that decide what the assistant can do."
url: "https://fitaily.com/docs/authentication/en"
canonical: "https://fitaily.com/docs/authentication/en"
lang: en
---

# Authentication & scopes

Fitaily MCP has no login of its own. The Fitaily backend is the authorization server (OAuth 2.1 + PKCE S256, dynamic client registration) and the MCP server only verifies access tokens.

## The token

- HS256 JWT with userId, client_id, scope, aud and jti claims.
- An MCP client OAuth token lasts 15 minutes; the internal Fitaily chat token is shorter (5 minutes). External tokens can be refreshed for 30 days, with rotation on use.
- aud must equal MCP_RESOURCE_URL — a mismatch returns 403 “Token audience mismatch”.

## Scopes

| Scope | Unlocks |
| --- | --- |
| nutrition:read | meals, foods, water, recipes, diet plans, pantry, profile |
| nutrition:write | log/edit/delete meals and water, goals, recipe CRUD, diet-plan generate/activate/extend, fridge and shopping list |
| training:read | activities, plans, workout templates, exercise catalog, strength stats |
| training:write | log_activity, workout template create/update/delete |
| progress:read | measurements, goals, aggregates, trends, forecasts |
| progress:write | add/update measurements and goals |
| analytics:read | metrics, dimensions, trends, period comparisons and correlations |
| dashboards:read | list and read your dashboards, including widget data |
| dashboards:write | create, update and delete your dashboards |
| agent:read | read the user’s saved agent preferences and context |
| agent:write | create, update and delete memory entries after approval |

## Auth errors

- 401 — missing or invalid token; the response carries WWW-Authenticate with the resource metadata URL.
- 403 Missing scope: <scope> — the token lacks the required scope.

> **Writes are confirmed in the chat: Mutating tools perform the write only after you approve the exact operation in the chat. See “Agents & confirmations” for the details.

---

[Fitaily MCP na GitHubie](https://github.com/rafafau/fitaily-mcp)
