Skip to content

Listen option is ignored unless config option is set explicitly #14

@stek29

Description

@stek29

I've changed the listen option, but it only works if -c is passed explicitly.

$ <~/.mcpproxy/mcp_config.json jq -r .listen
127.0.0.1:12080

trying to start mcpproxy:

$ mcpproxy |& grep -e 'Starting HTTP' -e 'config'
2025-07-09 15:03:37	INFO	[email protected]/command.go:1015	Log directory configured	{"path": "/Users/username/Library/Logs/mcpproxy", "os": "darwin", "standard": "macOS File System Programming Guide"}
2025-07-09 15:03:37	INFO	server/server.go:193	Status updated	{"phase": "Loading", "message": "Loading configuration and connecting to servers..."}
2025-07-09 15:03:37	INFO	server/server.go:196	Synchronizing servers from configuration (config as source of truth)
2025-07-09 15:03:37	INFO	server/server.go:196	Server synchronization completed	{"configured_servers": 0, "removed_servers": 0}
2025-07-09 15:03:37	INFO	tray/tray.go:156	Config file watcher initialized{path 15 0 /Users/username/.mcpproxy/mcp_config.json <nil>}
2025-07-09 15:03:37	INFO	server/server.go:483	Starting HTTP server	{"address": ":8080", "endpoints": ["/mcp", "/mcp/", "/v1/tool_code", "/v1/tool-code"]}
^C

notice how it started on default :8080

Now starting it with -c option, which points to default config file path which was loaded before:

$ mcpproxy -c ~/.mcpproxy/mcp_config.json |& grep -e 'Starting HTTP' -e 'config'
2025-07-09 15:04:06	INFO	[email protected]/command.go:1015	Log directory configured	{"path": "/Users/username/Library/Logs/mcpproxy", "os": "darwin", "standard": "macOS File System Programming Guide"}
2025-07-09 15:04:06	INFO	server/server.go:193	Status updated	{"phase": "Loading", "message": "Loading configuration and connecting to servers..."}
2025-07-09 15:04:06	INFO	server/server.go:196	Synchronizing servers from configuration (config as source of truth)
2025-07-09 15:04:06	INFO	server/server.go:196	Server synchronization completed	{"configured_servers": 0, "removed_servers": 0}
2025-07-09 15:04:06	INFO	tray/tray.go:156	Config file watcher initialized{path 15 0 /Users/username/.mcpproxy/mcp_config.json <nil>}
2025-07-09 15:04:06	INFO	server/server.go:483	Starting HTTP server	{"address": "127.0.0.1:12080", "endpoints": ["/mcp", "/mcp/", "/v1/tool_code", "/v1/tool-code"]}

and this time it has started with expected listen address

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions