Skip to content

[Task] Bound local and remote MCP resource admission #7951

Open

Description

@BobSong-dev

Background

Parent #7949. This task belongs to resource isolation and predictable admission. Per-request byte and deadline bounds and an individual transport cap do not bound total work across local providers and remote servers.

Existing capabilities and reuse

At master 87c22dde7, RequestScopedMcpClient has MAX_IN_FLIGHT=64 and bounded requests; RemoteCatalogLifecycle already supports bounded parallel discovery. Retain existing deadline and response-byte protection and the legacy server response-capture guard. Reuse existing resource and fault-tolerance facilities where their semantics fit; do not replace transport pools.

Implementation scope

  • Add local-provider, gateway-wide and per-remote-server in-flight admission limits with bounded, deadline-aware queueing and explicit overload outcomes.
  • Make only necessary fixed limits configurable through trusted configuration, validating defaults, hard maxima and invalid updates in Admin and runtime.
  • Release permits exactly once on every terminal path; bound queued work, concurrent discovery and connection exposure and aggregate retained response memory. Define isolation so one failing or slow server cannot consume all capacity.
  • Keep tools/call non-replaying by default. Reuse circuit breaking only with an explicit side-effect-safe contract; HTTP GET retries do not authorize tool retries.

Non-goals

Distributed business quotas (tracked by #7957), a new connection pool, automatic tool replay, or latency-adaptive concurrency (separately tracked by #7930). This task owns deterministic resource caps and bounded queues, not that adaptive controller.

Acceptance criteria

  • Local and remote load cannot exceed configured global or per-server in-flight and queue limits; queue deadlines include time already spent waiting.
  • Error, cancellation, timeout, configuration removal and shutdown release permits and queued references without double release.
  • Invalid configuration is rejected consistently; runtime updates cannot bypass hard bounds.
  • Slow, failing-server and parallel-refresh fixtures demonstrate bounded connections and memory and unaffected independent targets within documented shared-capacity limits.
  • Rejections and in-flight state use bounded runtime metrics, with operational defaults and sizing guidance.

Tests

Deterministic concurrent admission, cancellation and update tests; actual HTTP MCP fixtures for slow, large and failing upstreams; multi-request memory and connection measurements with stated limits rather than unsupported performance claims; legacy response-bound and no-replay regressions.

Dependencies

Completed request/terminal-context and runtime-observability contracts (#7860 and #7921 integration baseline). #7952, #7953, #7954 and #7957 build on these bounds. Coordinate with #7930 without duplicating its algorithm or rollout.

Activity

  1. changed the title [-][Task][OSPP P1-07] Bound local and remote MCP resource admission[/-] [+][Task] Bound local and remote MCP resource admission[/+] on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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