INNER CODE UNIT · JavaScript

value

aeonfun/opendia · opendia-mcp/server.js:29

  const value = flag.slice(name.length + 1);
  if (value === '') usageError(`${name}= requires a value`);
  return value;
}

// Digits only — Number() would accept '0x1f' and parseInt() would accept '80abc'.
function portValue(name) {
  const raw = argValue(name);
  if (raw === null) return null;
  if (!/^\d+$/.test(raw) || raw < 1 || raw > 65535) {
    usageError(`${name}=${raw} is not a valid port (expected an integer 1-65535)`);
  }
  return Number(raw);
}

// `POST /sse` hands whatever it receives to handleMCPRequest, which drives the
// browser through the extension. Keep that surface on loopback by default; the
// extension reaches it at localhost and `ngrok http` connects from this machine

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…