Skip to content

Bug: HTTP MCP backend tools missing from agent when tools/list response is slow #3718

@chrisfregly

Description

@chrisfregly

Summary

When a workflow imports an HTTP MCP server whose tools/list response takes longer than
the gateway's tool discovery window, the agent receives an empty tool list for that server
and proceeds without those tools — even though the backend eventually initializes successfully.

Environment

Component Version
gh-aw compiler v0.68.1
gh-aw-mcpg v0.2.17
Engine Claude Code 2.1.98
MCP server type http (LiteLLM proxy)

Steps to Reproduce

  1. Configure a workflow with an HTTP MCP server whose tools/list response takes >~5s
  2. Run the workflow

Expected Behavior

The agent receives the full tool list from all configured MCP backends before execution begins.

Actual Behavior

The agent only sees tools from fast-responding backends. The slow HTTP backend's tools are absent.
The agent reported:

"No OpsLevel MCP tools are available in this environment (only mcp__github__* and
mcp__safeoutputs__* exist). Without catalog validation, no candidates can be confirmed."

The backend itself succeeds — the gateway log confirms successful registration at 21s:

[2026-04-13T16:37:36Z] [DEBUG] [backend] GetOrLaunch called for server: opslevel                 
[2026-04-13T16:37:57Z] [INFO]  [backend] Successfully registered tools from opslevel (took         
21.213743169s)

But by then the agent has already started and its tool list is fixed. No error or warning
is surfaced — the tools are silently absent.

Root Cause (Hypothesis)

The gateway lazily initializes HTTP backends on the first tools/list request. If a
backend's response time exceeds the tool discovery window, the gateway returns the tool
list to the agent before the slow backend completes — silently dropping that server's tools.

Additionally, the compiler always emits "tools": ["*"] in the gateway config regardless
of what is declared in allowed:, which forces a live round-trip to discover tools and
makes the race condition unavoidable for slow backends.

Suggested Fix

  • Block tool list delivery to the agent until all configured backends respond (or fail),
    rather than returning a partial list silently
  • Surface an error when a backend's tools/list exceeds the discovery window, rather
    than proceeding as if the server has no tools
  • Static registration: when allowed: declares specific tool names, have the compiler
    emit those as a static "tools" list in the gateway config — allowing the gateway to
    register them immediately without a round-trip and bypassing the race entirely

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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