mcp: add `--json` flag to all tool calls to provide args as a json object by burmudar · Pull Request #1245 · sourcegraph/src-cli

This adds a --json flag for all tool calls exposed through src mcp. By using --json an agent can provide values for all flags instead of using the cli flag ie. src mcp <tool-name> --json '{"query": "test", "repo": "github.com/sourcegraph/sourcegraph"}' instead of src mcp <tool-name> --query "test" -repo "github.com/sourcegraph/sourcegraph"

Note:
Values specified via --json take precedence over values provided via flags.

Test plan

  • Tested manually
  • Asked Amp to use --json flag and also mix the usage with normal flags

Closes CPL-13