Skip to content

CLI's open() call has no timeout, no catch, and no fallback message #2410

Closed

Description

@CloneOfAlex

Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

CLI

Inspector version

2.7.0 (git tag) — static code-review finding, not run locally

Node version

N/A — static code review, no live run performed

Operating system (and browser, for the web client)

N/A — static code review

Transport

Not applicable / never connected

MCP server under inspection

N/A — this is a static code-review finding against the 2.7.0 tag source (clients/cli/src/open-url.ts), not a live reproduction against a running MCP server.

Steps to reproduce

Found via static review of the 2.7.0 tag source, not a live run.

  1. clients/cli/src/open-url.ts is a bare await open(url) with no error handling and no timeout:
export async function openUrl(url: string | URL): Promise<void> {
  await open(typeof url === "string" ? url : url.href);
}
  1. In a headless CI box, a container, or a Linux desktop with no registered URL handler, open() can reject or hang depending on platform.
  2. There is no "copy this URL instead" fallback the way clipboard access does elsewhere in the codebase.

I have not run this against an actual headless/no-DISPLAY environment to observe the hang; flagging based on the code path itself.

Expected behavior

The OAuth flow's browser-open call has a timeout and error handling, and prints the URL for the user to copy manually on failure (or by default alongside the browser open).

Actual behavior

openUrl (clients/cli/src/open-url.ts) is a bare await open(...) with no timeout, no catch, and no fallback message.

Suggested fix: wrap the call in a try/catch with a timeout, and on failure (or by default alongside the browser open) print the URL so the user can copy it manually.

Logs, errors, or screenshots

No response

Already prototyped a fix?

No response

Before you submit

  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability report (those go through the private advisory process).

Activity

  1. cliffhall commented on Sep 18, 2026

    @cliffhall
    Member

    Triage: Priority Low (total 5)

    • Severity 2 — minor friction with an easy workaround (open the printed URL by hand)
    • Urgency 2 — wanted eventually
    • Bonuses: +1 bug label

    Labels applied at triage: v2.

    Board: #28, Status Incoming (awaiting maintainer review — no milestone yet).

  2. added this to the v2.9.0 milestone on Sep 23, 2026
  3. self-assigned this
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions