koala73/worldmonitor · error

Initialize error

Error message

Initialize error: ${initData.error.message}

What it means

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.

Solutions

  1. Read the embedded error.message: it is the upstream MCP server's own protocol error text
  2. Confirm the client's protocolVersion and clientInfo in the initialize payload are accepted by the server
  3. Update or reconfigure the MCP server if it rejects the negotiated protocol version
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at api/mcp-proxy.ts:315 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of koala73/worldmonitor@e586b8b4b8 (2026-08-21). Data as JSON: /api/errors/29558efd908f029d. Report an issue: GitHub.

Appendix: source

Thrown at api/mcp-proxy.ts:318

  const response = await fetch(url.toString(), {
    headers: {
      Accept: 'application/dns-json',
      'User-Agent': 'WorldMonitor-MCP-Proxy/1.0',
    },
    signal: signal ? AbortSignal.any([signal, dnsTimeout]) : dnsTimeout,
  });
  if (!response.ok) {
    throw new Error(`DNS ${recordType} lookup failed: HTTP ${response.status}`);
  }
  const data = await response.json();
  if (data?.Status !== 0) {
    throw new Error(`DNS ${recordType} lookup failed: status ${data?.Status}`);
  }
  const expectedType = recordType === 'A' ? 1 : 28;
  return (Array.isArray(data?.Answer) ? data.Answer : [])
    .filter(answer => answer?.type === expectedType && typeof answer?.data === 'string')
    .map(answer => answer.data);
}

async function defaultResolveHostname(hostname, signal) {
  const resolveHostnameForTest = getResolveHostnameForTest();
  if (resolveHostnameForTest) return resolveHostnameForTest(hostname, signal);
  const records = await Promise.all([
    resolveDnsJson(hostname, 'A', signal),
    resolveDnsJson(hostname, 'AAAA', signal),
  ]);
  return records.flat();
}

async function assertServerUrlSafe(url, signal) {
  signal?.throwIfAborted();
  const hostname = url.hostname.toLowerCase();
  if (BLOCKED_HOSTNAMES.has(hostname)) {
    throw new McpProxySsrfError('serverUrl hostname is blocked');
  }
  if (isBlockedResolvedAddress(hostname)) {

View on GitHub (pinned to e586b8b4b8)