Skip to main content
stytchProvider wires authentication through Stytch Connected Apps, so your tools receive a signed-in Stytch user.

Example

server.ts
import { McpServer, stytchProvider } from "skybridge/server";

const server = new McpServer(
  { name: "personal-shopper", version: "0.0.1" },
  { capabilities: {} },
  {
    oauth: await stytchProvider({
      domain: process.env.STYTCH_DOMAIN,
      audience: process.env.STYTCH_PROJECT_ID,
    }),
  },
);

Signature

stytchProvider(opts: StytchProviderOptions): Promise<OAuthConfig>;

Parameters

opts

  • domain is the project domain, for example acme.customers.stytch.dev, or a configured custom domain.
  • audience is the Stytch Project ID, the audience Stytch binds into the token’s aud claim.
It also accepts the shared CustomProviderOptions options: baseUrl, serverUrl, scopes, requiredScopes, and metadataOverrides. Requires Dynamic Client Registration enabled in the Stytch dashboard.

Returns

A Promise for the OAuthConfig you pass to the oauth constructor option.

Connect an Identity Provider

Set up sign-in with a hosted provider

Authenticate Users

Add sign-in to your app end to end

customProvider

Wire OAuth from any IdP’s discovery document