Skip to content
Open
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
4 changes: 0 additions & 4 deletions src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,8 @@ export function formatServerDetails(

if (isHttpServer(config)) {
lines.push(`${color('Transport:', colors.bold)} HTTP`);
lines.push(`${color('URL:', colors.bold)} ${config.url}`);
} else {
lines.push(`${color('Transport:', colors.bold)} stdio`);
lines.push(
`${color('Command:', colors.bold)} ${config.command} ${(config.args || []).join(' ')}`,
);
}

if (instructions) {
Expand Down
36 changes: 36 additions & 0 deletions tests/output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { describe, test, expect } from 'bun:test';
import {
formatServerDetails,
formatServerList,
formatSearchResults,
formatToolSchema,
Expand Down Expand Up @@ -101,6 +102,41 @@ describe('output', () => {
});
});

describe('formatServerDetails', () => {
test('shows transport without stdio command details', () => {
const output = formatServerDetails(
'filesystem',
{
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.'],
},
[],
);

expect(output).toContain('Server:');
expect(output).toContain('filesystem');
expect(output).toContain('Transport:');
expect(output).toContain('stdio');
expect(output).not.toContain('Command:');
expect(output).not.toContain('@modelcontextprotocol/server-filesystem');
});

test('shows transport without http endpoint details', () => {
const output = formatServerDetails(
'deepwiki',
{ url: 'https://mcp.deepwiki.com/mcp' },
[],
);

expect(output).toContain('Server:');
expect(output).toContain('deepwiki');
expect(output).toContain('Transport:');
expect(output).toContain('HTTP');
expect(output).not.toContain('URL:');
expect(output).not.toContain('https://mcp.deepwiki.com/mcp');
});
});

describe('formatToolSchema', () => {
test('formats tool with schema', () => {
const tool = {
Expand Down