AI & MCP

AI is a core module — every project has it. It is bring-your-own-key: each project owns a catalogue of providers, and keys are sealed at rest with AES-256-GCM (SVITRIO_SECRETS_KEY); lists mask them to a sk…abcd hint.

Providers

A provider carries a kind, an API key, an optional model and base_url, and the capabilities it’s enabled for. Built-in kinds and their defaults:

  • anthropic / claude → native /v1/messages, default claude-sonnet-4-6.

  • openaigpt-4o-mini; deepseekdeepseek-chat; mistralmistral-large-latest.

  • qwenqwen-plus; zaiglm-4.6.

  • Any OpenAI-compatible endpoint via base_url (vLLM, Ollama, gateways).

One provider per project can be is_default (enforced transactionally — never two at once).

Inline translate

The editor’s “Translate with AI” button calls the default (or a chosen) provider. The system prompt is fenced to return only the translated string and to preserve placeholders ({var}, %s), HTML and markdown; 1024 max tokens, 30s timeout, upstream errors surfaced verbatim.

The MCP server

Any MCP client (Claude Desktop, Cursor, claude.ai) can connect over JSON-RPC at POST /mcp, authenticated by an MCP token or the OAuth 2.1 flow (Dynamic Client Registration + PKCE S256). Every call re-resolves the token’s project scope. Tools:

  • list_pages, list_locales, get_page (returns each block’s data, its translatable-field catalogue, and existing overrides).

  • set_translation_meta (per-locale title/slug) and set_translation_block (per-block field overrides).

Prompts: translate_page, summarize_page, generate_alt_text. So an agent can translate a whole site, or your team can click buttons — from the same configuration.