The application of current channelrhodopsin-based optogenetic tools is limited by the lack of strict ion selectivity and the inability to extend the spectra sensitivity into the near-infrared (NIR) tissue transmissible range. Here we present an NIR-stimulable optogenetic platform (termed "Opto-CRAC") that selectively and remotely controls Ca2+ oscillations and Ca2+-responsive gene expression to regulate the function of non-excitable cells, including T lymphocytes, macrophages and dendritic cells. When coupled to upconversion nanoparticles, the optogenetic operation window is shifted from the visible range to NIR wavelengths to enable wireless photoactivation of Ca2+-dependent signaling and optogenetic modulation of immunoinflammatory responses. In a mouse model of melanoma by using ovalbumin as surrogate tumor antigen, Opto-CRAC has been shown to act as a genetically-encoded "photoactivatable adjuvant" to improve antigen-specific immune responses to specifically destruct tumor cells. Our study represents a solid step forward towards the goal of achieving remote control of Ca2+-modulated activities with tailored function.