Skip to content

Commit 4c47671

Browse files
committed
test(mcp): cover http add and sse rejection paths
1 parent c33d098 commit 4c47671

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎tests/mcpCliCommands.spec.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,29 @@ describe('MCP CLI subcommands', () => {
125125
args: ['-y', '@mcp/server@latest', 'arg1', 'arg2'],
126126
});
127127
});
128+
129+
it('adds an HTTP transport server', () => {
130+
const result = runCli('mcp add --transport http context7 https://mcp.context7.com/mcp');
131+
132+
expect(result.exitCode).toBe(0);
133+
expect(result.stdout).toContain('Added "context7"');
134+
expect(result.stdout).toContain('http');
135+
136+
const config = fs.readJsonSync(configPath);
137+
expect(config.mcp.servers[0]).toMatchObject({
138+
name: 'context7',
139+
transport: 'http',
140+
url: 'https://mcp.context7.com/mcp',
141+
autoConnect: true,
142+
});
143+
});
144+
145+
it('rejects SSE transport from CLI add', () => {
146+
const result = runCli('mcp add --transport sse my-sse http://localhost:3001/mcp');
147+
148+
expect(result.exitCode).toBe(1);
149+
expect(result.stdout).toContain('not implemented');
150+
});
128151
});
129152

130153
describe('mcp remove', () => {

0 commit comments

Comments
 (0)