---
description: "Discover Dream Workforce and connect an MCP client with OAuth 2.0 and PKCE."
title: "Sign in to Dream Workforce from an MCP client"
canonical: "https://usedream.ai/auth.md"
last-updated: "2026-12-04T16:54:02.323Z"
---

# Sign in to Dream Workforce from an MCP client

## Discover

The Streamable HTTP server is [https://apiv2.usedream.ai/mcp](https://apiv2.usedream.ai/mcp). An unauthenticated request returns a 401 with a `WWW-Authenticate` Bearer challenge containing `resource_metadata`. Follow it to the [protected resource metadata](https://apiv2.usedream.ai/.well-known/oauth-protected-resource/mcp), then read the [authorization server metadata](https://apiv2.usedream.ai/.well-known/oauth-authorization-server) on the advertised issuer.

## Pick a method

Use OAuth 2.0 Authorization Code with PKCE (S256), the Dream MCP resource URL and the `jobs` scope. Dream uses standard OAuth for MCP, not the WorkOS `agent_auth` extension: there is no `identity_endpoint`, `identity_assertion`, `service_auth` or `id-jag` flow.

## Register

If your client does not already have a client ID, use the advertised [dynamic registration endpoint](https://apiv2.usedream.ai/register). Send a POST with your client's redirect URIs and save the returned client ID and metadata.

## Claim

There is no separate claim endpoint. Open the advertised [authorization endpoint](https://apiv2.usedream.ai/authorize) in the user's browser with your registered redirect URI, your S256 code challenge, state, scope and resource. The user signs in and approves access in Dream. Verify state when the authorization code returns to your redirect URI.

## Exchange

POST the authorization code, the original PKCE verifier and matching redirect URI to the [token endpoint](https://apiv2.usedream.ai/token), using your registered client authentication method. Store the access token securely. Dream does not issue refresh tokens: access tokens do not automatically expire and can be revoked.

## Use the access_token

Send `Authorization: Bearer <access_token>` on each request to the Dream MCP endpoint. Never share the token in chat or in a URL. Start with MCP's `initialize` and use `tools/list` for the current tools.

## Errors

For a 401, read the `WWW-Authenticate` challenge and reconnect if the token is missing or no longer valid. A 403 means a valid token does not have access, for example because it lacks the required scope or the Dream account is deactivated.

## Revocation

Disconnect the agent in Dream under Settings → Connected agents, or use the advertised [token revocation endpoint](https://apiv2.usedream.ai/revoke) with your registered client details.
