{"record":{"id":"29558efd908f029d","repo":"koala73/worldmonitor","slug":"initialize-error-initdata-error-message","errorCode":null,"errorMessage":"Initialize error: ${initData.error.message}","messagePattern":"Initialize error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":422,"severity":"error","filePath":"api/mcp-proxy.ts","lineNumber":318,"sourceCode":"  const response = await fetch(url.toString(), {\n    headers: {\n      Accept: 'application/dns-json',\n      'User-Agent': 'WorldMonitor-MCP-Proxy/1.0',\n    },\n    signal: signal ? AbortSignal.any([signal, dnsTimeout]) : dnsTimeout,\n  });\n  if (!response.ok) {\n    throw new Error(`DNS ${recordType} lookup failed: HTTP ${response.status}`);\n  }\n  const data = await response.json();\n  if (data?.Status !== 0) {\n    throw new Error(`DNS ${recordType} lookup failed: status ${data?.Status}`);\n  }\n  const expectedType = recordType === 'A' ? 1 : 28;\n  return (Array.isArray(data?.Answer) ? data.Answer : [])\n    .filter(answer => answer?.type === expectedType && typeof answer?.data === 'string')\n    .map(answer => answer.data);\n}\n\nasync function defaultResolveHostname(hostname, signal) {\n  const resolveHostnameForTest = getResolveHostnameForTest();\n  if (resolveHostnameForTest) return resolveHostnameForTest(hostname, signal);\n  const records = await Promise.all([\n    resolveDnsJson(hostname, 'A', signal),\n    resolveDnsJson(hostname, 'AAAA', signal),\n  ]);\n  return records.flat();\n}\n\nasync function assertServerUrlSafe(url, signal) {\n  signal?.throwIfAborted();\n  const hostname = url.hostname.toLowerCase();\n  if (BLOCKED_HOSTNAMES.has(hostname)) {\n    throw new McpProxySsrfError('serverUrl hostname is blocked');\n  }\n  if (isBlockedResolvedAddress(hostname)) {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/api/mcp-proxy.ts#L300-L336","documentation":"Thrown during MCP session bootstrap when the initialize request succeeded at the HTTP level but the JSON-RPC response payload carried a top-level error object. The MCP server itself reported a protocol-level failure (unsupported protocol version, malformed init payload, server-side refusal), distinct from a transport/HTTP failure.","triggerScenarios":"Thrown at api/mcp-proxy.ts:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded error.message: it is the upstream MCP server's own protocol error text","Confirm the client's protocolVersion and clientInfo in the initialize payload are accepted by the server","Update or reconfigure the MCP server if it rejects the negotiated protocol version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e586b8b4b80f595aa7ece295eec10d76f2921240","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}