import { ClientMetadata, RegistrationResponse } from '../types/dcr.js'; import { ProtocolVersion } from '../types/protocol-version.js'; import { ClientIDMetadataHandler } from './client-id-metadata-handler.js'; import { AuthorizationServerMetadata } from '../types/oauth-discovery.js'; export type TransportType = 'stdio' | 'http'; export interface DCRClientConfig { transportType: TransportType; serverCommand?: string; serverArgs?: string[]; serverUrl?: string; initialAccessToken?: string; protocolVersion?: ProtocolVersion; } export declare class DCRClient { private client?; private config; private transport?; private authorizationServer?; private discoveryClient?; private discoveredRegistrationEndpoint?; private discoveredAuthorizationEndpoint?; private discoveredTokenEndpoint?; private protocolVersion; private clientIDMetadataHandler?; private authServerMetadata?; constructor(config: DCRClientConfig); /** * Connect to the MCP server and discover OAuth endpoints */ connect(): Promise; /** * Get the registration endpoint (from discovery) */ getRegistrationEndpoint(): string; /** * Get the authorization endpoint (from discovery) */ getAuthorizationEndpoint(): string; /** * Get the token endpoint (from discovery) */ getTokenEndpoint(): string; /** * Get the discovered authorization server */ getAuthorizationServer(): string | undefined; /** * Disconnect from the MCP server */ disconnect(): Promise; /** * Register a client with the DCR endpoint * Implements RFC 7591 Section 3.1 * * This is a direct HTTP POST to the OAuth registration endpoint, * NOT an MCP tool call. */ registerClient(metadata: ClientMetadata): Promise; /** * Read a client registration * Implements RFC 7592 Section 2 * * This is a direct HTTP GET to the registration client URI, * NOT an MCP tool call. */ readClient(registrationClientUri: string, accessToken: string): Promise; /** * Update a client registration * Implements RFC 7592 Section 3 * * This is a direct HTTP PUT to the registration client URI, * NOT an MCP tool call. */ updateClient(registrationClientUri: string, accessToken: string, metadata: ClientMetadata): Promise; /** * Delete a client registration * Implements RFC 7592 Section 4 * * This is a direct HTTP DELETE to the registration client URI, * NOT an MCP tool call. */ deleteClient(registrationClientUri: string, accessToken: string): Promise; /** * Get server info */ getServerInfo(): Promise<{ name: string; version: string; url?: string; authorizationServer?: string; protocolVersion?: ProtocolVersion; }>; /** * Get protocol version */ getProtocolVersion(): ProtocolVersion; /** * Get authorization server metadata */ getAuthServerMetadata(): AuthorizationServerMetadata | undefined; /** * Get Client ID Metadata handler (MCP 2025-11-25 only) */ getClientIDMetadataHandler(): ClientIDMetadataHandler | undefined; /** * Validate MCP 2025-11-25 support in authorization server * @private */ private validateMCP2025Support; } export declare class DCRError extends Error { code: string; description?: string | undefined; constructor(code: string, description?: string | undefined); } //# sourceMappingURL=dcr-client.d.ts.map