Skip to content

CLI: Progress notifications not captured, preventing timeout reset functionality #880

@olaservo

Description

@olaservo

Inspector Version

  • 0.17.1 (current main branch)

Describe the bug

The CLI mode accepts --reset-timeout-on-progress flag but it doesn't actually reset timeouts on progress notifications because the CLI doesn't capture or handle progress notifications from MCP servers. This causes long-running operations to timeout even when progress notifications are being sent and --reset-timeout-on-progress true is specified.

The web UI correctly displays progress notifications and handles timeout resets, but the CLI mode does not yet implement this functionality.

To Reproduce

  1. Run a long-running operation with tight timeout values:
    node build/cli.js npx @modelcontextprotocol/server-everything --cli --method tools/call --tool-name longRunningOperation --tool-arg duration=3 steps=2 --request-timeout 2000 --reset-timeout-on-progress true
  2. Observe that the operation times out even though:
    • The server is sending progress notifications (verified in web UI)
    • --reset-timeout-on-progress true is set
    • The timeout should be reset on each progress update

Expected behavior

When --reset-timeout-on-progress true is set, the CLI should:

  1. Listen for progress notifications from the MCP server
  2. Reset the request timeout each time a progress notification is received
  3. Display or log progress notifications (similar to how the web UI shows them)
  4. Allow long-running operations to complete successfully as long as progress is being reported

Environment:

  • OS: All platforms (Windows, macOS, Linux)
  • CLI mode (not browser-based)

Additional context

  • PR feat - incorporated mcp server request configs for cli mode #373 adds the --request-timeout, --reset-timeout-on-progress, and --max-total-timeout flags to CLI mode
  • The flags are parsed and passed to the SDK correctly
  • However, the CLI code in cli/src/client/connection.ts and related files doesn't set up listeners for progress notifications
  • This limitation means that --reset-timeout-on-progress and --max-total-timeout don't provide the full intended functionality for managing long-running operations in CLI mode

Related Issues/PRs:

Suggested Implementation:

The CLI should implement progress notification handling similar to the web UI:

  1. Set up notification listeners after connecting to the server
  2. Handle notifications/progress messages
  3. Optionally display progress updates to stderr (so they don't interfere with JSON output on stdout)
  4. Ensure the SDK's timeout reset mechanism is triggered on progress notifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliIssues and PRs specific to cli modep2-mediumMedium priority - normal timeline

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions