Json To Python Class

Data REST API MCP

Generate Python class source code from a JSON object as a dataclass, a Pydantic model, or a plain class. Nested objects become separate classes, field names become snake_case, and type hints are optional.

This page documents the MCP tool findutils:json_to_python_class. See the REST reference →

Call it over MCP

Tool name findutils:json_to_python_class · no API keys · 120 requests/min per IP

Claude Code

claude mcp add findutils --transport http https://mcp.findutils.com/

Claude Desktop — claude_desktop_config.json

{
  "mcpServers": {
    "findutils": {
      "url": "https://mcp.findutils.com/"
    }
  }
}

Raw JSON-RPC (any MCP client) — verified example

curl -X POST https://mcp.findutils.com/ \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "json_to_python_class",
      "arguments": {
        "json": "{\"userId\":1,\"firstName\":\"A\",\"tags\":[\"x\"]}"
      }
    }
  }'

Input schema

Argument Type Required Description
json string yes JSON object to convert (the root must be an object).
class_name string no Name of the root class. Default: "Root". Default: "Root".
class_type string (dataclass | pydantic | plain) no Class style: "dataclass", "pydantic", or "plain". Default: "dataclass". Default: "dataclass".
add_type_hints boolean no Add type hints (str, int, List[...], Optional[Any]). Default: true. Default: true.
generate_init boolean no For class_type "plain": generate an __init__ method. Default: true. Default: true.

Example arguments (verified)

{
  "json": {
    "userId": 1,
    "firstName": "A",
    "tags": [
      "x"
    ]
  }
}

Arguments that carry JSON as a string are shown decoded for readability. The Copy button copies the exact wire arguments.

Also a REST endpoint

The same tool answers plain HTTP at POST /api/tools/json-to-python-class/execute — no key, 60 requests/min.

Open the REST reference for Json To Python Class →

More Data tools