Skip to content

Commit cfb4846

Browse files
authored
add auto-stop flag to fly mcp launch (#4379)
1 parent a919158 commit cfb4846

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/command/mcp/launch.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type MCPServer struct {
3131

3232
func NewLaunch() *cobra.Command {
3333
const (
34-
short = "[experimental] Launch an MCP stdio program"
34+
short = "[experimental] Launch an MCP stdio server"
3535
long = short + "\n"
3636
usage = "launch command"
3737
)
@@ -70,6 +70,11 @@ func NewLaunch() *cobra.Command {
7070
Name: "config",
7171
Description: "Path to the MCP client configuration file (can be specified multiple times)",
7272
},
73+
flag.String{
74+
Name: "auto-stop",
75+
Description: "Automatically suspend the app after a period of inactivity. Valid values are 'off', 'stop', and 'suspend",
76+
Default: "stop",
77+
},
7378
)
7479

7580
for client, name := range McpClients {
@@ -159,6 +164,10 @@ func runLaunch(ctx context.Context) error {
159164
args = append(args, "--flycast")
160165
}
161166

167+
if autoStop := flag.GetString(ctx, "auto-stop"); autoStop != "" {
168+
args = append(args, "--auto-stop", autoStop)
169+
}
170+
162171
// Run fly launch, but don't deploy
163172
cmd := exec.Command(flyctl, args...)
164173
cmd.Env = os.Environ()

0 commit comments

Comments
 (0)