I am using pcbnew python module to read various information from the PCB board, similarly, is there is a function/API in pcbnew to generate the BOM file(including MPN if provided) for that particular board?
Maybe a function/API to call the BOM option in the below screenshot, through the Python Script.
I believe he meant, no MPN or MNF, the extrA fields provided in Eeschema. A BOM from PCBNew is possible, but also just primitive, not what OP seems to seek
One can generate a very limited BOM from pcbnew. However that BOM can only contain refdes, value and footprint name as nothing else is known to KiCad. I suspect it exists for users who work without schematic and have all necessary info in the value field (or have one unique footprint per component meaning the footprint name can be used as an additional field)
Or it was there from the very beginning when pcbnew was a standalone program and nobody questioned if it still makes sense to have this tool.