Skip to content

CLI/TUI: default --config to getDefaultMcpConfigPath() when no flag is given #1347

@cliffhall

Description

@cliffhall

Background

#1343 introduces getDefaultMcpConfigPath() (returns ~/.mcp-inspector/mcp.json). The web client reads from that path automatically. The CLI/TUI currently require an explicit --config <path>resolveServerConfigs in core/mcp/node/config.ts errors with "Target is required" if no config and no positional args.

This issue: when the CLI/TUI is wired up to v2, fall back to getDefaultMcpConfigPath() if no --config AND no positional target is supplied. The same mcp.json becomes the source of truth across all three Inspector incarnations.

Depends on

#1246 (Port v1.5 CLI / TUI / launcher to v2). Touch as part of that port, or as an immediate follow-up.

Scope

  • core/mcp/node/config.ts resolveServerConfigs: when !hasConfigPath && !hasAdHoc, try getDefaultMcpConfigPath(); only error if that file is also absent.
  • Update CLI/TUI --help text to mention the default path.
  • Tests for the three branches: no config + default present (use it), no config + default absent (error), explicit config (unchanged behavior).

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions