import { Express, Response } from 'express'; import { InstantAdminDatabase, InstaQLEntity, InstaQLResult } from '@instantdb/admin'; import { AppSchema } from './db/instant.schema.ts'; import { AuthorizationParams, OAuthServerProvider } from '@modelcontextprotocol/sdk/server/auth/provider.js'; import { OAuthRegisteredClientsStore } from '@modelcontextprotocol/sdk/server/auth/clients.js'; import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js'; import { KeyConfig } from './crypto.ts'; import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js'; import { PlatformApiAuth } from '../../platform/dist/esm/api.js'; export type OAuthConfig = { clientId: string; clientSecret: string; serverOrigin: string; }; export declare function tokensOfBearerToken(db: InstantAdminDatabase, token: string): Promise<{ mcpToken: InstaQLResult['mcpTokens'][number]; instantToken: InstaQLEntity; }>; export declare function makeApiAuth(oauthConfig: OAuthConfig, key: KeyConfig, db: InstantAdminDatabase, instantTokenEnt: InstaQLEntity): PlatformApiAuth; export declare class ServiceProvider implements OAuthServerProvider { #private; constructor(db: InstantAdminDatabase, oauthConfig: OAuthConfig, keyConfig: KeyConfig); get clientsStore(): OAuthRegisteredClientsStore; authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; challengeForAuthorizationCode(_client: OAuthClientInformationFull, authorizationCode: string): Promise; exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string, redirectUri?: string): Promise; exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, _scopes?: string[]): Promise; verifyAccessToken(token: string): Promise; revokeToken(_client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; } export declare function addOAuthRoutes(app: Express, db: InstantAdminDatabase, oauthConfig: OAuthConfig): void; //# sourceMappingURL=oauth-service-provider.d.ts.map