Skip to content

[Claude Code] component_builder returns [object Object] instead of component snippet #68

Description

@OguzOnat

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

  1. 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\"]}"
  2. In a conversation, trigger /ui or call 21st_magic_component_builder
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions