Skip to content

feat(mcp_tool_resolve): resolve MCP servers concurrently #344

Description

@leseb

Summary

build_tool_map in the mcp_tool_resolve filter currently resolves MCP servers sequentially. With max_servers: 10 and timeout_ms: 5000, a request referencing 10 slow servers blocks for up to 50 seconds of serial I/O since each server resolution waits for the previous one to complete.

Proposal

Use tokio::JoinSet (or futures::future::join_all) to resolve servers concurrently, bounded by max_servers. Each server resolution is independent so there is no ordering constraint.

The concurrency cap already exists via max_servers in the filter config, which can serve as the natural bound on parallelism.

Files

  • apis/src/openai/responses/mcp_tool_resolve/mod.rsbuild_tool_map function (~line 133)

Context

Raised during review of PR #331. Deferred to a follow-up since it's an optimization, not a correctness fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedHas been reviewed by a human and considered a valid buggood first issueGood for newcomers

    Type

    Fields

    No fields configured for Task.

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions