diff --git a/.gitignore b/.gitignore index eaa2055..74bdba0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # IDE .idea .vscode +.claude # Dependencies node_modules/ diff --git a/src/cli/commands/sessions.ts b/src/cli/commands/sessions.ts index 0a82af4..781939b 100644 --- a/src/cli/commands/sessions.ts +++ b/src/cli/commands/sessions.ts @@ -457,7 +457,7 @@ export async function listSessionsAndAuthProfiles(options: { console.log(chalk.bold('No OAuth profiles.')); console.log(chalk.dim(' ↳ run: mcpc login mcp.example.com')); } else { - console.log(chalk.bold('Available OAuth profiles:')); + console.log(chalk.bold('Saved OAuth profiles:')); for (const profile of profiles) { const hostStr = getServerHost(profile.serverUrl); const nameStr = chalk.magenta(profile.name); diff --git a/src/cli/index.ts b/src/cli/index.ts index e0d62f8..8091ec2 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -343,8 +343,8 @@ function createTopLevelProgram(): Command { ` ${chalk.bold('MCP session commands (after connecting):')} <@session> Show MCP server info and capabilities - <@session> ${chalk.cyan('tools-list')} List MCP tools - <@session> ${chalk.cyan('tools-get')} + <@session> ${chalk.cyan('tools-list')} List MCP server tools + <@session> ${chalk.cyan('tools-get')} Get tool details and schema <@session> ${chalk.cyan('tools-call')} [arg:=val ... | | ${chalk.cyan('prompts-list')} <@session> ${chalk.cyan('prompts-get')} [arg:=val ... | | \`` + `For full tool details and schema, run \`mcpc ${session}tools-list --full\` or \`mcpc ${session}tools-get \`` ); return lines.join('\n'); @@ -570,7 +570,7 @@ export function formatResources(resources: Resource[]): string { const lines: string[] = []; // Header with resource count - lines.push(chalk.bold(`Available resources (${resources.length}):`)); + lines.push(chalk.bold(`Resources (${resources.length}):`)); // Summary list of resources const bullet = chalk.dim('*'); @@ -627,7 +627,7 @@ export function formatResourceTemplates(templates: ResourceTemplate[]): string { const lines: string[] = []; // Header with template count - lines.push(chalk.bold(`Available resource templates (${templates.length}):`)); + lines.push(chalk.bold(`Resource templates (${templates.length}):`)); // Summary list of templates const bullet = chalk.dim('*'); @@ -684,7 +684,7 @@ export function formatPrompts(prompts: Prompt[]): string { const lines: string[] = []; // Header with prompt count - lines.push(chalk.bold(`Available prompts (${prompts.length}):`)); + lines.push(chalk.bold(`Prompts (${prompts.length}):`)); // Summary list of prompts const bullet = chalk.dim('*'); @@ -1145,6 +1145,21 @@ export function formatServerDetails( } lines.push(''); + // Tools list (from bridge cache, no extra server call) + if (tools && tools.length > 0) { + lines.push(formatToolsCompact(tools, { sessionName: target })); + lines.push(''); + } + + // Instructions in code block + const trimmed = instructions ? instructions.trim() : ''; + if (trimmed) { + lines.push(chalk.bold('Instructions:')); + lines.push(chalk.gray('````')); + lines.push(trimmed); + lines.push(chalk.gray('````')); + } + // Commands lines.push(chalk.bold('Available commands:')); const commands: string[] = []; @@ -1184,20 +1199,5 @@ export function formatServerDetails( lines.push(commands.join('\n')); lines.push(''); - // Tools list (from bridge cache, no extra server call) - if (tools && tools.length > 0) { - lines.push(formatToolsCompact(tools, { sessionName: target })); - lines.push(''); - } - - // Instructions in code block - const trimmed = instructions ? instructions.trim() : ''; - if (trimmed) { - lines.push(chalk.bold('Instructions:')); - lines.push(chalk.gray('````')); - lines.push(trimmed); - lines.push(chalk.gray('````')); - } - return lines.join('\n'); } diff --git a/test/e2e/suites/basic/human-output.test.sh b/test/e2e/suites/basic/human-output.test.sh index caa210f..e2565b6 100755 --- a/test/e2e/suites/basic/human-output.test.sh +++ b/test/e2e/suites/basic/human-output.test.sh @@ -25,7 +25,7 @@ test_pass test_case "tools-list contains header with count" run_mcpc "$SESSION" tools-list assert_success -assert_contains "$STDOUT" "Available tools" +assert_contains "$STDOUT" "Tools (" test_pass test_case "tools-list contains tool names in backticks" @@ -86,7 +86,7 @@ test_pass test_case "resources-list contains header with count" run_mcpc "$SESSION" resources-list assert_success -assert_contains "$STDOUT" "Available resources" +assert_contains "$STDOUT" "Resources (" test_pass test_case "resources-list contains resource URIs" @@ -114,7 +114,7 @@ test_pass test_case "resources-templates-list contains header" run_mcpc "$SESSION" resources-templates-list assert_success -assert_contains "$STDOUT" "Available resource templates" +assert_contains "$STDOUT" "Resource templates (" test_pass test_case "resources-templates-list contains URI templates" @@ -130,7 +130,7 @@ test_pass test_case "prompts-list contains header with count" run_mcpc "$SESSION" prompts-list assert_success -assert_contains "$STDOUT" "Available prompts" +assert_contains "$STDOUT" "Prompts (" test_pass test_case "prompts-list contains prompt names" diff --git a/test/unit/cli/output.test.ts b/test/unit/cli/output.test.ts index 493c35d..73bea4d 100644 --- a/test/unit/cli/output.test.ts +++ b/test/unit/cli/output.test.ts @@ -466,7 +466,7 @@ describe('formatTools', () => { describe('compact format (default)', () => { it('should show header with tool count', () => { const output = formatTools(sampleTools); - expect(output).toContain('Available tools (2):'); + expect(output).toContain('Tools (2):'); }); it('should show tool names in backticks', () => { @@ -570,7 +570,7 @@ describe('formatTools', () => { it('should handle empty tools array', () => { const output = formatTools([]); - expect(output).toContain('Available tools (0):'); + expect(output).toContain('Tools (0):'); }); it('should show task mode for tools with task support', () => { @@ -1008,7 +1008,7 @@ describe('formatResources', () => { const output = formatResources(resources); // Should have header with count - expect(output).toContain('Available resources (2):'); + expect(output).toContain('Resources (2):'); // Should have summary list expect(output).toContain('* `file:///home/user/data.json`'); @@ -1024,7 +1024,7 @@ describe('formatResources', () => { it('should show empty list message for no resources', () => { const resources: Resource[] = []; const output = formatResources(resources); - expect(output).toContain('Available resources (0):'); + expect(output).toContain('Resources (0):'); }); }); @@ -1092,7 +1092,7 @@ describe('formatResourceTemplates', () => { const output = formatResourceTemplates(templates); // Should have header with count - expect(output).toContain('Available resource templates (2):'); + expect(output).toContain('Resource templates (2):'); // Should have summary list expect(output).toContain('* `file:///{path}`'); @@ -1152,7 +1152,7 @@ describe('formatPrompts', () => { const output = formatPrompts(prompts); // Should have header with count - expect(output).toContain('Available prompts (2):'); + expect(output).toContain('Prompts (2):'); // Should have summary list expect(output).toContain('* `greeting`');