MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / makeOAuthProvider

Function makeOAuthProvider

packages/plugins/mcp/src/sdk/plugin.ts:622–652  ·  view source on GitHub ↗
(accessToken: string)

Source from the content-addressed store, hash-verified

620// ---------------------------------------------------------------------------
621
622const makeOAuthProvider = (accessToken: string): OAuthClientProvider => ({
623 get redirectUrl() {
624 return "http://localhost/oauth/callback";
625 },
626 get clientMetadata() {
627 return {
628 redirect_uris: ["http://localhost/oauth/callback"],
629 grant_types: ["authorization_code", "refresh_token"] as string[],
630 response_types: ["code"] as string[],
631 token_endpoint_auth_method: "none" as const,
632 client_name: "Executor",
633 };
634 },
635 clientInformation: () => undefined,
636 saveClientInformation: () => undefined,
637 tokens: () => ({ access_token: accessToken, token_type: "Bearer" }),
638 saveTokens: () => undefined,
639 redirectToAuthorization: async () => {
640 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: MCP SDK OAuthClientProvider callback can only signal reauthorization by throwing
641 throw new McpOAuthReauthorizationRequired({
642 message: "MCP OAuth re-authorization required",
643 });
644 },
645 saveCodeVerifier: () => undefined,
646 codeVerifier: () => {
647 // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: MCP SDK OAuthClientProvider callback requires a thrown verifier failure
648 throw new Error("No active PKCE verifier");
649 },
650 saveDiscoveryState: () => undefined,
651 discoveryState: () => undefined,
652});
653
654// ---------------------------------------------------------------------------
655// Connector input — render the integration config + the connection's resolved

Callers 1

buildConnectorInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected