Environment
- Tool: Claude Code CLI (claude-sonnet-4-6)
- MCP version: 0.0.46 (@21st-dev/magic@latest)
- OS: Windows 11
Problem
When calling 21st_magic_component_builder from Claude Code, the component snippet
is returned as [object Object] instead of actual code.
The Shadcn/ui instructions section renders correctly, but the component code itself
is lost in serialization.
Steps to reproduce
- Add 21st-dev-magic MCP to Claude Code:
claude mcp add-json "21st-dev-magic" "{\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"@21st-dev/magic@latest\"]}"
- In a conversation, trigger
/ui or call 21st_magic_component_builder
- Response:
[object Object]\n\n## Shadcn/ui instructions...
Expected
Component TSX/JSX code as a text string
Actual
[object Object] — component code not rendered
Hypothesis
MCP response may be returning component code in a non-text content type
(e.g., type: "resource" or nested object) that Claude Code cannot render as string.
Environment
Problem
When calling
21st_magic_component_builderfrom Claude Code, the component snippetis returned as
[object Object]instead of actual code.The Shadcn/ui instructions section renders correctly, but the component code itself
is lost in serialization.
Steps to reproduce
claude mcp add-json "21st-dev-magic" "{\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"@21st-dev/magic@latest\"]}"/uior call21st_magic_component_builder[object Object]\n\n## Shadcn/ui instructions...Expected
Component TSX/JSX code as a text string
Actual
[object Object]— component code not renderedHypothesis
MCP response may be returning component code in a non-text content type
(e.g.,
type: "resource"or nested object) that Claude Code cannot render as string.