# LitoFit — Если вы AI-агент, начните здесь

Подключите LitoFit к своему AI-клиенту: находите продукты, ведите дневник питания и смотрите историю веса через чат, без ручного переноса данных.

Публичная инструкция доступна без входа и JavaScript. Сначала получите разрешение пользователя на подключение.

## Адреса и протокол

- MCP resource / адрес: https://mcp.litofit.ru/mcp
- Транспорт: Streamable HTTP · JSON-RPC 2.0
- Discovery защищённого ресурса: https://mcp.litofit.ru/.well-known/oauth-protected-resource/mcp
- OAuth issuer: https://litofit.ru
- Discovery сервера авторизации: https://litofit.ru/.well-known/oauth-authorization-server

## Минимальные права

- full_access: Все текущие и будущие возможности LitoFit, включая чтение, изменение и удаление данных
- food:read: Чтение питания и истории нутриентов
- food:write: Запись, изменение и удаление питания
- weight:read: Чтение веса и истории
- weight:write: Запись и удаление веса
- profile:read: Чтение разрешённых полей профиля
- account:read: Чтение полного личного профиля
- profile:write: Изменение профиля и целей
- notifications:read: Чтение настроек уведомлений
- notifications:write: Изменение настроек уведомлений
- food:resolve: Распознавание еды по тексту, фото и голосу
- subscription:read: Чтение подписки и предложений
- subscription:write: Оформление и управление подпиской

## Порядок подключения

1. Получите явное разрешение пользователя. Запрашивайте только необходимые scopes; food:read, weight:read и profile:read подходят для чтения. Write scope не включает read scope.
2. Подключение требует существующий аккаунт LitoFit; регистрация на сайте недоступна. Предпочитайте browser OAuth: прочитайте resource discovery и issuer discovery, используйте опубликованные endpoints, PKCE S256, state и точный resource. Пользователь сам вводит OTP на сайте LitoFit; не просите переслать код в чат.
3. После browser callback завершите token exchange в клиенте. Если OAuth не поддерживается, пользователь может выпустить PAT на https://litofit.ru/account/tokens/new и передать секрет только в защищённые настройки Bearer/header, не в URL или публичный чат.
4. Выполните handshake для версии протокола клиента. Legacy 2025-11-25: initialize с protocolVersion, capabilities и clientInfo (name, version), затем notifications/initialized; последующие запросы с MCP-Protocol-Version: 2025-11-25 и полученным Mcp-Session-Id. Modern 2026-07-28: server/discover; каждый запрос содержит params._meta["io.modelcontextprotocol/protocolVersion"] = "2026-07-28" и params._meta["io.modelcontextprotocol/clientCapabilities"] = {} (либо фактические capabilities клиента). Обязательные заголовки MCP-Protocol-Version: 2026-07-28 и MCP-Method должны совпадать с метаданными и методом; при tools/call также обязателен MCP-Name с именем инструмента. Modern не использует legacy initialize.
5. Вызовите tools/list с метаданными выбранной версии. Подключение завершено только после получения корректного handshake и списка инструментов, не после входа на сайт. Актуальные описания и схемы tools/list определяют допустимые аргументы и ограничения.

## Границы и безопасность

- Права записи допускают немедленные изменения; описание инструмента и разрешение пользователя обязательны. Для create_food перед каждым вызовом спросите: сохранить только для пользователя или предложить общему каталогу (private / submit_for_review), и дождитесь ответа.
- Перед удалением назовите конкретный объект и последствия. Не повторяйте запись вслепую при неизвестном результате; сначала проверьте состояние доступными инструментами.
- Инструменты записи помечены в tools/list: readOnlyHint=false и annotations["io.modelcontextprotocol/action-metadata"] с requiresReview: true; удаления и отмена подписки — outcome: irreversible. Клиент, который не читает annotations (например, RikkaHub), сам не спросит: включите в нём подтверждение вызовов инструментов, если такая настройка есть, иначе подключайте только права чтения.
- Не обходите отказ, отзыв, срок доступа или scopes. Не храните OTP, bearer или PAT в URL, логах, публичных примерах и истории переписки. Маркетинговое описание не является разрешением на запись.

---

# LitoFit — AI agents: start here

Connect LitoFit to your AI client: find foods, keep your food diary and explore weight history in chat, without copying data by hand.

This public guide is readable without login or JavaScript. Obtain the user’s permission before connecting.

## Addresses and protocol

- MCP resource / endpoint: https://mcp.litofit.ru/mcp
- Transport: Streamable HTTP · JSON-RPC 2.0
- Protected resource discovery: https://mcp.litofit.ru/.well-known/oauth-protected-resource/mcp
- OAuth issuer: https://litofit.ru
- Authorization server discovery: https://litofit.ru/.well-known/oauth-authorization-server

## Minimal permissions

- full_access: All current and future LitoFit capabilities, including reading, changing and deleting data
- food:read: Read food diary and nutrition history
- food:write: Write, edit and delete food entries
- weight:read: Read weight and history
- weight:write: Record and delete weight measurements
- profile:read: Read permitted profile fields
- account:read: Read the complete personal profile
- profile:write: Change profile and goals
- notifications:read: Read notification preferences
- notifications:write: Change notification preferences
- food:resolve: Recognize food from text, photos and voice
- subscription:read: Read subscription and offers
- subscription:write: Start and manage a subscription

## Connection steps

1. Obtain explicit user permission. Request only needed scopes; food:read, weight:read and profile:read are reading permissions. Write scopes do not include read scopes.
2. Connecting requires an existing LitoFit account; website registration is unavailable. Prefer browser OAuth: read resource discovery and issuer discovery, use published endpoints, PKCE S256, state and the exact resource. The user enters their OTP on the LitoFit website; never ask them to forward it to chat.
3. Complete token exchange in the client after the browser callback. If OAuth is unsupported, the user may issue a PAT at https://litofit.ru/account/tokens/new and provide the secret only in protected Bearer/header settings, never a URL or public chat.
4. Perform the handshake for the client’s protocol version. Legacy 2025-11-25: initialize with protocolVersion, capabilities and clientInfo (name, version), then notifications/initialized; send subsequent requests with MCP-Protocol-Version: 2025-11-25 and the returned Mcp-Session-Id. Modern 2026-07-28: server/discover; every request includes params._meta["io.modelcontextprotocol/protocolVersion"] = "2026-07-28" and params._meta["io.modelcontextprotocol/clientCapabilities"] = {} (or the client’s actual capabilities). Required headers MCP-Protocol-Version: 2026-07-28 and MCP-Method must match metadata and method; tools/call also requires MCP-Name with the tool name. Modern does not use legacy initialize.
5. Call tools/list with metadata for the selected version. Connection is complete only after a valid handshake and tool list, not after website sign-in. Current tools/list descriptions and schemas define permitted arguments and limitations.

## Safety and boundaries

- Write permissions allow immediate changes; tool descriptions and user permission remain mandatory. Before every create_food call ask whether to save privately or propose for the shared catalogue (private / submit_for_review), and wait for an explicit answer.
- Before deletion identify the exact object and consequences. Never blindly repeat writes with an unknown outcome; first check the state using available tools.
- Write tools are marked in tools/list: readOnlyHint=false and annotations["io.modelcontextprotocol/action-metadata"] with requiresReview: true; deletions and subscription cancellation carry outcome: irreversible. A client that ignores annotations (for example, RikkaHub) will not ask on its own: turn on tool-call confirmation in it if it offers one, otherwise connect with read permissions only.
- Never bypass denial, revocation, expiry or scopes. Keep OTP, bearer and PAT out of URLs, logs, public examples and conversation history. Marketing copy is not permission to write.
