You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add optional on-demand reconnect when a tool is invoked for a disconnected upstream #354
I’m using mcpproxy with some upstreams that are intentionally intermittent, for example:
remote devtools behind a VM/tunnel
services that are only online sometimes
OAuth-backed servers that may be unavailable for a while and then come back
Right now, if an upstream is disconnected, a tool call does not trigger an immediate reconnect attempt. The call just fails fast because the server is not connected and recovery depends entirely on the background retry/backoff loop.
This creates a bad UX for intermittent servers:
the server may already be back online
but mcpproxy still won’t use it until the next scheduled retry
if the retry backoff is already large, the wait can be very long
in practice, users often know the upstream is back and want to use it immediately
Current behavior seems to be:
background reconnection with backoff
tool invocation checks connection state
if disconnected, it returns an error instead of attempting a reconnect
so “use” does not wake the upstream
Requested feature:
an optional mode such as:
reconnect_on_use: true
or
wake_on_use: true
Suggested behavior:
if a tool call targets a disconnected upstream
and the upstream is enabled
mcpproxy should optionally attempt a bounded immediate reconnect
then retry the tool call once if reconnection succeeds
if reconnect fails, return the normal error
Important constraints:
should be optional, not default if you think it is too aggressive
should only do one bounded reconnect attempt per request
should avoid duplicate concurrent reconnect storms
should still preserve current safety against hangs/timeouts
ideally should respect a short timeout for the reconnect attempt
This would be especially useful for:
remote devtools servers
SSH/tunnel-backed MCPs
upstreams that are powered on only when needed
Even a simpler version would already help a lot:
when a tool is called on a disconnected server, trigger ForceReconnect(...)
then return a “retry in a moment” or retry once automatically
I checked the current behavior locally and it looks like:
tool calls fail early if !IsConnected()
they do not force a reconnect
recovery only happens via background health/retry logic
So this feels like a realistic improvement rather than a different architecture.
Activity
feat: add reconnect_on_use option for on-demand upstream reconnection
feat: add reconnect_on_use for on-demand upstream reconnection (smart…