auth.md

Krev MCP authentication

Krev uses one browser authorization flow for every MCP client. The user signs in, verifies their email, subscribes if needed, and explicitly approves the named AI client in Krev. Never ask the user to send credentials, payment details, provider credentials, or a Krev token through chat.

Service details

Standard connector flow

ChatGPT, Claude, and any client with MCP OAuth discovery should add this remote server:

https://app.krev.ai/mcp

The client discovers Krev's OAuth metadata, starts authorization code flow with PKCE S256, and opens the returned Krev browser URL. Krev returns the authorization code only after the user finishes account setup and approves the exact connection.

Agent-led browser flow

Clients without built-in connector OAuth should use the OAuth device authorization grant. The agent handles this protocol. The user only opens the browser approval link.

  1. Generate a fresh PKCE verifier locally and derive its S256 challenge.
  2. POST https://app.krev.ai/oauth2/device_authorization as JSON or form data with:
{
  "client_id": "a stable identifier for this AI client",
  "client_name": "the client name shown to the user",
  "client_account": "an optional account or workspace label",
  "code_challenge": "the base64url SHA-256 challenge",
  "code_challenge_method": "S256",
  "resource": "https://app.krev.ai/mcp",
  "scope": "images videos products credits ads social website agents email store"
}
  1. Give the user only the returned verification_uri_complete. It expires after ten minutes.
  2. Poll POST https://app.krev.ai/oauth2/token no faster than the returned interval with:
grant_type=urn:ietf:params:oauth:grant-type:device_code
device_code=<returned device code>
client_id=<same client id>
code_verifier=<original PKCE verifier>
resource=https://app.krev.ai/mcp
  1. Treat authorization_pending as pending, slow_down as a signal to wait longer, and any denial, expiry, or reused-code response as terminal.
  2. Keep the returned access token inside the client's secure credential store. Never print it, paste it into chat, or expose it to browser code.

Browser experience

Scopes

Scope What it enables
images Product photo generation, image editing, reference recreation
videos Product video generation
products Catalog lookup and product context
credits Credit balance and plan-aware generation settings
ads Ad generation, research, campaign diagnosis, and reviewable Meta changes. A bot's pauses follow the approval setting; spending, turning ads on, and deleting always ask
social Social calendar, analytics, comments, and post actions. Editing drafts and pausing posts happen directly; scheduling for later follows the approval setting; posting now, comment replies, deleting, and other social platform actions always ask
website Shopify theme reads, draft-theme edits, and approved draft deletion
agents Persistent bot conversations, their history and shared context, and the bot work lifecycle
email Rue's email work: designs, flows, the connected inbox, and the connected email platform. Saving and editing designs and flows, test sends to the merchant, pausing a flow, labeling inbox emails, and sending-domain setup happen directly; adding a design to Klaviyo follows the approval setting; turning a flow live, sending an inbox reply, deleting, and other email platform changes always ask
store Shopify store and connected business tools such as Search Console. Product copy (titles, descriptions, SEO fields) publishes directly; product media and routine product and collection edits follow the approval setting; discounts, deletes, publishing, and other store and business tool changes always ask

The approval setting is the account's choice in Krev. On Ask first, every change it covers asks the user. On Approve for me, Krev reviews each one, makes routine changes without asking, and asks for the rest.

Every MCP request is checked against the connection owner, current Krev plan, and granted scopes. Connections can be revoked in Krev Settings, under MCP.

The agents permission grants conversation and shared-memory access across the account's bots. It does not replace domain permissions: bot tools still enforce the original request's granted domains, including during peer work and after an approval. Existing connections do not gain this permission automatically. Start a new authorization flow to request it when needed.

Bot requests retain the originating connection's authority. Reconnecting to read a saved result does not restore permission to execute work from a revoked connection.

After connecting

Call brand_get_context once. If brand_dna_ready is false, ask for the user's website URL if needed and call brand_analyze_website. It runs in the background for one to three minutes; brand_get_context reports when it is ready or why it failed. Do not pass overwrite: true unless the user asked for a fresh analysis.

Safety rules