> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skybridge.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# descopeProvider

> Wire OAuth from a Descope MCP Server

`descopeProvider` wires authentication through a [Descope](https://www.descope.com/) MCP Server, so your tools receive a signed-in Descope user.

## Example

```ts server.ts highlight={1,6-8} theme={null}
import { Skybridge, descopeProvider } from "skybridge/server";

export const app = new Skybridge({
  name: "personal-shopper",
  version: "0.0.1",
  oauth: descopeProvider({
    url: process.env.DESCOPE_DISCOVERY_URL,
  }),
  handler,
});
```

## Signature

```ts theme={null}
descopeProvider(opts: DescopeProviderOptions): Promise<OAuthConfig>;
```

## Parameters

### `opts`

* **`url`** is the MCP Server's Discovery URL (its Issuer) from the console's Connection Information, for example `https://api.descope.com/v1/apps/agentic/<projectId>/<mcpServerId>`, or your custom domain.

* **`audience`** defaults to the Project ID parsed from the `/agentic/<projectId>/<mcpServerId>` segment of `url` (Descope binds the token's `aud` to `[DCR client id, project id]`). If `url` lacks that segment, such as a custom domain, pass `audience` explicitly or the server throws at startup.

It also accepts the shared [`CustomProviderOptions`](https://docs.skybridge.tech/api-reference/custom-provider#parameters) options: `baseUrl`, `serverUrl`, `scopes`, `requiredScopes`, and `metadataOverrides`.

Requires Dynamic Client Registration enabled on the MCP Server. With DCR disabled and the Alpic DCR proxy, use [`customProvider`](https://docs.skybridge.tech/api-reference/custom-provider) with `serverUrl` instead.

## Returns

A `Promise` for the [`OAuthConfig`](https://docs.skybridge.tech/api-reference/custom-provider#returns) you pass to the [`oauth`](https://docs.skybridge.tech/api-reference/skybridge#oauth) field, as a value or from a function.

> [card] [Connect an Identity Provider](https://docs.skybridge.tech/guides/auth-providers.md)
>
> Set up sign-in with a hosted provider

> [card] [Authenticate Users](https://docs.skybridge.tech/build/auth.md)
>
> Add sign-in to your app end to end

> [card] [customProvider](https://docs.skybridge.tech/api-reference/custom-provider.md)
>
> Wire OAuth from any IdP's discovery document


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.