Skip to content

[BUG] mcp add accepts command argument that looks like a flag without proper escaping hint #2832

Description

@Nero930225

Project

cortex

Description

When running cortex mcp add test --url invalid-url, the error message correctly says URL must start with http/https, but if someone tries cortex mcp add test -v -- echo test, the -v is interpreted as an option. The help should clarify the -- separator requirement.

Error Message

Debug Logs

System Information

$ bounty info
Bounty Challenge v0.1.0
OS: Linux 6.8.0-87-generic (Ubuntu 24.04.3 LTS)
CPU: Intel Core i7
RAM: 16 GB
Cortex Version: 0.0.4-alpha

Screenshots

No response

Steps to Reproduce

  1. Run cortex mcp add test -v -- echo test

Expected Behavior

Clear error or hint about using -- separator before commands starting with -

Actual Behavior

The -v might be interpreted as verbose flag rather than command argument

Additional Context

This bug was discovered through systematic testing of the Cortex CLI edge cases, error handling, and output formatting. The issue affects user experience and may cause confusion or unexpected behavior in production use cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cortexIssues related to CortexLM/cortex repositoryvalidValid issue

    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