Skip to content

Commit 4d0c63c

Browse files
committed
refactor: remove local mcp placeholders
1 parent 0b4fa1c commit 4d0c63c

3 files changed

Lines changed: 11 additions & 49 deletions

File tree

src/commands/semantic-command-surface.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { semanticClientCommands } from './semantic-client-commands.ts';
44
import type { JsonSchema } from './semantic-contract.ts';
55
import { bootSemanticCommand } from './semantic-device.ts';
66
import { interactionSemanticCommands } from './semantic-interactions.ts';
7-
import { semanticLocalCommands } from './semantic-local-commands.ts';
87
import {
98
isSemanticBatchCommand as isSemanticGrammarBatchCommand,
109
semanticBatchCommandNames,
@@ -23,7 +22,6 @@ type CommandSurfaceEntry<TDefinition extends AnySemanticCommandDefinition> = {
2322
definition: TDefinition;
2423
batch: boolean;
2524
genericCli: boolean;
26-
mcp: 'tool' | 'local-boundary';
2725
};
2826

2927
function commandSurfaceEntry<
@@ -100,13 +98,6 @@ const baseCommandSurface = [
10098
...semanticClientCommands.map((definition) =>
10199
commandSurfaceEntry(definition, commandMetadata(definition.name)),
102100
),
103-
...semanticLocalCommands.map((definition) =>
104-
commandSurfaceEntry(definition, {
105-
batch: false,
106-
genericCli: false,
107-
mcp: 'local-boundary',
108-
}),
109-
),
110101
] as const;
111102

112103
const batchSemanticCommand = createBatchSemanticCommand(semanticBatchCommandNames);
@@ -116,7 +107,6 @@ const semanticCommandSurface = [
116107
commandSurfaceEntry(batchSemanticCommand, {
117108
batch: false,
118109
genericCli: true,
119-
mcp: 'tool',
120110
}),
121111
] as const;
122112

@@ -134,14 +124,11 @@ function commandMetadata(
134124
return {
135125
batch: isSemanticGrammarBatchCommand(name),
136126
genericCli: genericCliNames.has(name),
137-
mcp: 'tool',
138127
};
139128
}
140129

141130
export function listSemanticMcpToolDefinitions(): AnySemanticCommandDefinition[] {
142-
return semanticCommandSurface
143-
.filter((entry) => entry.mcp === 'tool' || entry.mcp === 'local-boundary')
144-
.map((entry) => entry.definition);
131+
return semanticCommandSurface.map((entry) => entry.definition);
145132
}
146133

147134
export function listSemanticGenericCliCommands(): SemanticCliCommand[] {

src/commands/semantic-local-commands.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/mcp/__tests__/router.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ import { test } from 'vitest';
33
import { getCliCommandNames } from '../../utils/command-schema.ts';
44
import { handleMcpMessage } from '../router.ts';
55

6-
test('MCP exposes every CLI command as a semantic direct tool except the MCP transport command', async () => {
6+
const LOCAL_ONLY_CLI_COMMANDS = new Set([
7+
'auth',
8+
'connect',
9+
'connection',
10+
'disconnect',
11+
'react-devtools',
12+
]);
13+
14+
test('MCP exposes every automatable CLI command as a semantic direct tool', async () => {
715
const response = await handleMcpMessage({
816
jsonrpc: '2.0',
917
id: 1,
@@ -15,7 +23,7 @@ test('MCP exposes every CLI command as a semantic direct tool except the MCP tra
1523
(tool) => tool.name,
1624
);
1725
const expectedToolNames = getCliCommandNames()
18-
.filter((command) => command !== 'mcp')
26+
.filter((command) => command !== 'mcp' && !LOCAL_ONLY_CLI_COMMANDS.has(command))
1927
.sort();
2028

2129
assert.deepEqual(tools.filter((name) => name !== 'status').sort(), expectedToolNames);

0 commit comments

Comments
 (0)