> ## 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.

# workosProvider

> Wire OAuth from WorkOS AuthKit

`workosProvider` wires authentication through [WorkOS AuthKit](https://www.workos.com/), so your tools receive a signed-in WorkOS user.

## Example

```ts server.ts highlight={1,7-10} theme={null}
import { McpServer, workosProvider } from "skybridge/server";

const server = new McpServer(
  { name: "personal-shopper", version: "0.0.1" },
  { capabilities: {} },
  {
    oauth: await workosProvider({
      domain: process.env.AUTHKIT_DOMAIN,
      audience: process.env.SERVER_URL,
    }),
  },
);
```

## Signature

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

## Parameters

### `opts`

* **`domain`** is the AuthKit domain, for example `acme.authkit.app`.

* **`audience`** is the [Resource Indicator](https://datatracker.ietf.org/doc/html/rfc8707) configured in the WorkOS dashboard, typically this server's public URL. AuthKit binds it into the token's `aud` claim.

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

Requires Dynamic Client Registration enabled in the WorkOS dashboard (Connect → Configuration).

## Returns

A `Promise` for the [`OAuthConfig`](/api-reference/custom-provider#returns) you pass to the [`oauth`](/api-reference/mcp-server#constructor) constructor option.

<CardGroup cols={3}>
  <Card title="Connect an Identity Provider" icon="fingerprint" href="/guides/auth-providers">
    Set up sign-in with a hosted provider
  </Card>

  <Card title="Authenticate Users" icon="key" href="/build/auth">
    Add sign-in to your app end to end
  </Card>

  <Card title="customProvider" icon="key-round" href="/api-reference/custom-provider">
    Wire OAuth from any IdP's discovery document
  </Card>
</CardGroup>
