In the 2030s, space-based gravitational-wave (GW) detectors will exhibit unprecedented sensitivity in the millihertz frequency band, greatly expanding the potential for testing theories of gravity compared to ground-based GW detectors. Inspired by effective string theory, Einstein-dilaton Gauss–Bonnet (EdGB) gravity introduces an extra dilaton scalar field that is directly coupled to higher curvature terms. Here, we investigate the capability of Taiji to constrain the parameters of EdGB gravity by analyzing GWs from massive black hole binaries (MBHBs). We utilize the parameterized post-Einsteinian (ppE) waveform with the leading order EdGB corrections for the inspiral phase of MBHBs. The constraints on the coupling constants are obtained by performing Fisher matrix analysis. With different mass ratios and spins χi\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\chi _i$$\\end{document} at redshifts z=2,3,4,5\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$z=2,3,4,5$$\\end{document}, the 1σ\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$1\\sigma $$\\end{document} bounds on the parameter α\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\alpha $$\\end{document} have the same order of magnitude: α∼107\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\sqrt{\\alpha }\\sim 10^7$$\\end{document} m.