Catalysis of the reaction: acyl-CoA + acceptor = 2,3-dehydroacyl-CoA + reduced acceptor, where the acyl group is a medium-chain fatty acid residue. A medium chain fatty acid is any fatty acid with a chain length of between C6 and C12.