McpCommand.kt•851 B
package maestro.cli.command
import picocli.CommandLine
import java.util.concurrent.Callable
import maestro.cli.mcp.runMaestroMcpServer
import java.io.File
import maestro.cli.util.WorkingDirectory
@CommandLine.Command(
name = "mcp",
description = [
"Starts the Maestro MCP server, exposing Maestro device and automation commands as Model Context Protocol (MCP) tools over STDIO for LLM agents and automation clients."
],
)
class McpCommand : Callable<Int> {
@CommandLine.Option(
names = ["--working-dir"],
description = ["Base working directory for resolving files"]
)
private var workingDir: File? = null
override fun call(): Int {
if (workingDir != null) {
WorkingDirectory.baseDir = workingDir!!.absoluteFile
}
runMaestroMcpServer()
return 0
}
}