Skip to content

MCP Server: Playground URL encoding breaks with <br/> tags in participant names #255

@comanche

Description

@comanche

Description:

When using the Mermaid Chart MCP server (mcp.mermaidchart.com/mcp) via the validate_and_render_mermaid_diagram tool,
the generated playground URL (mermaidchart.com/play#pako:...) doesn't properly encode/decode diagrams containing

HTML tags in participant labels.

Steps to Reproduce:

  1. Call validate_and_render_mermaid_diagram with a sequence diagram containing
    in participant names
  2. Example:
    sequenceDiagram
    participant User as User
    (Client)
    participant API as API Server
    /api/endpoint
    User->>API: Send request
    API-->>User: Return response
  3. Copy the generated playground URL from the tool response
  4. Paste URL into browser

Expected Behavior:
The playground URL should open and display the diagram correctly with line breaks in participant names.

Actual Behavior:
The URL fails to properly decode the
tags, resulting in a broken/corrupted diagram display or parsing error.

Environment:

  • MCP Server: mcp.mermaidchart.com/mcp
  • Tool: validate_and_render_mermaid_diagram
  • Client: Claude Code

Additional Context:
The diagram itself renders correctly when the MCP returns the image - only the shareable playground URL is affected.
This appears to be an issue with the pako compression/encoding step when generating the URL hash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions