Merge pull request #164 from bensenescu/codex/fix-invalid-offlineaccess-scope

fix: support claude for mcp
This commit is contained in:
Ben Senescu 2026-05-08 14:18:59 -04:00 committed by GitHub
commit f861d1d57e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -5,11 +5,10 @@ import { getActiveOrganizationId } from "@/lib/auth-session";
import {
getMcpOrganizationIdClaim,
getMcpResource,
MCP_OAUTH_SCOPES,
MCP_SCOPE,
} from "@/lib/oauth-resource";
const MCP_OAUTH_SCOPES = ["offline_access", MCP_SCOPE];
function assertSingleMcpAudience(audiences: string[]) {
if (audiences.length !== 1) {
throw new Error(

View File

@ -1,5 +1,6 @@
const MCP_RESOURCE_PATH = "/mcp";
export const MCP_SCOPE = "mcp";
export const MCP_OAUTH_SCOPES = ["offline_access", MCP_SCOPE];
export function getMcpResource(baseUrl: string) {
return new URL(MCP_RESOURCE_PATH, baseUrl).toString();

View File

@ -3,7 +3,7 @@ import { env } from "cloudflare:workers";
import { getHostedBaseUrl, hasHostedAuthConfig } from "@/lib/auth";
import { isHostedAuthMode } from "@/lib/auth-mode";
import { getOAuthProviderResourceActions } from "@/lib/oauth-provider-resource-client";
import { getMcpResource, MCP_SCOPE } from "@/lib/oauth-resource";
import { getMcpResource, MCP_OAUTH_SCOPES } from "@/lib/oauth-resource";
function unavailableMetadataResponse() {
if (!isHostedAuthMode(env.AUTH_MODE)) {
@ -30,7 +30,7 @@ export const Route = createFileRoute(
await getOAuthProviderResourceActions().getProtectedResourceMetadata({
resource: getMcpResource(baseUrl),
authorization_servers: [`${baseUrl}/api/auth`],
scopes_supported: [MCP_SCOPE],
scopes_supported: [...MCP_OAUTH_SCOPES],
resource_name: "OpenSEO MCP",
});