Without knowing more about your config it is hard to say. But here is a general setup.
Create Vlan interface on the MX? Example
10.0.2.0/24
10.0.2.1
Vlan 2
Then setup say port 1 on the MX as Trunk, native vlan 2, allowed vlans (2,and whatever else).
Then the uplink on the switch connected to Port 1 on the MX should also be trunk, native vlan 2, allowed vlans (match whatever you did above).
From the switch Tools>Ping you should be able to ping 10.0.2.1 provided you haven't setup any ACLs on the switches or Firewall rules on the MX.
Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.