We have developed a surface-enhanced Raman scattering (SERS) nanosensor firstly for Ag ions and Ag nanoparticles detection based on 2-mercaptoisonicotinic acid (2MNA)-functionalized Au nanoparticles. Ag(+) can coordinate with 2MNA resutling in a variation of its SERS spectrum, which is used as a criterion to determine Ag(+) in a solution. This sensor exhibits a detection limit no more than 25 nM and has a high selectivity against other metal ions. More importantly, it can be directly applied in real sample detection.