Describe the bug
Named union aliases lose their values between the manifest and get-documentation. Inline unions on the same component keep theirs.
In the reproduction, size and variant are both three-member string-literal unions. size refers to a named alias, variant declares its union inline. The manifest stores all three members for each:
size.type = {"name":"enum","raw":"Size",
"value":[{"value":"\"small\""},{"value":"\"medium\""},{"value":"\"large\""}]}
variant.type = {"name":"enum","raw":"\"primary\" | \"secondary\" | \"danger\"",
"value":[{"value":"\"primary\""},{"value":"\"secondary\""},{"value":"\"danger\""}]}
get-documentation for the same component:
export type Props = {
size?: Size = medium;
variant?: "primary" | "secondary" | "danger" = primary;
}
code/lib/mcp/src/utils/parse-react-docgen.ts on next maps each prop with:
type: prop.type?.raw ?? prop.type?.name,
type.value holds the values in both cases and is never read. For an aliased prop raw is the alias name.
This is not specific to my code. cauldron shows it on its own docgen config, react-docgen-typescript with shouldExtractLiteralValuesFromEnum: true, which I did not touch. On develop at 4195dc (2026-08-04), Storybook 10.4.0, 4 of its 14 enum props come back as bare aliases. get-documentation for components-button:
export type Props = {
variant?: "link" | "tag" | "primary" | "secondary" | "tertiary" | "error" | "danger" | "danger-secondary" | "badge" = primary;
size?: TagSize;
buttonRef?: Ref<HTMLButtonElement>;
thin?: boolean;
}
variant returns all nine of its values in the same response where size stays opaque. The other three are Tag.size (TagSize), ImpactBadge.type (ImpactType), and Notice.icon (IconType). cauldron does not ship @storybook/addon-mcp, so I installed it at 0.7.0 to get a manifest.
Also reproduces in my own design system on Storybook 10.5.5 and 10.5.6. Across all three the MCP packages were @storybook/mcp 0.8.0 and @storybook/addon-mcp 0.7.0, so this is on the released latest rather than only on next.
I couldn't tell from #35677's diff whether the behavior survives the move to code/addons/mcp/.
An aliased enum could render its values when type.value has them. The default case stays open, since shouldExtractLiteralValuesFromEnum is false by default in react-docgen-typescript and type.value is empty there.
Reproduction link
https://github.com/rachelslurs/storybook-mcp-named-alias-repro
Reproduction steps
npm ci
npm run storybook
./verify.sh (runs assuming port 6006) in a second terminal
It prints the manifest rows for both props, then the rendered Props block. size returns Size with no values; variant returns all three.
System
Storybook Environment Info:
System:
OS: macOS 26.5.2
CPU: (10) arm64 Apple M1 Max
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.20.0 - ~/.nvm/versions/node/v22.20.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v22.20.0/bin/yarn
npm: 10.9.3 - ~/.nvm/versions/node/v22.20.0/bin/npm <----- active
pnpm: 11.20.0 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 150.0.7871.188
Firefox: 145.0
Safari: 26.5.2
npmPackages:
@storybook/addon-mcp: 0.7.0 => 0.7.0
@storybook/react-vite: 10.5.6 => 10.5.6
storybook: 10.5.6 => 10.5.6
Additional context
No response
Describe the bug
Named union aliases lose their values between the manifest and
get-documentation. Inline unions on the same component keep theirs.In the reproduction,
sizeandvariantare both three-member string-literal unions.sizerefers to a named alias,variantdeclares its union inline. The manifest stores all three members for each:get-documentationfor the same component:code/lib/mcp/src/utils/parse-react-docgen.tsonnextmaps each prop with:type.valueholds the values in both cases and is never read. For an aliased proprawis the alias name.This is not specific to my code. cauldron shows it on its own docgen config,
react-docgen-typescriptwithshouldExtractLiteralValuesFromEnum: true, which I did not touch. Ondevelopat4195dc(2026-08-04), Storybook 10.4.0, 4 of its 14 enum props come back as bare aliases.get-documentationforcomponents-button:variantreturns all nine of its values in the same response wheresizestays opaque. The other three areTag.size(TagSize),ImpactBadge.type(ImpactType), andNotice.icon(IconType). cauldron does not ship@storybook/addon-mcp, so I installed it at 0.7.0 to get a manifest.Also reproduces in my own design system on Storybook 10.5.5 and 10.5.6. Across all three the MCP packages were
@storybook/mcp0.8.0 and@storybook/addon-mcp0.7.0, so this is on the releasedlatestrather than only onnext.I couldn't tell from #35677's diff whether the behavior survives the move to
code/addons/mcp/.An aliased enum could render its values when
type.valuehas them. The default case stays open, sinceshouldExtractLiteralValuesFromEnumisfalseby default in react-docgen-typescript andtype.valueis empty there.Reproduction link
https://github.com/rachelslurs/storybook-mcp-named-alias-repro
Reproduction steps
npm cinpm run storybook./verify.sh(runs assuming port 6006) in a second terminalIt prints the manifest rows for both props, then the rendered Props block.
sizereturnsSizewith no values;variantreturns all three.System
Additional context
No response