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

Function protectedResourceMetadataUrlFor

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

Source from the content-addressed store, hash-verified

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

Callers 3

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

Calls

no outgoing calls

Tested by

no test coverage detected