prettify-mcp
v0.2.0
Published
MCP server for Prettify: turn JSON/YAML/CSV/XML/Mermaid payloads into shareable links, and query (jq), convert, diff, and infer types from structured data.
Maintainers
Readme
prettify-mcp
An MCP server that turns a pasted payload into a shareable Prettify link. Ask your AI coding tool to "visualize this JSON" and get back a prettify.tools/s/… URL that opens the data in an interactive viewer (tree, table, chart, or diagram).
Hosted docs: https://prettify.tools/docs/api
Tools
| Tool | Purpose | Returns |
|---|---|---|
| prettify_view({ content, format? }) | Open a payload in Prettify | share URL |
| prettify_query({ content, filter, format? }) | Run a jq filter over the data | result (JSON) + view link |
| prettify_convert({ content, from, to }) | Convert between json/yaml/csv/xml | converted text + view link |
| prettify_diff({ left, right, format? }) | Structural diff as an RFC 6902 JSON Patch | patch + summary + view link |
| prettify_infer_types({ content, target, format? }) | Generate types from a sample | code (+ view link for json-schema) |
format is one of json (default), yaml, csv, xml, mermaid (mermaid is view-only; convert/diff accept the four data formats). prettify_infer_types target is one of typescript, go, kotlin, rust, json-schema.
The transform tools reuse Prettify's own engines (the jq implementation, format converters, semantic diff, and type inference), and each returns the data result plus a Prettify link to view it. Anonymous by default (no account, no key): the view links call Prettify's public REST endpoint, which applies a small free-tier size cap and per-IP rate limit; a Pro license key raises those limits.
Requirements
- Node.js 18+
Configuration
| Env var | Default | Purpose |
|---|---|---|
| PRETTIFY_API_URL | https://prettify-api.alexi-81a.workers.dev | API base URL (override to point at a local worker or proxy) |
| PRETTIFY_LICENSE_KEY | (none) | Optional Pro license key; forwarded as a bearer token to raise size/rate limits |
Client setup
Claude Desktop
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"prettify": {
"command": "npx",
"args": ["-y", "prettify-mcp"]
}
}
}With a Pro license key:
{
"mcpServers": {
"prettify": {
"command": "npx",
"args": ["-y", "prettify-mcp"],
"env": { "PRETTIFY_LICENSE_KEY": "XXXX-XXXX-XXXX-XXXX" }
}
}
}Restart Claude Desktop. The prettify_view tool then appears in the tools list.
Claude Code
claude mcp add prettify -- npx -y prettify-mcpOr add to .mcp.json in your project:
{
"mcpServers": {
"prettify": { "command": "npx", "args": ["-y", "prettify-mcp"] }
}
}Cursor
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):
{
"mcpServers": {
"prettify": { "command": "npx", "args": ["-y", "prettify-mcp"] }
}
}Example
You: Visualize this as a chart:
[{"month":"Jan","sales":120},{"month":"Feb","sales":180}]Assistant: (calls
prettify_view) → https://prettify.tools/s/1a2b3c4d5e6f
Development
npm install
npm test # vitest, mocked fetch
npm run build # tsc -> dist/
# Interactive testing with the MCP Inspector (https://modelcontextprotocol.io/docs/tools/inspector):
npm run inspect # builds, then opens the Inspector UI (uses the default/prod API)
npm run inspect:local # same, but PRETTIFY_API_URL=http://localhost:8788 (run the worker first)Add -e PRETTIFY_LICENSE_KEY=... to the Inspector command to test the Pro tier.
Privacy
The content you pass is compressed and stored behind a short link so the viewer can load it. Only origin, format, and byte-size are recorded for analytics; never the content itself.
