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

Function makeOAuthProvider

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

Source from the content-addressed store, hash-verified

481// ---------------------------------------------------------------------------
482
483const makeOAuthProvider = (accessToken: string): OAuthClientProvider => ({
484 get redirectUrl() {
485 return "http://localhost/oauth/callback";
486 },
487 get clientMetadata() {
488 return {
489 redirect_uris: ["http://localhost/oauth/callback"],
490 grant_types: ["authorization_code", "refresh_token"] as string[],
491 response_types: ["code"] as string[],
492 token_endpoint_auth_method: "none" as const,
493 client_name: "Executor",
494 };
495 },
496 clientInformation: () => undefined,
497 saveClientInformation: () => undefined,
498 tokens: () => ({ access_token: accessToken, token_type: "Bearer" }),
499 saveTokens: () => undefined,
500 redirectToAuthorization: async () => {
501 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: MCP SDK OAuthClientProvider callback can only signal reauthorization by throwing
502 throw new McpOAuthReauthorizationRequired({
503 message: "MCP OAuth re-authorization required",
504 });
505 },
506 saveCodeVerifier: () => undefined,
507 codeVerifier: () => {
508 // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: MCP SDK OAuthClientProvider callback requires a thrown verifier failure
509 throw new Error("No active PKCE verifier");
510 },
511 saveDiscoveryState: () => undefined,
512 discoveryState: () => undefined,
513});
514
515// ---------------------------------------------------------------------------
516// 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