In this paper, we consider the following Kirchhoff–Schrödinger system in \({\mathbb {R}}^3\) : where \(a_1, a_2, b_1, b_2, \lambda \) are positive constants and \(\mu \) is a nonnegative constant. In the case where the potentials are constant functions, the second author of the current paper proved that this system admits a positive ground state solution when \(3<p\le q<6\) (subcritical case) and \(3<p<q=6\) (critical case) by using Nehari–Pohozaev manifold. In this paper we extend the result to the nonconstant potential case, that is, under certain assumptions on \(V_1(x), V_2(x)\) and \(\lambda ,\) we prove that this problem has a nontrivial ground state solution. The main ingredients of the proof are Jeanjean’s monotonicity trick and the global compactness lemma. In particular, we will show that when \(\mu \) is sufficiently large, the global compactness lemma is valid even in the critical case.