The aim of this study is to investigate the adsorption of mercaptopyridine (MCP) on the surface of pristine and Co doped boron phosphide (B12P12) nanocage using density functional theory. For this purpose, different positions of mercaptopyridine (MCP) are considered on the surface nanocage and then all the considered models are optimized using cam-B3LYP / Lanl2DZ method by Gaussian software (09). Using optimized structures, geometrical parameters, quantum, thermodynamic, and electronic parameters are calculated and the results are analyzed. The results showed that due to MCP adsorption, the electronic structure of the nanocage changes and the energy gap between HOMO and LUMO orbitals and global hardness of system decrease significantly, which increases the conductivity and reactivity of the nanocage. This results suggests that Co doped nanocage could be a good option for MCP sensors in biological systems. The calculated results of the adsorption energy and thermodynamic properties of the system show that the adsorption of the drug on the nanocage is favorable and this nanocage can be used as a carrier of the drug in the biological system in the human body. The results of quantum atom theory in molecules (QAIM) and reduced density gradient (RDG) parameters show that the bond of MRC drug on the surface of nanocage is electrostatic type.