# 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 - MCP server: `https://app.krev.ai/mcp` - Authorization server: `https://app.krev.ai` - OAuth metadata: `https://app.krev.ai/.well-known/oauth-authorization-server` - Protected resource metadata: `https://app.krev.ai/.well-known/oauth-protected-resource` - Public setup page: `https://www.krev.ai/mcp` ## Standard connector flow ChatGPT, Claude, and any client with MCP OAuth discovery should add this remote server: ```text 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: ```json { "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" } ``` 3. Give the user only the returned `verification_uri_complete`. It expires after ten minutes. 4. Poll `POST https://app.krev.ai/oauth2/token` no faster than the returned interval with: ```text grant_type=urn:ietf:params:oauth:grant-type:device_code device_code= client_id= code_verifier= resource=https://app.krev.ai/mcp ``` 5. Treat `authorization_pending` as pending, `slow_down` as a signal to wait longer, and any denial, expiry, or reused-code response as terminal. 6. 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 - A signed-out or new customer uses Krev's normal signup and email verification. - A customer without MCP plan access sees Krev's normal checkout and post-purchase onboarding. - An existing eligible customer goes directly to the connection confirmation. - The confirmation names the AI client and account, lists the requested permissions, and requires explicit approval. - The pending link and device code are short-lived and single-use. The PKCE verifier binds the issued credential to the initiating client. ## Scopes | Scope | What it enables | | --- | --- | | `images` | Product photo generation, image editing, reference recreation, Amazon listing images | | `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 | | `social` | Social calendar, analytics, comments, and user-approved post actions | | `website` | Shopify theme reads and draft-theme edits | Every MCP request is checked against the connection owner, current Krev plan, and granted scopes. Connections can be revoked in Krev Settings under Agent Connections. ## 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`. Do not pass `overwrite: true` unless the user asked for a fresh analysis. ## Safety rules - Never ask the user to paste an access token, password, OTP, payment information, Shopify credential, or Meta credential into chat. - Generation tools spend the user's Krev credits. - Social and Meta mutation tools keep their existing propose-and-approve gates. - Website edits touch draft themes only. Publishing remains a separate user action.