feat: Major CLI syntax overhaul to mcpc [<@session>] [<command>]#29
Merged
feat: Major CLI syntax overhaul to mcpc [<@session>] [<command>]#29
mcpc [<@session>] [<command>]#29Conversation
mcpc <target> [<command>] to mcpc [<@session>] [<command>]mcpc [<@session>] [<command>]
There was a problem hiding this comment.
Pull request overview
This PR implements a breaking, command-first CLI redesign for mcpc, shifting from mcpc <target> [command] to mcpc [<@session>] [<command>] and removing direct one-shot access to servers (users must connect to create a session before running MCP commands).
Changes:
- Introduces top-level verb commands (
connect,login,logout,clean,help,x402) and routes MCP operations through@sessiontargets. - Adds parsing utilities for server arguments (
parseServerArg) and session subcommand detection (hasSubcommand); removes legacy--config/target parsing logic. - Updates unit + E2E tests and refreshes user-facing docs (README/CLAUDE/CHANGELOG) to reflect the new interface.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/cli/index.ts |
Reworks CLI routing into top-level commands vs session subcommands; adds connect/login/logout/clean/help wiring. |
src/cli/parser.ts |
Removes legacy target/config parsing; adds hasSubcommand and parseServerArg. |
src/cli/helpers.ts |
Removes direct-connection client path; withMcpClient now enforces session-only usage. |
src/cli/commands/sessions.ts |
Updates connectSession argument ordering to match new connect command flow. |
src/lib/errors.ts |
Updates auth error guidance strings to new command syntax. |
src/lib/utils.ts |
Removes unused isFile/isDirectory helpers and stat import. |
test/unit/cli/index.test.ts |
Replaces findTarget tests with coverage for parseServerArg and hasSubcommand. |
test/e2e/lib/framework.sh |
Removes implicit test-header injection from run_mcpc; adds header injection only in create_session. |
test/e2e/suites/** |
Updates E2E invocations to `mcpc connect <server |
README.md |
Updates embedded --help output snippet to new usage/commands list. |
CLAUDE.md |
Updates documented CLI usage patterns to the new session-first workflow. |
CHANGELOG.md |
Documents the breaking syntax change and migration examples. |
docs/TODOs.md |
Adds notes/examples related to x402 and an auth/session bug (needs syntax refresh). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mcpc [<@session>] [<command>]mcpc [<@session>] [<command>]
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ds (#31) * Add command-first syntax for close, restart, and shell session commands Support `mcpc close @session`, `mcpc restart @session`, and `mcpc shell @session` as alternatives to `mcpc @session close/restart/shell`. Also fix pre-existing broken code in the clean command handler. https://claude.ai/code/session_01Jz8RQGLnPdn262ztePPcEZ * Remove redundant alternative syntax hints from help text https://claude.ai/code/session_01Jz8RQGLnPdn262ztePPcEZ --------- Co-authored-by: Claude <noreply@anthropic.com>
* Initial plan * Fix validateOptions to stop at first command token, not scan all args Co-authored-by: jancurn <10612996+jancurn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jancurn <10612996+jancurn@users.noreply.github.com>
* Fix Prettier formatting in src/cli/index.ts to pass CI lint check https://claude.ai/code/session_01QrZyVG5ucMFTRoqQuh3iC9 * Normalize package-lock.json peer dependency markers https://claude.ai/code/session_01QrZyVG5ucMFTRoqQuh3iC9 --------- Co-authored-by: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* fix: e2e test failures for schema-mode validation and run.sh portability - Align --schema-mode error message in getOptionsFromCommand() with test expectations (was "Invalid schema mode", now matches "Invalid --schema-mode value" format used elsewhere) - Add --timeout validation in getOptionsFromCommand() since validateArgValues() now stops at the first non-option arg and no longer catches subcommand options - Replace bash process substitution (< <(...)) in run.sh with heredoc alternatives (<<< "$()") for portability in environments without /dev/fd https://claude.ai/code/session_01FSt1NZy2bmcF2zDbhFEjSQ * TODOs --------- Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change: major improvement of syntax:
mcpc <target> [<command>]=>mcpc [<@session>] [<command>]Plus various related fixes and improvements in CLI interface.
--
The existing interface of mcpc now looks like this:
Usage: mcpc [options] [command]
The main “verb” after mcpc is always expected to be a target (either URL, config entry, or sesion name). But that’s problematic and non-standard, as for example we can’t easlie introduce new global commands to mcpc such as “clean”, “x402”, “grep” etc.
This is a new proposal for the interface that introduces a more standard “mcpc ” syntax, where can also be a @session and then mcpc will operate on the session as it does now. Also, we’re getting rid of the non-session access to MCP servers (e.g. “mcpc mcp.apify.com tools-list”), it only complicates syntax and implementation.