Skip to content

[BUG] v0.135.0 regression: MCP OAuth callback server fails to bind, all MCP servers stuck at "connecting..." in /mcp UI #1165

@listell-writer

Description

@listell-writer

Summary

After upgrading to droid 0.135.0, the /mcp panel shows every configured MCP server stuck at connecting... indefinitely and no MCP tools are registered. Downgrading to 0.104.0 (or 0.134.0) restores normal behaviour with the same ~/.factory/mcp.json and same machine. The root cause from logs is that the MCP OAuth callback HTTP server fails to bind at startup, which then aborts list_mcp_servers / list_mcp_tools in the background JSON-RPC worker.

Environment

  • Droid version (broken): 0.135.0
  • Droid version (last known good): 0.134.0 (also confirmed working: 0.104.0)
  • OS: macOS 25.5.0, arm64
  • Terminal: VS Code integrated terminal (1.121.0)
  • Mode: interactive CLI, JSON-RPC sub-mode (isDroidExec=true, isStreamJsonRpcWorker=true)
  • MCP config: ~/.factory/mcp.json, 10 servers (mix of stdio, HTTP, and SSE transports, several with OAuth)

Symptom

/mcp shows all 10 servers at connecting... indefinitely; no spinner progress, no error UI is ever surfaced. Ctrl+L (the workaround from #621) does not refresh the state.

Logs (~/.factory/logs/droid-log-single.log)

Same machine, same mcp.json, two consecutive sessions:

0.134.0 — success:

INFO: [metrics_log_mcp_callback_server_start_latency_ms]
  outcome: "success"
  value: 0.018 ms
  version: "0.134.0"

0.135.0 — fails immediately on every session start:

INFO: [metrics_log_mcp_callback_server_port_retry_count]
  outcome: "error"
  value: 1
  version: "0.135.0"

INFO: [metrics_log_mcp_callback_server_start_latency_ms]
  attempted: true
  outcome: "error"
  value: 6.82 ms
  version: "0.135.0"

WARN: [McpService] Error reloading MCP servers
  cause: MetaError: Failed to start MCP OAuth callback server
    at startOAuthCallbackServerIfNeeded (src/services/mcp/oauth/...)

ERROR: [JsonRpc] Background MCP startup failed during list_mcp_servers
MetaError: Failed to start MCP OAuth callback server
    at start (src/services/mcp/oauth/CallbackServer.ts:155:17)
    at processTicksAndRejections (native:7:39)
  cause: MetaError: Failed to start OAuth callback server
    at start (src/services/mcp/oauth/CallbackServer.ts:155:17)

ERROR: [JsonRpc] Background MCP startup failed during list_mcp_tools
  (same stack as above)

INFO: [SessionStateManager] MCP status changed
  count: 0
  totalCount: 0
  state: "no-servers"

The retry counter shows value: 1 with outcome: error, suggesting the port-pick loop gives up after a single failed attempt rather than scanning further free ports.

For comparison, the 0.104.0 startup on the same box succeeds and logs:

INFO: OAuth callback server started
  port: 54621

followed by [McpHub] Sending toolsChange notification with toolCount: 186 across all 10 servers.

Suspected cause

CallbackServer.ts:155 rejects on a single failed listen() rather than retrying with a different port, and the underlying listen error is swallowed by the wrapper (Failed to start OAuth callback server with no EADDRINUSE / EACCES detail in cause.cause). Likely a 0.134 → 0.135 change to the OAuth callback server startup path (port selection, bind options, or IPv6 binding on macOS). Surfacing the inner Error from net.Server would help diagnose; either way the bind retry budget appears to be effectively 1.

Reproduction

  1. macOS, droid 0.135.0, any ~/.factory/mcp.json with one or more HTTP/SSE servers (OAuth-capable).
  2. Launch droid, open /mcp.
  3. All servers remain at connecting....
  4. droid update --version 0.104.0 (or 0.134.0) → same config, all servers connect, tools register.

Impact

Complete loss of MCP functionality in 0.135.0 for users with any OAuth-capable MCP server configured. No degraded path, no error surfaced to the UI, only connecting....

Workaround

droid update --version 0.134.0 until a fix lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions