The characterization of near-infrared (NIR) mesoporous silica nanoparticles (MSN) suitable for in vivo optical imaging with high efficiency is presented. Trimethylammonium groups modified MSN (MSN-TA) with the average size of 50–100 nm was synthesized with incorporation of the TA groups into the framework of MSN. It was further adsorbed with indocyanine green (ICG) by electrostatic attraction to render MSN-TA-ICG as an efficient NIR contrast agent for in vivo optical imaging. The studies in stability of MSN-TA-ICG against pH indicated the bonding is stable over the range from acidic to physiological pH. The in vivo biodistribution of MSN-TA-ICG in anesthetized rat demonstrated a rather strong and stable fluorescence of MSN-TA-ICG that prominent in the organ of liver. Transmission electron microscopy (TEM) imaging and elemental analysis of silicon further manifested the physical and quantitative residences of MSN-TA-ICG in major organs. This is the first report of MSN functionalized with NIR-ICG capable of optical imaging in vivo.