The dynamics of forest-boundary-layer interactions over a forest edge have been an interesting research topic in recent years. A better understanding of edge flow has implications for the siting and interpretation of flux measurements near a forest edge. In the present study, we use large-eddy simulations with the newly developed multi-layer canopy model MCANOPY to investigate canopy flows, or more specifically scalar transfer, over a forest edge. Two important impact factors for edge flows are considered: the vertical distribution of foliage and the scalar source/sink distribution. The simulations show that both factors have non-ignored impacts on the scalar transfer over a forest edge. For plants with a deep, and sparse trunk space, a strong and long sub-canopy jet is observed, which qualitatively changes the flow dynamics and thus the scalar distributions. For relatively uniform distributed foliage plants, a strong flow convergence is found near the leading edge, which dominates the edge flow patterns and leads to a scalar flux peak region at the canopy top. Investigation has shown that the scalar concentrations are mainly affected by the flow advection rather than the turbulent for plants in our simulations with leaf area density of 4. The scalar fluxes are mainly affected by the vertical gradient of scalar concentration since the turbulence near a forest edge is qualitatively similar. In consistent with previous studies, the uniform ground scalar source shows the most pronounced spatial variations. While considering the source from the MCANOPY model that is close to reality, the behavior of scalars (i.e., CO2 and water vapor) is even more complicated owing to the interaction between flow dynamics and scalar source/sink distributions. It implies that both the scalar source distributions and canopy structures should be considered when interpreting flux measurement near a forest edge. The work here has important implications for interpreting measurement data and improves the understanding of scalar transfer over a forest edge.