import { type RedirectUpstream } from "./upstream.js"; /** Options for {@link github}. */ export interface GitHubUpstreamOptions { /** Client ID of the GitHub OAuth app. */ clientId: string; /** Client secret of the GitHub OAuth app. It stays on the server. */ clientSecret: string; /** * GitHub OAuth scopes to request, for example `["read:user", "repo"]`. * * @defaultValue `["read:user"]` */ scopes?: readonly string[]; /** * Base URL of the GitHub web host, for GitHub Enterprise Server or a test * emulator. * * @defaultValue `"https://github.com"` */ baseUrl?: string; /** * Base URL of the GitHub REST API. It receives the user's access token, so * it must use HTTPS (HTTP only on localhost). * * @defaultValue `"https://api.github.com"`, or `baseUrl` when `baseUrl` is set */ apiUrl?: string; } /** * Creates a GitHub upstream for `oauthProxy`. * * Register an OAuth app at GitHub with the callback URL * `https:///mcp/oauth/callback` (the MCP base path plus * `/oauth/callback`). The user's subject is the numeric GitHub user id, and * the profile holds `id`, `login`, `name`, `email`, and `avatar_url`. * * @param options - OAuth app credentials and scopes. * @returns An upstream for `oauthProxy`. * * @example * ```ts * import { github, oauthProxy } from "mcp-use/oauth"; * * const oauth = oauthProxy({ * upstream: github({ * clientId: process.env.GITHUB_CLIENT_ID!, * clientSecret: process.env.GITHUB_CLIENT_SECRET!, * scopes: ["read:user", "repo"], * }), * }); * ``` */ export declare function github(options: GitHubUpstreamOptions): RedirectUpstream; /** Options for {@link google}. */ export interface GoogleUpstreamOptions { /** Client ID of the Google OAuth client (type "Web application"). */ clientId: string; /** Client secret of the Google OAuth client. It stays on the server. */ clientSecret: string; /** * Google scopes to request. `openid` is always added. * * @defaultValue `["openid", "email", "profile"]` */ scopes?: readonly string[]; /** * Base URL of a Google-compatible test emulator. When set, every endpoint * and the issuer move to this URL. */ baseUrl?: string; } /** * Creates a Google upstream for `oauthProxy`. * * Add `https:///mcp/oauth/callback` as an authorized redirect * URI of the OAuth client. The proxy requests offline access so it can * refresh Google tokens on the server; if Google returns no refresh token * and none is stored for the user, it asks Google for consent once more. * The user's subject is the OpenID Connect `sub`. * * @param options - OAuth client credentials and scopes. * @returns An upstream for `oauthProxy`. */ export declare function google(options: GoogleUpstreamOptions): RedirectUpstream;