UNPKG

mcp-use

Version:

Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.

29 lines 1.05 kB
/** * OAuth Setup * * Handles OAuth provider initialization and configuration for MCP servers. */ import type { Hono as HonoType, Context, Next } from "hono"; import type { OAuthProvider } from "./providers/types.js"; /** * OAuth setup state */ export interface OAuthSetupState { provider?: OAuthProvider; middleware?: (c: Context, next: Next) => Promise<Response | void>; complete: boolean; } /** * Setup OAuth authentication for MCP server * * Initializes OAuth provider, creates bearer auth middleware, * sets up OAuth routes, and applies auth to /mcp endpoints. * * @param app - Hono app instance * @param oauthProvider - OAuth provider instance * @param baseUrl - Server base URL for OAuth redirects * @param state - OAuth setup state to track completion * @returns Updated OAuth setup state with provider and middleware */ export declare function setupOAuthForServer(app: HonoType, oauthProvider: OAuthProvider, baseUrl: string, state: OAuthSetupState): Promise<OAuthSetupState>; //# sourceMappingURL=setup.d.ts.map