Skip to content

Commit 8f3a1ee

Browse files
committed
only register mcp command if SRC_EXPERIMENT_MCP=true
1 parent ab3a81b commit 8f3a1ee

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cmd/src/mcp.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"flag"
77
"fmt"
8+
"os"
89
"strings"
910

1011
"github.com/sourcegraph/src-cli/internal/api"
@@ -14,11 +15,13 @@ import (
1415
)
1516

1617
func init() {
17-
flagSet := flag.NewFlagSet("mcp", flag.ExitOnError)
18-
commands = append(commands, &command{
19-
flagSet: flagSet,
20-
handler: mcpMain,
21-
})
18+
if os.Getenv("SRC_EXPERIMENT_MCP") == "true" {
19+
flagSet := flag.NewFlagSet("mcp", flag.ExitOnError)
20+
commands = append(commands, &command{
21+
flagSet: flagSet,
22+
handler: mcpMain,
23+
})
24+
}
2225
}
2326
func mcpMain(args []string) error {
2427
fmt.Println("NOTE: This command is still experimental")

0 commit comments

Comments
 (0)