From 9df68c061483463c87da726ce64d788fffcd4539 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 21:24:00 +0000 Subject: [PATCH] Deprecate the "shell" command Hide both `mcpc shell @` and `mcpc @ shell` from `--help` output, and print a deprecation warning to stderr when the command is invoked. The command itself still works. Also drop the `mcpc shell` hint from the "Available commands" list shown by `mcpc @` so we stop advertising it. --- CHANGELOG.md | 4 +++ README.md | 47 ++++++++++++++++++++++++++++++++++++ src/cli/commands/sessions.ts | 3 +++ src/cli/index.ts | 12 ++++----- src/cli/output.ts | 10 ++++---- test/unit/cli/output.test.ts | 8 +++--- 6 files changed, 69 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a330519..2b452a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Deprecated + +- The `shell` command (`mcpc shell @` and `mcpc @ shell`) is deprecated and will be removed in a future release. It is now hidden from `--help` output and prints a deprecation warning when invoked + ## [0.3.0] - 2026-05-20 ### Added diff --git a/README.md b/README.md index 0fcb893..c002710 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,53 @@ mcpc @fs tools-list ``` +Usage: mcpc [<@session>] [] [options] + +Universal command-line client for the Model Context Protocol (MCP). + +Commands: + connect [@session] Connect to an MCP server and start a new named @session + close <@session> Close a session + restart <@session> Restart a session (losing all state) + login Interactively login to a server using OAuth and save profile + logout Delete an OAuth profile for a server + clean [resources...] Clean up mcpc data (sessions, profiles, logs, all) + grep Search tools and instructions across all active sessions + x402 [subcommand] [args...] Configure an x402 payment wallet (EXPERIMENTAL) + help [command] [subcommand] Show help for a specific command + +Options: + --json Output in JSON format for scripting + --verbose Enable debug logging + --profile OAuth profile for the server ("default" if not provided) + --timeout Request timeout in seconds (default: 300) + --max-chars Truncate output to n characters (ignored in --json mode) + --insecure Skip TLS certificate verification (for self-signed certs) + -v, --version Output the version number + -h, --help Display help + +MCP session commands (after connecting): + <@session> Show MCP server info, capabilities, and tools overview + <@session> grep Search tools and instructions + <@session> tools-list List all server tools + <@session> tools-get Get tool details and schema + <@session> tools-call [arg:=val ... | | prompts-list + <@session> prompts-get [arg:=val ... | | resources-list + <@session> resources-read + <@session> resources-subscribe + <@session> resources-unsubscribe + <@session> resources-templates-list + <@session> tasks-list + <@session> tasks-get + <@session> tasks-result + <@session> tasks-cancel + <@session> logging-set-level + <@session> ping + +Run "mcpc" without arguments to show active sessions and OAuth profiles. +Run "mcpc --json" to get the same data as `{ sessions: [...], profiles: [...] }`. ``` ### General actions diff --git a/src/cli/commands/sessions.ts b/src/cli/commands/sessions.ts index 58f25af..142083b 100644 --- a/src/cli/commands/sessions.ts +++ b/src/cli/commands/sessions.ts @@ -1538,6 +1538,9 @@ async function maybeConnectApify( * Open an interactive shell for a target */ export async function openShell(target: string): Promise { + console.error( + formatWarning('The "shell" command is deprecated and will be removed in a future release.') + ); // Import shell dynamically to avoid circular dependencies const { startShell } = await import('../shell.js'); await startShell(target); diff --git a/src/cli/index.ts b/src/cli/index.ts index a32c99d..72efb0a 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -591,11 +591,11 @@ ${jsonHelp( await sessions.restartSession(sessionName, getOptionsFromCommand(command)); }); - // shell command: mcpc shell @ + // shell command: mcpc shell @ (deprecated, hidden from help) program - .command('shell [@session]') + .command('shell [@session]', { hidden: true }) .usage('<@session>') - .description('Open interactive shell for a session') + .description('Open interactive shell for a session (deprecated)') .action(async (sessionName) => { if (!sessionName) { throw new ClientError('Missing required argument: @session\n\nExample: mcpc shell @myapp'); @@ -882,10 +882,10 @@ function registerSessionCommands(program: Command, session: string): void { command.parent.outputHelp(); }); - // Shell command + // Shell command (deprecated, hidden from help) program - .command('shell') - .description('Launch interactive MCP shell.') + .command('shell', { hidden: true }) + .description('Launch interactive MCP shell (deprecated).') .action(async () => { await sessions.openShell(session); }); diff --git a/src/cli/output.ts b/src/cli/output.ts index 8cac5b7..4fae9b6 100644 --- a/src/cli/output.ts +++ b/src/cli/output.ts @@ -1445,7 +1445,6 @@ export function formatServerDetails( } // Commands - lines.push(chalk.bold('Available commands:')); const commands: string[] = []; if (capabilities?.tools) { @@ -1479,10 +1478,11 @@ export function formatServerDetails( commands.push(`${bullet} ${bt}mcpc ${target} logging-set-level ${bt}`); } - commands.push(`${bullet} ${bt}mcpc ${target} shell${bt}`); - - lines.push(commands.join('\n')); - lines.push(''); + if (commands.length > 0) { + lines.push(chalk.bold('Available commands:')); + lines.push(commands.join('\n')); + lines.push(''); + } // Debugging hint: bridge log file path (only shown for sessions, i.e. @name targets) if (target.startsWith('@')) { diff --git a/test/unit/cli/output.test.ts b/test/unit/cli/output.test.ts index 85a56da..7b070ae 100644 --- a/test/unit/cli/output.test.ts +++ b/test/unit/cli/output.test.ts @@ -1048,7 +1048,8 @@ describe('formatServerDetails', () => { expect(output).toContain('mcpc @test resources-read'); expect(output).toContain('mcpc @test prompts-list'); expect(output).toContain('mcpc @test logging-set-level'); - expect(output).toContain('mcpc @test shell'); + // shell is deprecated and no longer listed + expect(output).not.toContain('mcpc @test shell'); // Should contain instructions in code block expect(output).toContain('Instructions:'); @@ -1073,9 +1074,8 @@ describe('formatServerDetails', () => { expect(output).toContain('Capabilities:'); expect(output).toContain('(none)'); - // Should only show shell command - expect(output).toContain('Available commands:'); - expect(output).toContain('mcpc https://example.com shell'); + // With no capabilities, no commands are listed + expect(output).not.toContain('Available commands:'); expect(output).not.toContain('tools-list'); expect(output).not.toContain('resources-list'); expect(output).not.toContain('prompts-list');