fix: mcp command accepts --project directly for Claude spawned processes
The mcp subcommand now has its own -p/--project option with passThroughOptions(), so `mcpctl mcp --project NAME` works when Claude spawns the process. Updated config claude to generate args: ['mcp', '--project', project] and added Commander-level tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ describe('config claude', () => {
|
||||
const written = JSON.parse(readFileSync(outPath, 'utf-8'));
|
||||
expect(written.mcpServers['homeautomation']).toEqual({
|
||||
command: 'mcpctl',
|
||||
args: ['mcp', '-p', 'homeautomation'],
|
||||
args: ['mcp', '--project', 'homeautomation'],
|
||||
});
|
||||
expect(output.join('\n')).toContain('1 server(s)');
|
||||
});
|
||||
@@ -60,7 +60,7 @@ describe('config claude', () => {
|
||||
const parsed = JSON.parse(output[0]);
|
||||
expect(parsed.mcpServers['myproj']).toEqual({
|
||||
command: 'mcpctl',
|
||||
args: ['mcp', '-p', 'myproj'],
|
||||
args: ['mcp', '--project', 'myproj'],
|
||||
});
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('config claude', () => {
|
||||
expect(written.mcpServers['existing--server']).toBeDefined();
|
||||
expect(written.mcpServers['proj-1']).toEqual({
|
||||
command: 'mcpctl',
|
||||
args: ['mcp', '-p', 'proj-1'],
|
||||
args: ['mcp', '--project', 'proj-1'],
|
||||
});
|
||||
expect(output.join('\n')).toContain('2 server(s)');
|
||||
});
|
||||
@@ -96,7 +96,7 @@ describe('config claude', () => {
|
||||
const written = JSON.parse(readFileSync(outPath, 'utf-8'));
|
||||
expect(written.mcpServers['proj-1']).toEqual({
|
||||
command: 'mcpctl',
|
||||
args: ['mcp', '-p', 'proj-1'],
|
||||
args: ['mcp', '--project', 'proj-1'],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user