Skip to content

Commit 53e60f9

Browse files
authored
fix(designerv2): MCP servers fit and finish (#8863)
fix(designerv2): mcp wizard fit and finish
1 parent 5daf50f commit 53e60f9

File tree

7 files changed

+128
-47
lines changed

7 files changed

+128
-47
lines changed

Localize/lang/strings.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,7 @@
14201420
"Uxckds": "Suggested flow",
14211421
"V+/c21": "General",
14221422
"V0ZbQO": "Show less",
1423+
"V1U5Gz": "MCP servers added directly to a single logic app for quick setup, experiments, or proofs of concept.",
14231424
"V3vpin": "''{parameterName}'' is no longer present in the operation schema. It should be removed before the workflow is re-saved.",
14241425
"V5f3ha": "Week",
14251426
"V7NT3q": "Connected",
@@ -1474,6 +1475,7 @@
14741475
"WCASt1": "Describe something in your flow that should be replaced, as well as what should replace it. Add details where possible, including the connector to use and if any content should be included.",
14751476
"WDROA9": "Back",
14761477
"WGwH45": "Clear",
1478+
"WIIV8A": "MCP servers provided and managed by Microsoft.",
14771479
"WMX2ig": "What is the concurrency setting of this workflow?",
14781480
"WOEOfm": "Tool management",
14791481
"WP8egw": "Select an option",
@@ -1587,7 +1589,7 @@
15871589
"YTJ78g": "Learn how to assign it",
15881590
"YUbSFS": "Yes/No",
15891591
"YV6qd0": "Agent activity",
1590-
"YW1rx0": "Add new",
1592+
"YW1rx0": "Create a new connection",
15911593
"YWD/RY": "condition, collapse",
15921594
"YWws/r": "Output names should not be empty.",
15931595
"YX0jQs": "All",
@@ -3074,6 +3076,7 @@
30743076
"_Uxckds.comment": "Title for the suggested flow section",
30753077
"_V+/c21.comment": "title for general setting section",
30763078
"_V0ZbQO.comment": "Toggle button text for hiding advanced parameters",
3079+
"_V1U5Gz.comment": "Description text for Others MCP servers tab",
30773080
"_V3vpin.comment": "Unknown Parameter error message. Do not remove the double single quotes around the display name, as it is needed to wrap the placeholder text.",
30783081
"_V5f3ha.comment": "Frequency value ",
30793082
"_V7NT3q.comment": "Text indicating a connector is connected",
@@ -3128,6 +3131,7 @@
31283131
"_WCASt1.comment": "Chatbot prompt to replace an action description",
31293132
"_WDROA9.comment": "Back button text",
31303133
"_WGwH45.comment": "Label to clear editor",
3134+
"_WIIV8A.comment": "Description text for Microsoft MCP servers tab",
31313135
"_WMX2ig.comment": "Chatbot suggestion message to get the concurrency setting of the workflow",
31323136
"_WOEOfm.comment": "Label for tool selection mode",
31333137
"_WP8egw.comment": "Placeholder text for dropdown editor",
@@ -3241,7 +3245,7 @@
32413245
"_YTJ78g.comment": "Link text to learn how to assign the required role for the session pool in Azure Container Apps",
32423246
"_YUbSFS.comment": "Placeholder title for a newly inserted Boolean parameter",
32433247
"_YV6qd0.comment": "Chat view tab title",
3244-
"_YW1rx0.comment": "Link text to add a new connection",
3248+
"_YW1rx0.comment": "Button text to create a new connection",
32453249
"_YWD/RY.comment": "condition",
32463250
"_YWws/r.comment": "Invalid output names",
32473251
"_YX0jQs.comment": "All templates tab",
@@ -3467,6 +3471,7 @@
34673471
"_daoo3l.comment": "Text to show which connection is connected to the node",
34683472
"_ddnfTx.comment": "Aria label for refresh button",
34693473
"_dfKsgg.comment": "Chatbot report a bug button",
3474+
"_dfYgIR.comment": "Description text for Custom MCP servers tab",
34703475
"_dfmH55.comment": "Command for italic text for non-mac users",
34713476
"_dgPMsl.comment": "Completed status message in mock card.",
34723477
"_dhlB0s.comment": "Loading aria-label for workflows list",
@@ -3813,7 +3818,6 @@
38133818
"_lLhS3T.comment": "Button text for creating new workflows",
38143819
"_lM9qrG.comment": "Time zone value ",
38153820
"_lPTdSf.comment": "Button text for run trigger",
3816-
"_lPj8hf.comment": "Description for create connection step",
38173821
"_lQNKUB.comment": "Describes connection being added",
38183822
"_lR7V87.comment": "Section header for the functions section",
38193823
"_lSUNx5.comment": "Action Tracking ID text",
@@ -4653,6 +4657,7 @@
46534657
"daoo3l": "Connected to {connectionName}.",
46544658
"ddnfTx": "Refresh",
46554659
"dfKsgg": "Sorry, I couldn't understand your request. Please rephrase it and try again.",
4660+
"dfYgIR": "MCP servers created or managed by your organization for reuse across logic apps, with enterprise-level authentication.",
46564661
"dfmH55": "Italic (Ctrl+I)",
46574662
"dgPMsl": "Completed",
46584663
"dhlB0s": "Loading workflows aria label",
@@ -4999,7 +5004,6 @@
49995004
"lLhS3T": "Create new workflows",
50005005
"lM9qrG": "(UTC+13:00) Nuku'alofa",
50015006
"lPTdSf": "Run trigger",
5002-
"lPj8hf": "Create a new connection for the MCP server.",
50035007
"lQNKUB": "A line for the parent element is added automatically.",
50045008
"lR7V87": "Functions",
50055009
"lSUNx5": "Action tracking ID",

libs/designer-v2/src/lib/ui/panel/recommendation/browse/__test__/mcpServersBrowse.spec.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,34 @@ describe('McpServersBrowse', () => {
295295
expect(screen.getByTestId('grid-item-nativemcpclient')).toBeDefined();
296296
});
297297

298+
test('should list builtin MCP server operation first in Others tab', async () => {
299+
const mockConnection = {
300+
id: 'conn-123',
301+
name: 'my-connection',
302+
type: 'builtinMcpClientToolConnection',
303+
properties: {
304+
displayName: 'My Connection',
305+
api: {
306+
id: 'connectionProviders/mcpclient',
307+
},
308+
},
309+
};
310+
311+
mockUseConnectionsForConnector.mockReturnValue({
312+
data: [mockConnection],
313+
isLoading: false,
314+
} as any);
315+
316+
render(<McpServersBrowse />, { wrapper: createWrapper() });
317+
fireEvent.click(screen.getByRole('tab', { name: 'Others' }));
318+
319+
await waitFor(() => {
320+
const gridItems = document.querySelectorAll('[data-testid^="grid-item-"]');
321+
expect(gridItems.length).toBeGreaterThan(0);
322+
expect(gridItems[0]?.getAttribute('data-testid')).toBe('grid-item-nativemcpclient');
323+
});
324+
});
325+
298326
test('should force create connection for builtin MCP server', async () => {
299327
render(<McpServersBrowse />, { wrapper: createWrapper() });
300328

libs/designer-v2/src/lib/ui/panel/recommendation/browse/__test__/mcpToolWizard.spec.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,30 @@ describe('McpToolWizard', () => {
360360
const cancelButtons = screen.getAllByTestId('create-connection-cancel');
361361
expect(cancelButtons.length).toBeGreaterThan(0);
362362
});
363+
364+
test('should not show create-connection description text in empty state', () => {
365+
render(<McpToolWizard />, { wrapper: createWrapper() });
366+
367+
expect(screen.queryByText('Create a new connection for the MCP server.')).toBeNull();
368+
});
369+
370+
test('should not show create-connection description text when connections exist', () => {
371+
mockUseConnectionsForConnector.mockReturnValue({
372+
data: [
373+
{
374+
id: 'conn-1',
375+
name: 'connection-1',
376+
properties: { displayName: 'Connection 1' },
377+
},
378+
],
379+
isLoading: false,
380+
refetch: vi.fn(),
381+
} as any);
382+
383+
render(<McpToolWizard />, { wrapper: createWrapper() });
384+
385+
expect(screen.queryByText('Create a new connection for the MCP server.')).toBeNull();
386+
});
363387
});
364388

365389
describe('Wizard Navigation', () => {

libs/designer-v2/src/lib/ui/panel/recommendation/browse/mcpServersBrowse.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,31 @@ export const McpServersBrowse = ({ onOperationClick: _onOperationClick }: McpSer
5555
description: 'Text shown when no MCP servers are available',
5656
});
5757

58-
const descriptionText = intl.formatMessage({
58+
const allTabDescriptionText = intl.formatMessage({
5959
defaultMessage: 'Choose a Model Context Protocol (MCP) server to invoke.',
6060
id: 'EvgBRe',
6161
description: 'Description text for MCP server selection',
6262
});
6363

64+
const microsoftTabDescriptionText = intl.formatMessage({
65+
defaultMessage: 'MCP servers provided and managed by Microsoft.',
66+
id: 'WIIV8A',
67+
description: 'Description text for Microsoft MCP servers tab',
68+
});
69+
70+
const customTabDescriptionText = intl.formatMessage({
71+
defaultMessage:
72+
'MCP servers created or managed by your organization for reuse across logic apps, with enterprise-level authentication.',
73+
id: 'dfYgIR',
74+
description: 'Description text for Custom MCP servers tab',
75+
});
76+
77+
const othersTabDescriptionText = intl.formatMessage({
78+
defaultMessage: 'MCP servers added directly to a single logic app for quick setup, experiments, or proofs of concept.',
79+
id: 'V1U5Gz',
80+
description: 'Description text for Others MCP servers tab',
81+
});
82+
6483
const allTabText = intl.formatMessage({
6584
defaultMessage: 'All',
6685
id: 'hGbRBS',
@@ -132,7 +151,7 @@ export const McpServersBrowse = ({ onOperationClick: _onOperationClick }: McpSer
132151
return [builtinMcpServerOperation, ...filtered];
133152
}
134153
if (selectedTab === 'others') {
135-
return [...filtered, builtinMcpServerOperation];
154+
return [builtinMcpServerOperation, ...filtered];
136155
}
137156
return filtered;
138157
}, [mcpServers, mcpConnections, selectedTab, sortOrder, isMicrosoftServer]);
@@ -146,6 +165,15 @@ export const McpServersBrowse = ({ onOperationClick: _onOperationClick }: McpSer
146165
{ count: filteredAndSortedServers.length }
147166
);
148167

168+
const descriptionText =
169+
selectedTab === 'microsoft'
170+
? microsoftTabDescriptionText
171+
: selectedTab === 'custom'
172+
? customTabDescriptionText
173+
: selectedTab === 'others'
174+
? othersTabDescriptionText
175+
: allTabDescriptionText;
176+
149177
if (isLoading) {
150178
return (
151179
<div className={classes.loadingContainer}>

libs/designer-v2/src/lib/ui/panel/recommendation/browse/mcpToolWizard.tsx

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,9 @@ export const McpToolWizard = () => {
506506
description: 'Retry button text',
507507
}),
508508
addConnectionLink: intl.formatMessage({
509-
defaultMessage: 'Add new',
509+
defaultMessage: 'Create a new connection',
510510
id: 'YW1rx0',
511-
description: 'Link text to add a new connection',
512-
}),
513-
createConnectionDescription: intl.formatMessage({
514-
defaultMessage: 'Create a new connection for the MCP server.',
515-
id: 'lPj8hf',
516-
description: 'Description for create connection step',
511+
description: 'Button text to create a new connection',
517512
}),
518513
}),
519514
[intl]
@@ -532,23 +527,13 @@ export const McpToolWizard = () => {
532527

533528
const buttonContents: TemplatePanelFooterProps['buttonContents'] = [
534529
{
535-
type: 'navigation',
530+
type: 'action',
536531
text: INTL_TEXT.backButton,
537532
onClick: handleBack,
538533
appearance: 'subtle',
539534
},
540535
];
541536

542-
// Add "Add a connection" button on connection step
543-
if (isConnectionStep) {
544-
buttonContents.push({
545-
type: 'action',
546-
text: INTL_TEXT.addConnectionLink,
547-
onClick: handleAddConnectionClick,
548-
appearance: 'subtle',
549-
});
550-
}
551-
552537
// Disable Done button if in "selected tools" mode with no tools selected
553538
const isDoneDisabled =
554539
(isConnectionStep && !localConnectionId) || (isParametersStep && toolSelectionMode === 'selected' && localAllowedTools.length === 0);
@@ -600,12 +585,14 @@ export const McpToolWizard = () => {
600585
}
601586

602587
return (
603-
<ConnectionTable
604-
connections={validConnections}
605-
currentConnectionId={localConnectionId}
606-
saveSelectionCallback={handleConnectionTableSelect}
607-
isXrmConnectionReferenceMode={false}
608-
/>
588+
<div className={classes.connectionStepContainer}>
589+
<ConnectionTable
590+
connections={validConnections}
591+
currentConnectionId={localConnectionId}
592+
saveSelectionCallback={handleConnectionTableSelect}
593+
isXrmConnectionReferenceMode={false}
594+
/>
595+
</div>
609596
);
610597
};
611598

@@ -749,9 +736,6 @@ export const McpToolWizard = () => {
749736
if (isConnectionStep) {
750737
return INTL_TEXT.step1Description;
751738
}
752-
if (isCreateConnectionStep) {
753-
return INTL_TEXT.createConnectionDescription;
754-
}
755739
if (isParametersStep) {
756740
return INTL_TEXT.step2Description;
757741
}
@@ -778,6 +762,7 @@ export const McpToolWizard = () => {
778762
// When step 1 is completed but not locked, show checkmark with brand color
779763
const isStep1Locked = (isConnectionLocked || wasOpenedAtCreateConnection) && isParametersStep;
780764
const isStep1Completed = !isConnectionLocked && !wasOpenedAtCreateConnection && isParametersStep;
765+
const stepDescription = getStepDescription();
781766

782767
return (
783768
<div className={classes.container}>
@@ -841,7 +826,7 @@ export const McpToolWizard = () => {
841826
</div>
842827
<Text weight={currentStepNumber === 2 ? 'semibold' : 'regular'}>{INTL_TEXT.step2Label}</Text>
843828
</div>
844-
<Text className={classes.stepDescription}>{getStepDescription()}</Text>
829+
{stepDescription ? <Text className={classes.stepDescription}>{stepDescription}</Text> : null}
845830
{isParametersStep && toolsErrorMessage && (
846831
<div className={classes.warningContainer}>
847832
<MessageBar intent="warning">
@@ -857,6 +842,13 @@ export const McpToolWizard = () => {
857842
</div>
858843
)}
859844
{renderCurrentStep()}
845+
{isConnectionStep ? (
846+
<div className={classes.connectionStepActionContainer}>
847+
<Button onClick={handleAddConnectionClick} size="small">
848+
{INTL_TEXT.addConnectionLink}
849+
</Button>
850+
</div>
851+
) : null}
860852
</div>
861853
{(footerContent.buttonContents?.length ?? 0) > 0 && (
862854
<div className={classes.footer}>

libs/designer-v2/src/lib/ui/panel/recommendation/browse/styles/McpToolWizard.styles.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,24 @@ export const useMcpToolWizardStyles = makeStyles({
125125
...shorthands.gap('12px'),
126126
alignItems: 'flex-start',
127127
},
128-
addConnectionLink: {
129-
marginTop: '8px',
130-
cursor: 'pointer',
131-
color: tokens.colorBrandForeground1,
132-
fontSize: tokens.fontSizeBase300,
133-
'&:hover': {
134-
textDecoration: 'underline',
135-
},
136-
},
137128
createConnectionContainer: {
138129
display: 'flex',
139130
flexDirection: 'column',
140131
flexGrow: 1,
141132
overflowY: 'auto',
142133
},
134+
connectionStepContainer: {
135+
width: '100%',
136+
maxWidth: '100%',
137+
boxSizing: 'border-box',
138+
'& .msla-connection-table': {
139+
width: '100%',
140+
maxWidth: '100%',
141+
boxSizing: 'border-box',
142+
},
143+
},
144+
connectionStepActionContainer: {
145+
display: 'flex',
146+
justifyContent: 'flex-end',
147+
},
143148
});

0 commit comments

Comments
 (0)