Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IDE
.idea
.vscode
.claude

# Dependencies
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')} <name>
<@session> ${chalk.cyan('tools-list')} List MCP server tools
<@session> ${chalk.cyan('tools-get')} <name> Get tool details and schema
<@session> ${chalk.cyan('tools-call')} <name> [arg:=val ... | <json> | <stdin]
<@session> ${chalk.cyan('prompts-list')}
<@session> ${chalk.cyan('prompts-get')} <name> [arg:=val ... | <json> | <stdin]
Expand Down
40 changes: 20 additions & 20 deletions src/cli/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function formatToolsSummary(tools: Tool[]): string[] {
const lines: string[] = [];

// Header with tool count
lines.push(chalk.bold(`Available tools (${tools.length}):`));
lines.push(chalk.bold(`Tools (${tools.length}):`));

// Summary list of tools
const bullet = chalk.dim('*');
Expand Down Expand Up @@ -497,7 +497,7 @@ function formatToolsCompact(tools: Tool[], options?: FormatOptions): string {
const session = options?.sessionName ? `${options.sessionName} ` : '';
lines.push('');
lines.push(
`For full tool details, run \`mcpc ${session}tools-list --full\` or \`mcpc ${session}tools-get <name>\``
`For full tool details and schema, run \`mcpc ${session}tools-list --full\` or \`mcpc ${session}tools-get <name>\``
);

return lines.join('\n');
Expand Down Expand Up @@ -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('*');
Expand Down Expand Up @@ -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('*');
Expand Down Expand Up @@ -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('*');
Expand Down Expand Up @@ -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[] = [];
Expand Down Expand Up @@ -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');
}
8 changes: 4 additions & 4 deletions test/e2e/suites/basic/human-output.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions test/unit/cli/output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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`');
Expand All @@ -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):');
});
});

Expand Down Expand Up @@ -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}`');
Expand Down Expand Up @@ -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`');
Expand Down
Loading