{"record":{"id":"440826770511511a","repo":"vercel/next.js","slug":"32000","errorCode":"-32000","errorMessage":"Internal server error","messagePattern":"Internal server error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"packages/next/src/cli/internal/turbo-trace-server.ts","lineNumber":264,"sourceCode":"      res.on('close', () => transport.close())\n      await mcpServer.connect(transport)\n      let body = ''\n      req.setEncoding('utf8')\n      await new Promise<void>((resolve, reject) => {\n        req.on('data', (chunk: string) => {\n          body += chunk\n        })\n        req.on('end', resolve)\n        req.on('error', reject)\n      })\n      await transport.handleRequest(\n        req,\n        res,\n        body ? JSON.parse(body) : undefined\n      )\n    } catch (err) {\n      if (!res.headersSent) {\n        res.writeHead(500, {\n          'Content-Type': 'application/json; charset=utf-8',\n        })\n        res.end(\n          JSON.stringify({\n            jsonrpc: '2.0',\n            error: { code: -32000, message: 'Internal server error' },\n            id: null,\n          })\n        )\n      }\n    }\n  })\n\n  server.on('error', (err: NodeJS.ErrnoException) => {\n    if (err.code === 'EADDRINUSE') {\n      console.error(\n        `Error: MCP port ${httpPort} is already in use. Use --mcp-port to specify a different port.`\n      )","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/cli/internal/turbo-trace-server.ts#L246-L282","documentation":"The turbo-trace-server's HTTP handler catches any failure while reading the request body, JSON-parsing it, or letting the MCP transport handle the request, then responds 500 with this generic JSON body; underlying error details are not forwarded to the client.","triggerScenarios":"Thrown at packages/next/src/cli/internal/turbo-trace-server.ts:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the trace server logs for the underlying error; retry the request or restart the trace server."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}