@mcp-z/client
    Preparing search index...

    Class DcrAuthenticator

    DcrAuthenticator manages authentication for MCP HTTP servers Handles DCR registration, OAuth flows, and token management

    Index
    • Delete stored tokens for a server

      Parameters

      • baseUrl: string

      Returns Promise<void>

    • Ensure server is authenticated, performing DCR and OAuth if needed Proactively refreshes tokens if they're within 5 minutes of expiry

      Parameters

      Returns Promise<TokenSet>

      Valid token set ready to use

      Error if authentication fails

      const authenticator = new DcrAuthenticator({ redirectUri: 'http://localhost:3000/callback' });
      const tokens = await authenticator.ensureAuthenticated(
      'https://example.com',
      capabilities
      );