We develop a functional derivative approach to calculate the chemical potentials of second-order perturbation theory (MP2). In the functional derivative approach, the correlation part of the MP2 chemical potential, which is the derivative of the MP2 correlation energy with respect to the occupation number of frontier orbitals, is obtained from the chain rule via the noninteracting Green's function. First, the MP2 correlation energy is expressed in terms of the noninteracting Green's function, and its functional derivative to the noninteracting Green's function is the second-order self-energy. Then, the derivative of the noninteracting Green's function to the occupation number is obtained by including the orbital relaxation effect. We show that the MP2 chemical potentials obtained from the functional derivative approach agree with that obtained from the finite difference approach. The one-electron Hamiltonian, defined as the derivative of the MP2 energy with respect to the one particle density matrix, is also derived using the functional derivative approach, which can be used in the self-consistent calculations of MP2 and double-hybrid density functionals. The developed functional derivative approach is promising for calculating the chemical potentials and the one-electron Hamiltonian of approximate functionals and many-body perturbation approaches dependent explicitly on the noninteracting Green's function.