Skip to content

MCP server ​

Use the published stdio server to expose six bounded Coral operations to an MCP client.

ToolRequired inputOptional input and behavior
coral_generatedescriptionformat: DSL/JSON; style: minimal/detailed; deterministic heuristics, not an LLM
coral_validatecontentstrict; validates Coral or GraphIR JSON
coral_convertcontentfrom, to, strict; reports conversion loss
coral_layoutcontentdirection, spacing, and four algorithms
coral_rendercontentSVG/HTML, direction, theme, spacing, and font settings
coral_explaincontentlevel, focus; detailed currently follows the standard form

Install and configure ​

Install the published package when the client manages project dependencies:

sh
npm install @coral-viz/mcp-server@0.2.5

For a client that launches packages with npx, use this stdio configuration:

json
{
  "mcpServers": {
    "coral": {
      "command": "npx",
      "args": [
        "--yes",
        "--package",
        "@coral-viz/mcp-server@0.2.5",
        "coral-mcp"
      ]
    }
  }
}

Pin the version in managed environments. The command communicates over stdio; don't wrap it in a process that writes unrelated output to stdout.

Responses and failures ​

The document payload is in content[].text. structuredContent, where a tool supplies it, is metadata and isn't a replacement payload channel.

Validation and conversion can return useful text with isError: true. Schema, JSON, validation, and layout exceptions are caught by the server and become an Error: text envelope with isError: true. Render returns an error envelope when it can't parse and validate any nodes. Explain returns a normal text response when no node can be parsed. Clients must handle these shapes rather than checking only for a thrown transport error.

Library boundary and limits ​

The MCP layout schema exposes layered, mrtree, force, and box, while the render library exposes seven algorithms and more option detail. MCP doesn't expose library padding, title, description, or custom theme objects. coral_render is the exception to root render ownership: it computes missing geometry before serializing and preserves complete supplied positions.

The server doesn't impose a documented byte, node-count, or operation-time limit. That is an absence of a guarantee, not a promise of unlimited capacity; clients should enforce their own bounds and cancellation policy.