Skip to content

Commit 33a0ab2

Browse files
committed
Removed connection reference for built in mcp
1 parent bdafda0 commit 33a0ab2

File tree

2 files changed

+6
-68
lines changed

2 files changed

+6
-68
lines changed

libs/designer-v2/src/lib/core/actions/bjsworkflow/serializer.ts

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
LogEntryLevel,
2727
LoggerService,
2828
OperationManifestService,
29-
ConnectionService,
3029
WorkflowService,
3130
getIntl,
3231
create,
@@ -167,15 +166,8 @@ export const serializeWorkflow = async (rootState: RootState, options?: Serializ
167166
}
168167

169168
const operation = getRecordEntry(rootState.operations.operationInfo, nodeId);
170-
// DEBUG: Log MCP connection filtering
171-
if (referenceKey === 'mcpclient' || referenceKey?.includes('mcp')) {
172-
console.log(
173-
`[MCP Debug] nodeId=${nodeId}, referenceKey=${referenceKey}, operation.type=${operation?.type}, operation.kind=${operation?.kind}, isBuiltIn=${operation ? isBuiltInMcpOperation(operation) : 'no-op'}`
174-
);
175-
}
176-
169+
// Built-in MCP operations don't use connection references; exclude them
177170
if (operation && isBuiltInMcpOperation(operation)) {
178-
console.log(`[MCP Filter] Skipping MCP connection: ${referenceKey}`);
179171
return references;
180172
}
181173

@@ -552,32 +544,9 @@ const serializeBuiltInMcpOperation = async (rootState: RootState, nodeId: string
552544

553545
const operationFromWorkflow = getRecordEntry(rootState.workflow.operations, nodeId) as LogicAppsV2.OperationDefinition;
554546

555-
// Look up the connection to get MCP server URL and authentication type
556-
const referenceKey = getRecordEntry(rootState.connections.connectionsMapping, nodeId);
557-
const connectionReference = referenceKey ? getRecordEntry(rootState.connections.connectionReferences, referenceKey) : undefined;
558-
const connectionId = connectionReference?.connection?.id;
559-
560-
let mcpServerUrl = '';
561-
let authenticationType = 'None';
562-
563-
if (connectionId) {
564-
try {
565-
const connection = await ConnectionService().getConnection(connectionId);
566-
const parameterValues = (connection?.properties as any)?.parameterValues;
567-
if (parameterValues) {
568-
mcpServerUrl = parameterValues.mcpServerUrl ?? '';
569-
authenticationType = parameterValues.authenticationType ?? 'None';
570-
}
571-
} catch {
572-
// Fall back to empty values if connection lookup fails
573-
}
574-
}
575-
547+
// Built-in MCP operations: MCP server URL and authentication are passed as parameters.
548+
// No pseudo-connection is needed; backend handles implicit MCP connection.
576549
const inputs = {
577-
Connection: {
578-
McpServerUrl: mcpServerUrl,
579-
Authentication: authenticationType,
580-
},
581550
parameters: {
582551
...inputParameters.parameters,
583552
},

libs/designer/src/lib/core/actions/bjsworkflow/serializer.ts

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
LogEntryLevel,
2727
LoggerService,
2828
OperationManifestService,
29-
ConnectionService,
3029
WorkflowService,
3130
getIntl,
3231
create,
@@ -167,15 +166,8 @@ export const serializeWorkflow = async (rootState: RootState, options?: Serializ
167166
}
168167

169168
const operation = getRecordEntry(rootState.operations.operationInfo, nodeId);
170-
// DEBUG: Log MCP connection filtering
171-
if (referenceKey === 'mcpclient' || referenceKey?.includes('mcp')) {
172-
console.log(
173-
`[MCP Debug] nodeId=${nodeId}, referenceKey=${referenceKey}, operation.type=${operation?.type}, operation.kind=${operation?.kind}, isBuiltIn=${operation ? isBuiltInMcpOperation(operation) : 'no-op'}`
174-
);
175-
}
176-
169+
// Built-in MCP operations don't use connection references; exclude them
177170
if (operation && isBuiltInMcpOperation(operation)) {
178-
console.log(`[MCP Filter] Skipping MCP connection: ${referenceKey}`);
179171
return references;
180172
}
181173

@@ -548,32 +540,9 @@ const serializeBuiltInMcpOperation = async (rootState: RootState, nodeId: string
548540

549541
const operationFromWorkflow = getRecordEntry(rootState.workflow.operations, nodeId) as LogicAppsV2.OperationDefinition;
550542

551-
// Look up the connection to get MCP server URL and authentication type
552-
const referenceKey = getRecordEntry(rootState.connections.connectionsMapping, nodeId);
553-
const connectionReference = referenceKey ? getRecordEntry(rootState.connections.connectionReferences, referenceKey) : undefined;
554-
const connectionId = connectionReference?.connection?.id;
555-
556-
let mcpServerUrl = '';
557-
let authenticationType = 'None';
558-
559-
if (connectionId) {
560-
try {
561-
const connection = await ConnectionService().getConnection(connectionId);
562-
const parameterValues = (connection?.properties as any)?.parameterValues;
563-
if (parameterValues) {
564-
mcpServerUrl = parameterValues.mcpServerUrl ?? '';
565-
authenticationType = parameterValues.authenticationType ?? 'None';
566-
}
567-
} catch {
568-
// Fall back to empty values if connection lookup fails
569-
}
570-
}
571-
543+
// Built-in MCP operations: MCP server URL and authentication are passed as parameters.
544+
// No pseudo-connection is needed; backend handles implicit MCP connection.
572545
const inputs = {
573-
Connection: {
574-
McpServerUrl: mcpServerUrl,
575-
Authentication: authenticationType,
576-
},
577546
parameters: {
578547
...inputParameters.parameters,
579548
},

0 commit comments

Comments
 (0)