Skip to content

Commit a42f677

Browse files
committed
refactor: remove dead bind flow and rename MCP Tool to Gateway Target (#459)
* refactor: remove mode selection and bind flow from gateway target wizard * fix: rename 'MCP Tool' to 'Gateway Target' in UI labels, CLI output, and comments * fix: update CDK asset snapshot for cdk/bin/cdk.ts * fix: prettier formatting for AddGatewayTargetFlow.tsx
1 parent 5b3cd23 commit a42f677

File tree

24 files changed

+55
-244
lines changed

24 files changed

+55
-244
lines changed

src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ async function main() {
100100
const stackName = toStackName(spec.name, target.name);
101101
102102
// Extract credentials from deployed state for this target
103-
const targetState = (deployedState as Record<string, unknown>)?.targets as Record<string, Record<string, unknown>> | undefined;
103+
const targetState = (deployedState as Record<string, unknown>)?.targets as
104+
| Record<string, Record<string, unknown>>
105+
| undefined;
104106
const targetResources = targetState?.[target.name]?.resources as Record<string, unknown> | undefined;
105-
const credentials = targetResources?.credentials as Record<string, { credentialProviderArn: string; clientSecretArn?: string }> | undefined;
107+
const credentials = targetResources?.credentials as
108+
| Record<string, { credentialProviderArn: string; clientSecretArn?: string }>
109+
| undefined;
106110
107111
new AgentCoreStack(app, stackName, {
108112
spec,

src/cli/commands/add/__tests__/add-gateway-target.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
55
import { join } from 'node:path';
66
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
77

8-
// MCP Tool feature is disabled (coming soon) - skip all tests
8+
// Gateway Target feature is disabled (coming soon) - skip all tests
99
describe.skip('add gateway-target command', () => {
1010
let testDir: string;
1111
let projectDir: string;

src/cli/commands/add/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export async function handleAddGateway(options: ValidatedAddGatewayOptions): Pro
283283
}
284284
}
285285

286-
// MCP Tool handler
286+
// Gateway Target handler
287287
export function buildGatewayTargetConfig(options: ValidatedAddGatewayTargetOptions): AddGatewayTargetConfig {
288288
const sourcePath = `${APP_DIR}/${MCP_APP_SUBDIR}/${options.name}`;
289289

src/cli/commands/add/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function handleAddGatewayTargetCLI(options: AddGatewayTargetOptions): Prom
131131
if (options.json) {
132132
console.log(JSON.stringify(result));
133133
} else if (result.success) {
134-
console.log(`Added MCP tool '${result.toolName}'`);
134+
console.log(`Added gateway target '${result.toolName}'`);
135135
if (result.sourcePath) {
136136
console.log(`Tool code: ${result.sourcePath}`);
137137
}

src/cli/commands/add/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface AddGatewayResult {
4141
error?: string;
4242
}
4343

44-
// MCP Tool types
44+
// Gateway Target types
4545
export interface AddGatewayTargetOptions {
4646
name?: string;
4747
description?: string;

src/cli/commands/add/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export function validateAddGatewayOptions(options: AddGatewayOptions): Validatio
183183
return { valid: true };
184184
}
185185

186-
// MCP Tool validation
186+
// Gateway Target validation
187187
export async function validateAddGatewayTargetOptions(options: AddGatewayTargetOptions): Promise<ValidationResult> {
188188
if (!options.name) {
189189
return { valid: false, error: '--name is required' };

src/cli/commands/remove/__tests__/remove-gateway-target.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
55
import { join } from 'node:path';
66
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
77

8-
// MCP Tool feature is disabled (coming soon) - skip all tests
8+
// Gateway Target feature is disabled (coming soon) - skip all tests
99
describe.skip('remove gateway-target command', () => {
1010
let testDir: string;
1111
let projectDir: string;

src/cli/commands/remove/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ export async function handleRemove(options: ValidatedRemoveOptions): Promise<Rem
4949
case 'gateway-target': {
5050
const tools = await getRemovableGatewayTargets();
5151
const tool = tools.find(t => t.name === name);
52-
if (!tool) return { success: false, error: `MCP tool '${name}' not found` };
52+
if (!tool) return { success: false, error: `Gateway target '${name}' not found` };
5353
const result = await removeGatewayTarget(tool);
5454
if (!result.ok) return { success: false, error: result.error };
5555
return {
5656
success: true,
5757
resourceType,
5858
resourceName: name,
59-
message: `Removed MCP tool '${name}'`,
59+
message: `Removed gateway target '${name}'`,
6060
note: SOURCE_CODE_NOTE,
6161
};
6262
}

src/cli/commands/remove/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const registerRemove = (program: Command) => {
142142
registerResourceRemove(removeCommand, 'memory', 'memory', 'Remove a memory provider from the project');
143143
registerResourceRemove(removeCommand, 'identity', 'identity', 'Remove an identity provider from the project');
144144

145-
registerResourceRemove(removeCommand, 'gateway-target', 'gateway-target', 'Remove an MCP tool from the project');
145+
registerResourceRemove(removeCommand, 'gateway-target', 'gateway-target', 'Remove a gateway target from the project');
146146

147147
registerResourceRemove(removeCommand, 'gateway', 'gateway', 'Remove a gateway from the project');
148148

src/cli/operations/mcp/create-mcp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function readMcpDefs(filePath: string): Promise<AgentCoreCliMcpDefs> {
4545
const parsed = JSON.parse(raw) as unknown;
4646
const result = AgentCoreCliMcpDefsSchema.safeParse(parsed);
4747
if (!result.success) {
48-
throw new Error('Invalid mcp-defs.json. Fix it before adding a new MCP tool.');
48+
throw new Error('Invalid mcp-defs.json. Fix it before adding a new gateway target.');
4949
}
5050
return result.data;
5151
}
@@ -211,7 +211,7 @@ export async function createGatewayFromWizard(config: AddGatewayConfig): Promise
211211

212212
function validateGatewayTargetLanguage(language: string): asserts language is 'Python' | 'TypeScript' | 'Other' {
213213
if (language !== 'Python' && language !== 'TypeScript' && language !== 'Other') {
214-
throw new Error(`MCP tools for language "${language}" are not yet supported.`);
214+
throw new Error(`Gateway targets for language "${language}" are not yet supported.`);
215215
}
216216
}
217217

@@ -288,7 +288,7 @@ export async function createExternalGatewayTarget(config: AddGatewayTargetConfig
288288
}
289289

290290
/**
291-
* Create an MCP tool (behind gateway only).
291+
* Create a gateway target (behind gateway only).
292292
*/
293293
export async function createToolFromWizard(config: AddGatewayTargetConfig): Promise<CreateToolResult> {
294294
validateGatewayTargetLanguage(config.language);
@@ -400,7 +400,7 @@ export async function createToolFromWizard(config: AddGatewayTargetConfig): Prom
400400
throw new Error(`MCP saved, but failed to update mcp-defs.json: ${message}`);
401401
}
402402

403-
// Render MCP tool project template
403+
// Render gateway target project template
404404
// Resolve absolute path from project root
405405
const configRoot = requireConfigRoot();
406406
const projectRoot = dirname(configRoot);

0 commit comments

Comments
 (0)