Tuberculosis (TB) is one of the leading causes of human deaths worldwide caused by infectious diseases. TB infection byMycobacterium tuberculosiscan occur in the lungs, causing pulmonary tuberculosis (PTB), or in any other organ of the body, resulting in extrapulmonary tuberculosis (EPTB). There is no consensus on the genetic determinants of this pathogen that may contribute to EPTB. In this study, we constructed theM.tuberculosispangenome and used it as a tool to seek genomic signatures associated with the clinical presentation of TB based on its accessory genome differences. The analysis carried out in the present study includes the raw reads of 490M. tuberculosisgenomes (PTBn= 245, EPTBn= 245) retrieved from public databases that were assembled, as well as ten genomes from Mexican strains (PTBn= 5, EPTBn= 5) that were sequenced and assembled. All genomes were annotated and then used to construct the pangenome with Roary and Panaroo. The pangenome obtained using Roary consisted of 2231 core genes and 3729 accessory genes. On the other hand, the pangenome resulting from Panaroo consisted of 2130 core genes and 5598 accessory genes. Associations between the distribution of accessory genes and the PTB/EPTB phenotypes were examined using the Scoary and Pyseer tools. Both tools found a significant association between thehspR,plcD,Rv2550c,pe_pgrs5,pe_pgrs25, andpe_pgrs57genes and the PTB genotype. In contrast, the deletion of theaceA,esxR,plcA, andppe50genes was significantly associated with the EPTB phenotype.Rv1759candRv3740were found to be associated with the PTB phenotype according to Scoary; however, these associations were not observed when using Pyseer. The robustness of the constructed pangenome and the gene–phenotype associations is supported by several factors, including the analysis of a large number of genomes, the inclusion of the same number of PTB/EPTB genomes, and the reproducibility of results thanks to the different bioinformatic tools used. Such characteristics surpass most of previousM. tuberculosispangenomes. Thus, it can be inferred that the deletion of these genes can lead to changes in the processes involved in stress response and fatty acid metabolism, conferring phenotypic advantages associated with pulmonary or extrapulmonary presentation of TB. This study represents the first attempt to use the pangenome to seek gene–phenotype associations inM. tuberculosis.