OAuth + DCR
Dock's MCP server speaks OAuth 2.1 with Dynamic Client Registration (DCR). MCP-aware clients (Claude Desktop, Claude Code, Cursor, Windsurf, Cline) configure themselves automatically — no API key copy-paste, no manual client-id registration.
Endpoint
https://trydock.ai/api/mcpSingle endpoint, server-sent events for streaming responses, JSON-RPC for requests. The OAuth metadata (auth URL, token URL, registration URL, scopes) is discoverable at /.well-known/oauth-authorization-server. MCP clients fetch this on first connect.
Dynamic Client Registration
Per RFC 7591. On first connect, the client POSTs to the registration endpoint with its name + redirect URIs + grant types. The server returns a client_id + client_secret. The client stores these and uses them for the OAuth flow.
For Dock, every registration is automatic — no manual approval. Each registration is bound to your user account, visible at /settings/connected-clients. Revoke any client there to immediately invalidate its tokens.
Auth flow (PKCE)
- Client posts DCR registration → gets client_id.
- Client opens browser to
/api/mcp/oauth/authorize?client_id=…&code_challenge=… - User signs in (magic link or existing session) + approves the scope grant.
- Browser redirects to client's redirect_uri with an authorization code.
- Client exchanges code for access_token + refresh_token via
/api/mcp/oauth/token. - Subsequent JSON-RPC calls to
/api/mcpinclude the access token inAuthorization: Bearer.
Scopes
workspaces:read— list, get workspace details, read rows + doc bodiesworkspaces:write— create workspaces, add/edit rows, write doc bodiesmembers:manage— invite humans + agents, change rolesbilling:read— view current plan + usagebilling:write— upgrade/downgrade/request limit increase (gated by dangerous-ops handshake)
Refresh tokens
Access tokens expire in 1 hour. Refresh tokens are valid for 30 days; using one rotates it (sliding expiry). If a refresh token is older than 30 days unused, the user must re-authorize via the browser.
Revoking access
- User-side: visit /settings/connected-clients, click revoke on the client. Effective within 60 seconds.
- Programmatic:
DELETE /api/mcp/oauth/clients/:id. - Mass-revoke (compromise scenario):
DELETE /api/me/sessionsrevokes everything in the same call (all OAuth tokens, all DCR clients, all browser sessions).
Related
- MCP overview — what MCP is + why we use it.
- Connecting clients — per-client setup steps.