# Rolino agent authentication

Rolino authenticates interactive clients with standard OAuth Authorization Code and PKCE. The CLI uses a pre-registered public client, an exact API resource, and an exact loopback redirect. Remote MCP clients use the protected-resource and authorization-server discovery chain for the exact MCP resource, then identify through Client ID Metadata Documents or rate-limited Dynamic Client Registration. Dynamic registration accepts only native public clients, safe loopback or private-use callbacks, supported scopes, and the Authorization Code flow. Client registration never grants workspace access. Each client host owns its callback and OAuth session. Blog Studio access is optional and separate: blog:read reads plans, articles, destinations, and delivery attempts; blog:write creates revisions, works with reviewed images, and moves eligible editorial calendar dates; blog:manage imports sites, creates the initial plan cadence, and configures publishing destinations; blog:approve confirms one exact revision and image bundle; and blog:publish previews or executes publication or scheduling only after separate exact-bundle approval. Active cadence changes require blog:write and a preview before execute. Item moves require blog:write and the current item version. These editorial operations never change scheduledPublishAt and never schedule, publish, or unpublish an article.

## Prerequisites

1. Install the CLI with `npm install --global @rolino/cli`.
2. Run `rolino --agent auth status`.
3. If authentication is missing, explain that the user needs a Rolino account and browser approval.
4. Only when the user wants to continue, run `rolino auth login` and let the user sign in, choose a workspace, and approve the requested capabilities in their browser.
5. After approval, rerun `rolino --agent auth status` and `rolino --agent projects list`.

The CLI stores a short-lived access token and rotating refresh token in an owner-only local OAuth store. Never copy either token into source code, prompts, logs, or chat. A credential from the removed interactive flow is not migrated; the first CLI use after the cutover requires a new sign-in. Headless automation continues to use scoped API keys.

## Capabilities

Existing credentials do not receive `seo:read` or any Backlinks capability automatically.

Connections can grant `identity:read`, `projects:read`, `projects:write`, `posts:read`, `posts:write`, `posts:schedule`, `posts:publish`, `integrations:read`, `calendar:read`, and the optional `seo:read` capability. Backlink prospecting adds independent `backlinks:read`, `backlinks:write`, and `backlinks:contacts` capabilities. Read access omits emails and draft bodies. Contact access requires read access. Rolino never sends email. Existing credentials receive no SEO or Backlinks capability automatically; the user must revoke and authorize a new connection to add one. Blog Studio adds independent `blog:read`, `blog:write`, `blog:manage`, `blog:approve`, and `blog:publish` capabilities. `blog:manage` inspects and configures publishing destinations but does not approve or publish an article. `blog:write` cannot approve or publish. `blog:approve` can approve one exact revision and image bundle but cannot publish. `blog:publish` does not grant approval and can publish or schedule only an unchanged approved bundle after its own preview and bound short-lived confirmation. Existing credentials receive no Blog capability automatically, including `blog:approve`. If a required capability is missing, stop and return to the user for a new browser authorization; do not work around the scope.

## MCP

Remote MCP clients connect to https://getrolino.com/mcp with Streamable HTTP. Start without a token, follow the returned `resource_metadata` link, discover the authorization server, and complete browser OAuth for the exact Rolino workspace and capabilities shown during consent. The canonical authorization-server metadata is https://getrolino.com/.well-known/oauth-authorization-server/api/auth and the MCP protected-resource metadata is https://getrolino.com/.well-known/oauth-protected-resource/mcp. Never send an API-resource token to MCP.

For Codex, use `codex mcp add rolino --url https://getrolino.com/mcp`, then `codex mcp login rolino`. This remote path does not require the Rolino CLI. Local STDIO remains available through `rolino setup mcp --client codex --transport stdio`; authenticate the Rolino CLI first only for that local mode.

See https://getrolino.com/docs/skill for the complete workflow and safety playbook.
