json-prettifier
Accepts raw/minified JSON text and returns a formatted, pretty-printed version with customizable indentation. Useful for debugging, readability, and working with JSON data in Claude Desktop and other MCP-compatible tools.
Installation
You can use this server instantly without installation via npx:
npx @dennisk2025/json-prettifier
Or, install it globally:
npm install -g @dennisk2025/json-prettifier
Adding to Claude Desktop
Add the following to your Claude Desktop config file at:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
Example configuration:
{
"mcpServers": {
"jsonprettifier": {
"command": "npx",
"args": ["@dennisk2025/json-prettifier"]
}
}
}
Usage
After Claude launches, type /jsonprettifier and you will have access to the following tool:
Tool: prettify-json
- Description: Takes a JSON string and formats it with the specified indentation level.
Parameters
json_string (string, required): The minified or raw JSON string to format.
indent (integer, optional, default=2): Number of spaces to use for indentation (0 returns the most compact form, maximum 8).
Example
Input:
Tool name: prettify-json
Arguments:
{
"json_string": "{\"hello\":\"world\",\"foo\":[1,2,3]}",
"indent": 4
}
Result:
{
"hello": "world",
"foo": [
1,
2,
3
]
}
Error handling
If invalid JSON is supplied, the tool returns a clear error message ("Failed to parse JSON ...").
If you supply an argument outside the allowed indent range, it defaults to 2 spaces.
Full Tool List
- prettify-json
- Parameters:
json_string (string, required): The minified or raw JSON string to format.
indent (integer, optional, default=2, min=0, max=8): Indent spaces.
- Returns: Formatted, pretty-printed JSON as text.