Skip to content

Commit 1ed83b5

Browse files
authored
Merge pull request #165 from storybookjs/remove-xml-formatter
Remove XML formatter
2 parents f9fce2a + c36c854 commit 1ed83b5

30 files changed

Lines changed: 383 additions & 2741 deletions

.changeset/all-pans-rest.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@storybook/addon-mcp': minor
3+
'@storybook/mcp': minor
4+
---
5+
6+
Remove support for XML format.
7+
8+
## Breaking Change
9+
10+
The related option to configure XML vs markdown format now has no impact, the output is always formatted as markdown.

.github/copilot-instructions.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ The addon supports configuring which toolsets are enabled:
3535
toolsets: {
3636
dev: true,
3737
docs: true,
38-
},
39-
experimentalFormat: 'markdown' // Output format: 'markdown' (default) or 'xml'
38+
}
4039
}
4140
}
4241
```
@@ -74,11 +73,8 @@ The `@storybook/mcp` package (in `packages/mcp`) is framework-agnostic:
7473
- `onSessionInitialize`: Called when an MCP session is initialized
7574
- `onListAllDocumentation`: Called when the list-all-documentation tool is invoked
7675
- `onGetDocumentation`: Called when the get-documentation tool is invoked
77-
- **Output Format**: The `format` property in context controls output format:
78-
- `'markdown'` (default): Token-efficient markdown with adaptive formatting
79-
- `'xml'`: Legacy XML format
80-
- Format is configurable via addon options or directly in `StorybookContext`
81-
- Formatters are implemented in `packages/mcp/src/utils/manifest-formatter/` with separate files for XML and markdown
76+
- **Output Format**: Responses are markdown-only (token-efficient markdown with adaptive formatting).
77+
- Formatter implementations are in `packages/mcp/src/utils/manifest-formatter/`.
8278

8379
## Development Environment
8480

.github/instructions/mcp.instructions.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ src/
2929
list-all-documentation.ts # List all documentation tool
3030
get-documentation.ts # Get component documentation tool
3131
utils/
32-
format-manifest.ts # Format component manifest to XML
32+
manifest-formatter/markdown.ts # Format component/docs manifests to markdown
3333
parse-react-docgen.ts # Parse react-docgen output
3434
get-manifest.ts # Fetch and validate manifest
3535
dedent.ts # Template string dedentation
@@ -107,19 +107,8 @@ Component manifests can include a `reactDocgen` property containing prop informa
107107
- Extracts prop names
108108
- Serializes TypeScript types into readable strings (handles unions, intersections, functions, objects, etc.)
109109
- Includes optional fields: `description`, `type`, `defaultValue`, `required`
110-
3. **Formatting**: The `formatComponentManifest()` function in `src/utils/format-manifest.ts` generates an XML representation of the component including a `<props>` section when `reactDocgen` is present
111-
4. **Output**: Each prop is formatted as:
112-
```xml
113-
<prop>
114-
<prop_name>propName</prop_name>
115-
<prop_type>string | number</prop_type>
116-
<prop_required>false</prop_required>
117-
<prop_default>"default"</prop_default>
118-
<prop_description>
119-
Prop description text
120-
</prop_description>
121-
</prop>
122-
```
110+
3. **Formatting**: The markdown formatter in `src/utils/manifest-formatter/markdown.ts` generates markdown output for components, docs, and props (including a `## Props` section when `reactDocgen` is present)
111+
4. **Output**: Props are rendered in markdown as TypeScript-like declarations inside fenced code blocks, including optional description/default metadata when available.
123112

124113
**Type serialization examples:**
125114

apps/internal-storybook/pnpm-lock.yaml

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)