Skip to content

Outbound MCP client should handle input_required / multi-round tool calls #264

Description

@serge-ivo

Problem

The outbound MCP connector assumes a remote call returns a final JSON-RPC result or error. It unwraps normal MCP tool results, but does not handle multi-round interactions where the MCP server needs more input from the user before completing the call.

Current MCP supports input-required style results / multi-round trip requests for cases like:

  • missing required user input
  • confirmation before a risky action
  • choosing among app resources
  • provider-specific consent/step-up prompts

Without this, a PAGS MCP agent may connect successfully but fail or hallucinate when a remote server asks for more information.

Expected behavior

When a remote MCP call returns input-required data, PAGS should pause the tool call, surface the request to the user, collect the answer, and retry/resume the original call with the provided input responses.

Acceptance criteria

  • Outbound MCP client detects input-required responses instead of treating them as final opaque data.
  • Chat UI can render the requested inputs/confirmation clearly.
  • User answer is routed back to the original remote call.
  • The resumed call preserves endpoint, remote tool, args, auth context, and audit trace.
  • Timeouts/cancel paths are clear.
  • Sensitive input requests are handled carefully and are not stored in memory or logs unless explicitly safe/redacted.
  • Tests cover successful resume, user cancellation, timeout, and malformed input-required payload.

Related

Code pointers

  • workers/api/src/lib/connectors/mcp.ts
  • workers/api/src/routes/instances.ts
  • store/console/src/pages/InstanceDetail.tsx

Activity

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