@@ -3,7 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
33import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js" ;
44import { VERSION } from "@trigger.dev/core" ;
55import { tryCatch } from "@trigger.dev/core/utils" ;
6- import { Command } from "commander" ;
6+ import { Command , Option as CommandOption } from "commander" ;
77import { z } from "zod" ;
88import { CommonCommandOptions , commonOptions , wrapCommandAction } from "../cli/common.js" ;
99import { CLOUD_API_URL } from "../consts.js" ;
@@ -14,11 +14,14 @@ import { printStandloneInitialBanner } from "../utilities/initialBanner.js";
1414import { logger } from "../utilities/logger.js" ;
1515import { installMcpServer } from "./install-mcp.js" ;
1616import { serverMetadata } from "../mcp/config.js" ;
17+ import { initiateRulesInstallWizard } from "./install-rules.js" ;
1718
1819const McpCommandOptions = CommonCommandOptions . extend ( {
1920 projectRef : z . string ( ) . optional ( ) ,
2021 logFile : z . string ( ) . optional ( ) ,
2122 devOnly : z . boolean ( ) . default ( false ) ,
23+ rulesInstallManifestPath : z . string ( ) . optional ( ) ,
24+ rulesInstallBranch : z . string ( ) . optional ( ) ,
2225} ) ;
2326
2427export type McpCommandOptions = z . infer < typeof McpCommandOptions > ;
@@ -34,6 +37,18 @@ export function configureMcpCommand(program: Command) {
3437 "Only run the MCP server for the dev environment. Attempts to access other environments will fail."
3538 )
3639 . option ( "--log-file <log file>" , "The file to log to" )
40+ . addOption (
41+ new CommandOption (
42+ "--rules-install-manifest-path <path>" ,
43+ "The path to the rules install manifest"
44+ ) . hideHelp ( )
45+ )
46+ . addOption (
47+ new CommandOption (
48+ "--rules-install-branch <branch>" ,
49+ "The branch to install the rules from"
50+ ) . hideHelp ( )
51+ )
3752 ) . action ( async ( options ) => {
3853 wrapCommandAction ( "mcp" , McpCommandOptions , options , async ( opts ) => {
3954 await mcpCommand ( opts ) ;
@@ -60,6 +75,11 @@ export async function mcpCommand(options: McpCommandOptions) {
6075 return ;
6176 }
6277
78+ await initiateRulesInstallWizard ( {
79+ manifestPath : options . rulesInstallManifestPath ,
80+ branch : options . rulesInstallBranch ,
81+ } ) ;
82+
6383 return ;
6484 }
6585
0 commit comments