import type { OAuthClientInformationFull, OAuthTokens } from "@modelcontextprotocol/client"; /** * Persisted OAuth state for ONE remote MCP server (RFC 8414/7591/6749 flow). * * - `clientInformation` is the dynamic client registration (RFC 7591) result — * reused across logins so the registered `redirect_uri` stays valid. * - `tokens` is the access/refresh pair; the MCP SDK refreshes it in place and * calls `saveTokens` so a logged-in server reconnects silently at startup. * - `codeVerifier` is the in-flight PKCE verifier, only meaningful between the * authorize redirect and the token exchange (`finishAuth`). * - `state` is the in-flight CSRF `state` value the loopback callback validates. */ export interface McpOAuthEntry { clientInformation?: OAuthClientInformationFull; tokens?: OAuthTokens; codeVerifier?: string; state?: string; } /** * File-backed store for remote-MCP OAuth credentials, living next to the CLI's * other auth at `~/.gg/mcp-auth.json`. Keyed by server name (the same identity * the config + UI use). Every read re-reads the file so concurrent sidecars / * windows see each other's logins; writes are read-modify-write so two servers * don't clobber one another. */ export declare class McpOAuthStore { private readonly filePath; constructor(filePath?: string); private readAll; private writeAll; get(name: string): Promise; /** Merge a partial entry into the server's record (read-modify-write). */ patch(name: string, patch: Partial): Promise; /** Drop a server's whole OAuth record (used on logout / removal). */ clear(name: string): Promise; /** Whether this server has saved tokens (i.e. has completed login at least once). */ hasTokens(name: string): Promise; } //# sourceMappingURL=oauth-store.d.ts.map