INNER CODE UNIT · JavaScript

handleMCPRequest

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

async function handleMCPRequest(request) {
  const { method, params, id } = request;

  // Handle notifications (no id means it's a notification)
  if (!id && method && method.startsWith("notifications/")) {
    console.error(`Received notification: ${method}`);
    return null; // No response needed for notifications
  }

  // Handle requests that don't need implementation
  if (id === undefined || id === null) {
    return null; // No response for notifications
  }

  try {
    let result;

    switch (method) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…