{"record":{"id":"90a7904a50456910","repo":"different-ai/openwork","slug":"an-enterprise-mcp-server-url-cannot-contain-creden","errorCode":null,"errorMessage":"An enterprise MCP server URL cannot contain credentials or a fragment.","messagePattern":"An enterprise MCP server URL cannot contain credentials or a fragment\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/enterprise-mcp-client/src/requirements-discovery.ts","lineNumber":193,"sourceCode":"    requirements.unshift({\n      code: \"oauth_client_registration\",\n      label: \"Register an OAuth client\",\n      reason: \"The authorization server does not advertise client metadata documents or dynamic registration.\",\n      required: true,\n    })\n  }\n  return requirements\n}\n\nexport async function discoverConnectionRequirements(\n  input: DiscoverEnterpriseMcpConnectionRequirementsInput,\n): Promise<EnterpriseMcpConnectionRequirements> {\n  const serverUrl = new URL(input.serverUrl)\n  if (serverUrl.protocol !== \"http:\" && serverUrl.protocol !== \"https:\") {\n    throw new Error(\"An enterprise MCP server URL must use HTTP or HTTPS.\")\n  }\n  if (serverUrl.username || serverUrl.password || serverUrl.hash) {\n    throw new Error(\"An enterprise MCP server URL cannot contain credentials or a fragment.\")\n  }\n\n  const controller = new AbortController()\n  const timeout = setTimeout(() => controller.abort(new Error(\"MCP requirements discovery timed out.\")), input.timeoutMs ?? DEFAULT_TIMEOUT_MS)\n  let lastStatus: number | undefined\n  let resourceMetadataUrl: URL | undefined\n  let challengeScope: string | undefined\n  const fetch = scopedFetch({\n    fetch: input.fetch,\n    signal: controller.signal,\n    observe: (response) => {\n      lastStatus = response.status\n      if (response.status !== 401 && response.status !== 403) return\n      const challenge = extractWWWAuthenticateParams(response)\n      resourceMetadataUrl = challenge.resourceMetadataUrl ?? resourceMetadataUrl\n      challengeScope = challenge.scope ?? challengeScope\n    },\n  })","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/packages/enterprise-mcp-client/src/requirements-discovery.ts#L175-L211","documentation":"Error \"An enterprise MCP server URL cannot contain credentials or a fragment.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at packages/enterprise-mcp-client/src/requirements-discovery.ts:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}