Skip to content

mcp and completions reject --json with a generic 'not supported' error #1424

Description

@Widthdom

Summary

The mcp and completions subcommands reject --json with a generic "not supported for mcp/completions" error. The user only discovers this at runtime — the subcommand's --help does not declare unsupported flag combinations.

Evidence

src/CodeIndex/Cli/ProgramRunner.cs:36-40, 127-128, 142:

  • Help for mcp shows Usage: cdidx mcp [--db <path>] with no mention of --json.
  • Help for completions similarly omits the negative space.
  • The parser at :142 returns "is not supported for mcp" at runtime.

Most other query subcommands (search, references, etc.) DO accept --json, creating an asymmetric mental model.

Impact

  • Agents that probe-and-retry waste a cycle.
  • Users debugging scripts hit an unhelpful error before they realise the flag is unsupported for the subcommand.

Proposed direction

  1. Add a Notes: or Supported flags: line to each subcommand's --help listing the flags it explicitly does NOT accept.
  2. Optionally relax mcp to accept --json as a no-op (since MCP itself speaks JSON).

Repro env

  • Branch: main @ 2ee912d (release v1.21.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions