Skip to content

Commit 8a224bd

Browse files
committed
Update README and workflow documentation for system tray flag usage; clarify command-line options for enabling/disabling system tray functionality.
1 parent 8f6d787 commit 8a224bd

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ jobs:
549549
550550
- With tray: `./mcpproxy` (default)
551551
- Custom port (default: 8080): `./mcpproxy --listen :8081`
552-
- Headless: `./mcpproxy --tray false`
552+
- Headless: `./mcpproxy --tray=false`
553553
env:
554554
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
555555

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mcpproxy --help
116116
-c, --config <file> path to mcp_config.json
117117
-l, --listen <addr> listen address (":8080")
118118
-d, --data-dir <dir> custom data directory
119-
--tray enable/disable system tray (default true)
119+
--tray enable/disable system tray (default true, use --tray=false to disable)
120120
--log-level <level> debug|info|warn|error
121121
--read-only forbid config changes
122122
--disable-management disable upstream_servers tool

cmd/mcpproxy/main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func main() {
5757
rootCmd.PersistentFlags().StringVarP(&dataDir, "data-dir", "d", "", "Data directory path (default: ~/.mcpproxy)")
5858
rootCmd.PersistentFlags().StringVarP(&listen, "listen", "l", "", "Listen address (for HTTP mode, not used in stdio mode)")
5959
rootCmd.PersistentFlags().StringVar(&logLevel, "log-level", "info", "Log level (debug, info, warn, error)")
60-
rootCmd.PersistentFlags().BoolVar(&enableTray, "tray", true, "Enable system tray")
60+
rootCmd.PersistentFlags().BoolVar(&enableTray, "tray", true, "Enable system tray (use --tray=false to disable)")
6161
rootCmd.PersistentFlags().BoolVar(&debugSearch, "debug-search", false, "Enable debug search tool for search relevancy debugging")
6262
rootCmd.PersistentFlags().IntVar(&toolResponseLimit, "tool-response-limit", 0, "Tool response limit in characters (0 = disabled, default: 20000 from config)")
6363
rootCmd.PersistentFlags().BoolVar(&logToFile, "log-to-file", true, "Enable logging to file in standard OS location")
@@ -74,7 +74,7 @@ func main() {
7474
}
7575
}
7676

77-
func runServer(_ *cobra.Command, _ []string) error {
77+
func runServer(cmd *cobra.Command, _ []string) error {
7878
// Load configuration first to get logging settings
7979
cfg, err := loadConfig()
8080
if err != nil {
@@ -135,7 +135,10 @@ func runServer(_ *cobra.Command, _ []string) error {
135135
zap.Bool("log_to_file", logToFile))
136136

137137
// Override other settings from command line
138-
cfg.EnableTray = enableTray
138+
// Check if the tray flag was explicitly set by the user
139+
if cmd.Flags().Changed("tray") {
140+
cfg.EnableTray = enableTray
141+
}
139142
cfg.DebugSearch = debugSearch
140143

141144
if toolResponseLimit != 0 {

internal/config/loader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ func setupViper() {
139139

140140
// Set defaults
141141
viper.SetDefault("listen", ":8080")
142-
viper.SetDefault("tray", true)
143142
viper.SetDefault("top-k", 5)
144143
viper.SetDefault("tools-limit", 15)
145144
viper.SetDefault("config", "")

0 commit comments

Comments
 (0)