@@ -321,30 +321,12 @@ describe('MCP Endpoint E2E Tests', () => {
321321 {
322322 "content": [
323323 {
324- "text": "<components>
325- <component>
326- <id>example-button</id>
327- <name>Button</name>
328- <summary>
329- A customizable button component for user interactions.
330- </summary>
331- </component>
332- <component>
333- <id>header</id>
334- <name>Header</name>
335- </component>
336- <component>
337- <id>page</id>
338- <name>Page</name>
339- </component>
340- <component>
341- <id>other-ui-card</id>
342- <name>Card</name>
343- <summary>
344- Card component with title, image, content, and action button
345- </summary>
346- </component>
347- </components>",
324+ "text": "# Components
325+
326+ - Button (example-button): A customizable button component for user interactions.
327+ - Header (header)
328+ - Page (page)
329+ - Card (other-ui-card): Card component with title, image, content, and action button",
348330 "type": "text",
349331 },
350332 ],
@@ -362,9 +344,9 @@ describe('MCP Endpoint E2E Tests', () => {
362344 } ) ;
363345
364346 const listText = listResponse . result . content [ 0 ] . text ;
365- const idMatch = listText . match ( / < i d > ( [ ^ < ] + ) < \/ i d > / ) ;
347+ // Match markdown format: - ComponentName (component-id)
348+ const idMatch = listText . match ( / - \w + \( ( [ ^ ) ] + ) \) / ) ;
366349 expect ( idMatch ) . toBeTruthy ( ) ;
367-
368350 const componentId = idMatch ! [ 1 ] ;
369351
370352 // Now get documentation for that component
@@ -379,89 +361,72 @@ describe('MCP Endpoint E2E Tests', () => {
379361 {
380362 "content": [
381363 {
382- "text": "<component>
383- <id>example-button</id>
384- <name>Button</name>
385- <description>
364+ "text": "# Button
365+
366+ ID: example-button
367+
386368 Primary UI component for user interaction
387- </description>
388- <story>
389- <story_name>Primary</story_name>
390- <story_code>
369+
370+ ## Stories
371+
372+ ### Primary
373+
374+ \`\`\`
391375 import { Button } from "@my-org/my-component-library";
392376
393377 const Primary = () => <Button onClick={fn()} primary label="Button"></Button>;
394- </story_code>
395- </story>
396- <story>
397- <story_name>Secondary</story_name>
398- <story_code>
378+ \`\`\`
379+
380+ ### Secondary
381+
382+ \`\`\`
399383 import { Button } from "@my-org/my-component-library";
400384
401385 const Secondary = () => <Button onClick={fn()} label="Button"></Button>;
402- </story_code>
403- </story>
404- <story>
405- <story_name>Large</story_name>
406- <story_code>
386+ \`\`\`
387+
388+ ### Large
389+
390+ \`\`\`
407391 import { Button } from "@my-org/my-component-library";
408392
409393 const Large = () => <Button onClick={fn()} size="large" label="Button"></Button>;
410- </story_code>
411- </story>
412- <story>
413- <story_name>Small</story_name>
414- <story_code>
394+ \`\`\`
395+
396+ ### Small
397+
398+ \`\`\`
415399 import { Button } from "@my-org/my-component-library";
416400
417401 const Small = () => <Button onClick={fn()} size="small" label="Button"></Button>;
418- </story_code>
419- </story>
420- <props>
421- <prop>
422- <prop_name>primary</prop_name>
423- <prop_description>
424- Is this the principal call to action on the page?
425- </prop_description>
426- <prop_type>boolean</prop_type>
427- <prop_required>false</prop_required>
428- <prop_default>false</prop_default>
429- </prop>
430- <prop>
431- <prop_name>backgroundColor</prop_name>
432- <prop_description>
433- What background color to use
434- </prop_description>
435- <prop_type>string</prop_type>
436- <prop_required>false</prop_required>
437- </prop>
438- <prop>
439- <prop_name>size</prop_name>
440- <prop_description>
441- How large should the button be?
442- </prop_description>
443- <prop_type>'small' | 'medium' | 'large'</prop_type>
444- <prop_required>false</prop_required>
445- <prop_default>'medium'</prop_default>
446- </prop>
447- <prop>
448- <prop_name>label</prop_name>
449- <prop_description>
450- Button contents
451- </prop_description>
452- <prop_type>string</prop_type>
453- <prop_required>true</prop_required>
454- </prop>
455- <prop>
456- <prop_name>onClick</prop_name>
457- <prop_description>
458- Optional click handler
459- </prop_description>
460- <prop_type>() => void</prop_type>
461- <prop_required>false</prop_required>
462- </prop>
463- </props>
464- </component>",
402+ \`\`\`
403+
404+ ## Props
405+
406+ \`\`\`
407+ export type Props = {
408+ /**
409+ Is this the principal call to action on the page?
410+ */
411+ primary?: boolean = false;
412+ /**
413+ What background color to use
414+ */
415+ backgroundColor?: string;
416+ /**
417+ How large should the button be?
418+ */
419+ size?: 'small' | 'medium' | 'large' = 'medium';
420+ /**
421+ Button contents
422+ */
423+ label: string;
424+ /**
425+ Optional click handler
426+ */
427+ onClick?: () => void;
428+ }
429+ \`\`\`",
465430 "type": "text",
466431 },
467432 ],
0 commit comments