Skip to content

Sign in with OAuth

After this page you know how an app that supports MCP OAuth connects to CountViews with no pasted key, what the person approves, and what the app ends up holding. The result is an ordinary cvk_… key, so everything in Set up MCP and REST applies to it.

  1. The app calls https://countviews.com/mcp with no key and gets 401 with WWW-Authenticate: Bearer resource_metadata="…", scope="…".
  2. It reads the discovery documents below, registers itself, makes a PKCE pair and sends the person to /oauth/authorize.
  3. The person signs in (they need the right to manage API access) and sees one consent screen: which workspace, the app’s name next to the address the browser will return to, and a checkbox per permission.
  4. The app exchanges the one-time code for a key at /api/oauth/token.
Document or endpoint Address
Protected resource (RFC 9728) /.well-known/oauth-protected-resource (also …/mcp and …/api/public/v1/mcp; each names the address you asked about)
Authorization server (RFC 8414) /.well-known/oauth-authorization-server
Dynamic client registration (RFC 7591) POST /api/oauth/register
Authorize (consent screen) /oauth/authorize
Token POST /api/oauth/token
Revoke (RFC 7009) POST /api/oauth/revoke

Rules a client must follow:

  • Grant type authorization_code only. PKCE with S256 is required; plain is refused. Clients are public (no client secret).
  • Send resource as https://countviews.com/mcp or the long alias; any other value is invalid_target.
  • A redirect_uri is https, or http on localhost, 127.0.0.1 or [::1] (the port is ignored for those). It must match what you registered, byte for byte. Custom schemes such as cursor:// are not accepted, which is why Cursor connects with a key.
  • The code lives 60 seconds and works once. Present it twice and, if the verifier is right, the key it produced is revoked.

Only the read permissions are ticked by default. Writing drafts, deciding clips, setting up the company and requesting invoices are each an unticked box. If the person ticks launching, the key still asks them on every launch unless they also give it limits. See Permissions and Money and approvals.

The app’s name is whatever it registered. CountViews does not verify who makes it, and the screen says so.

One key exists per app, person and workspace; signing in again from the same app replaces its key. A workspace holds at most 5 live keys, and OAuth keys count.

  • In the workspace, Agent: the key is listed as a sign-in from the app’s name. Revoke it there; the next request is 401.
  • The app can revoke its own token at /api/oauth/revoke. The answer is the same whether the token was live, revoked or unknown.
Checked Not checked
The official MCP SDK client (@modelcontextprotocol/client 2.3.1) completed the whole path against these endpoints: 401, discovery, registration, PKCE, consent, code exchange, tools/list, whoami. The races (twelve parallel exchanges of one code give one key) are tested on a real database. Live ChatGPT, claude.ai and Claude Code sign-in against production have not been run. The menu names in the wizard recipes for these apps come from vendor documentation and may be out of date. Client ID Metadata Documents are not supported; registration is dynamic only.

If an app cannot sign in, make a key in the workspace and use the key recipes.