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

Function protectedResourceMetadataUrlFor

apps/cloud/src/mcp/auth.ts:98–106  ·  view source on GitHub ↗
(
  organizationSelector: string | null,
  toolkitSlug: string | null = null,
)

Source from the content-addressed store, hash-verified

96
97/** The protected-resource-metadata URL for an org selector, or the bare one. */
98export const protectedResourceMetadataUrlFor = (
99 organizationSelector: string | null,
100 toolkitSlug: string | null = null,
101): string => {
102 const toolkitSuffix = toolkitSlug ? `/toolkits/${toolkitSlug}` : "";
103 return organizationSelector
104 ? `${RESOURCE_ORIGIN}/.well-known/oauth-protected-resource/${organizationSelector}/mcp${toolkitSuffix}`
105 : `${PROTECTED_RESOURCE_METADATA_URL}${toolkitSuffix}`;
106};
107
108type McpUnauthorizedReason = "missing_bearer" | "invalid_token";
109

Callers 3

resourceMetadataUrlFunction · 0.90
mount.test.tsFile · 0.90
bearerChallengeForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected