Skip to main content
Glama
mermaidonline-mcp

mermaidonline-mcp

by j-river

Mermaid Online MCP — Mermaid Share Links & Source

Encode diagram source into share links and recover source from supported Mermaid share tokens, directly from a local MCP client. An independent open-source companion to Mermaid Online, not an official Mermaid.js server.

This MCP serializes text. It does not render diagrams, validate Mermaid syntax, fetch share URLs or read/write files. For a visual editing workflow, use the separate Mermaid Online editor, Mermaid-to-SVG export or Mermaid-to-PNG export.

Install

Requires Node.js 22+ and an MCP client supporting local stdio servers. Common configuration:

{"mcpServers":{"mermaidonline":{"command":"npx","args":["-y","mermaidonline-mcp@0.1.0"]}}}

Each client has its own configuration location. On Windows, if a client cannot spawn npx, install the package and use node with the absolute installed src/cli.js path instead. Running the command without a client starts a protocol server waiting on stdin. Use npx -y mermaidonline-mcp@0.1.0 --help for human-readable help.

Related MCP server: mermaid-mcp

Two tools

Tool

Arguments

Result

encode_mermaid_share

code, optional mermaidConfig JSON string and explicit baseUrl

Reversible pako: token and optional URL

decode_mermaid_share

share, optional includeState

Original source and optionally untrusted extension/config data

Ask your agent:

Encode this flowchart into a share link using https://mermaidonline.org/ as the destination. Decode the result and verify the source round-trips. Do not render or open it.

{"code":"flowchart LR\n  A[Write] --> B[Share]\n","baseUrl":"https://mermaidonline.org/"}

Destination is explicit, not silently substituted. No tracking parameters are added. Decoding accepts a token, fragment, or HTTP(S) URL and never requests that address. includeState defaults to false to avoid unnecessarily echoing config and extension fields.

Limits and privacy

  • Maximum source: 48,000 UTF-8 bytes; config: 8,000 UTF-8 bytes. Share tokens: 65,536 characters, decoded JSON: 65,536 UTF-8 bytes, container depth: 16. Results are limited to 128 KiB of JSON.

  • A link contains the complete diagram state. It is reversible, not encrypted or access controlled. Compression is not redaction.

  • Config is stored as data, not applied as renderer options. Treat recovered labels, links and directives as untrusted input to your editor.

  • No URL fetching, uploads, file operations, telemetry, account, API key or paid backend calls. Your MCP client/model provider may still transmit or store tool input and output.

  • pako:/base64: interoperability does not mean every site accepts every editor field. Unsupported legacy/site-specific fragments are rejected; diagram syntax is not checked.

See share-link workflows and examples. Core implementation: mermaid-share-codec. Commercial website code remains separate.

Verify

npm ci --ignore-scripts
npm run check
npm run audit:public
npm pack --dry-run

Tests negotiate a real MCP stdio session and exercise Unicode/config round trips, explicit destinations, source-only results, malicious schemes, corrupt payloads and bounded decompression. Published in the official MCP Registry as io.github.j-river/mermaidonline, version 0.1.0. Public metadata links directly to Mermaid Online and the npm package. Source metadata is in server.json.

MIT. No customer diagrams or production credentials are included.

Available Tools

2 tools
decode_mermaid_shareRecover Mermaid source from a share linkA
Read-onlyIdempotent

Recover Mermaid source from a supported pako:/base64: share token, fragment or HTTP(S) URL without fetching it. Whole-state mode preserves extension fields as untrusted JSON. Unsupported formats and oversized expansion are rejected. No syntax validation or rendering.

Inputs: share (required), includeState.

encode_mermaid_shareEncode Mermaid share stateA
Read-onlyIdempotent

Encode source and optional config into a bounded pako: token. Optionally create a share URL for an explicitly supplied HTTP(S) baseUrl, without credentials or an existing fragment. Does not validate syntax or open the destination. The token is reversible and contains the source.

Inputs: code (required), baseUrl, mermaidConfig.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools are exact inverses, one encoding and one decoding, with no overlap in purpose. Descriptions make the boundary explicit, including what each does and does not do (no validation, no fetching).

    Naming Consistency5/5

    Both names follow the same verb_noun pattern: encode_mermaid_share / decode_mermaid_share. The shared suffix makes the pairing obvious and predictable.

    Tool Count3/5

    Two tools is thin in absolute terms, but the encode/decode pair is genuinely all the stated scope requires. Each tool earns its place, yet there is little surface area for an agent to work with beyond a single round trip.

    Completeness4/5

    Encode and decode together fully cover the reversible share-token lifecycle, including URL and fragment inputs and whole-state mode. The only gap is that neither validates Mermaid syntax or renders, so an agent cannot check whether a token decodes to valid content.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to list, read, create, update, and delete Mermaid diagrams and collections via the Mermaid REST API over stdio or stateless Streamable HTTP.
      7 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Deterministic encode, decode, hash and convert for agents, on the same pipeline engine as the String Utility Belt web app, CLI and editor extensions: a pipeline built and checked in the browser runs unchanged from its share link. Base64/hex/URL, JWT, hashes, JSON/YAML/CSV/XML, dates and regex; tools to search, describe and run utilities or whole pipelines, and to detect input formats. Runs locally
      12
      5
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables document conversion across Markdown, HTML, DOCX, PDF, EPUB, PPTX, LaTeX, and many other formats, with automatic Mermaid diagram rendering and stored outputs for chained conversions. Runs locally over stdio or in Docker over authenticated HTTP.
      Apache 2.0