Mc compile for Visual Studio toolchain

I want to build a DLL using gradle. I need to compile message file using VisualStudio mc compiler. I’ve found some mentions of rc compiler in Gradle documentation, but nothing about mc. Also I’ve found old topic: Native Windows: missing mc compiler.

Does modern gradle provide something about it? If not, can I write custom task to run mc with necessary parameters? I tried to extract Windows SDK directory from toolchain but without success. I got toolchain using the following snippet:

tasks.register("mc") {
    doLast {
        def compileDebugCppTask = tasks.named("compileDebugCpp")
        compileDebugCppTask.configure {
            def tc = toolChain
            println("mc " + tc)
        }
    }
}

but I wasn’t able to dig any further.