Repository navigation
Closed
Description
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
Labels
No labels
Activity
Dumbris commentedon Jul 15, 2025
Hi @stek29 ,
Thank you for filing this issue and providing such detailed reproduction steps! This was indeed a bug in the configuration loading logic, and it has now been fixed.
What was wrong
The issue was that
mcpproxywithout the-cflag was ignoring thelistensetting from the config file due to viper's default values overwriting the loaded configuration.The fix #20
The configuration loading logic has been updated to properly respect config file values when no explicit CLI flags are provided.
🔧 Port Configuration Guide
You can configure the listen port using any of these methods, in order of priority:
CLI parameter (highest priority)
mcpproxy -l 127.0.0.1:9000 # or mcpproxy --listen 127.0.0.1:9000Config file (medium priority)
{ "listen": "127.0.0.1:12080", "data_dir": "/Users/user/.mcpproxy", ... }Default port (lowest priority)
Config file locations
mcpproxy automatically looks for
mcp_config.jsonin:./mcp_config.json~/.mcpproxy/mcp_config.jsonVerification
Your original test case now works correctly:
Thanks again for the detailed bug report! 🙏
test: add comprehensive unit tests for OAuth HasValidToken() method
test: add comprehensive unit tests for OAuth HasValidToken() method
feat: OAuth extra params with zero-config OAuth features (#173)