Skip to content
Closed
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
5 changes: 5 additions & 0 deletions src/__tests__/dry-run-load-path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ vi.mock('../utils/reports-branch.js', async (importOriginal) => ({

import { contribute } from '../contribute.js';
import { loadLocalConfigForScope } from '../config.js';
import { mcpInject, mcpList } from '../mcp-cmd.js';
import { pull } from '../pull.js';
import { push } from '../push.js';
import { recall } from '../recall.js';
Expand Down Expand Up @@ -252,6 +253,8 @@ describe('--dry-run through the loaders the commands share (#850)', () => {
const LOAD_ONLY_COMMANDS: Array<[string, () => Promise<void>]> = [
['pull --dry-run', () => pull({ dryRun: true })],
['push --dry-run', () => push({ dryRun: true })],
['mcp inject --dry-run', () => mcpInject({ dryRun: true })],
['mcp list', () => mcpList({})],
['status', () => status({})],
['list', () => list(undefined, {})],
];
Expand Down Expand Up @@ -286,6 +289,8 @@ describe('--dry-run through the loaders the commands share (#850)', () => {
// The issue report located these by code path only; they are run here.
const PROJECT_SCOPE_COMMANDS: Array<[string, () => Promise<void>]> = [
['pull --dry-run', () => pull({ dryRun: true })],
['mcp inject --dry-run', () => mcpInject({ dryRun: true })],
['mcp list', () => mcpList({})],
['status', () => status({})],
['list', () => list(undefined, {})],
];
Expand Down
4 changes: 2 additions & 2 deletions src/mcp-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function displayPath(p: string): string {

/** Print team MCP servers, their secret requirements, and where they are installed. */
export async function mcpList(_options: GlobalOptions): Promise<void> {
const { localConfig, teamConfig } = await autoDetectInit();
const { localConfig, teamConfig } = await autoDetectInit(undefined, { dryRun: true });
const resolution = await resolveEntriesFor(mcpEntryReader, localConfig);
if (resolution.kind === 'failed') {
log.error(describeEntryFailure(resolution.failure));
Expand Down Expand Up @@ -95,7 +95,7 @@ function reportChanges(changes: McpChange[]): void {
export async function mcpInject(
options: GlobalOptions & { dryRun?: boolean; force?: boolean },
): Promise<void> {
const { localConfig, teamConfig } = await autoDetectInit();
const { localConfig, teamConfig } = await autoDetectInit(undefined, { dryRun: options.dryRun });
const { changes, wrote, unresolved } = await reconcileMcpForConfig(teamConfig, localConfig, {
dryRun: options.dryRun,
force: options.force,
Expand Down
Loading