Skip to content

Ndjson To Csv MCP tool

MCP findutils:ndjson_to_csv

Convert newline-delimited JSON (NDJSON, JSON Lines, .jsonl) into a flat CSV. Each line is one JSON object; the header is the union of every key in first-seen order, and a key a row does not have becomes an empty cell. Nested objects are flattened to dot paths (user.name) and array items to indexed keys (tags[0]) by default, or kept as JSON text in one cell with nested set to json. A line that is not valid JSON or not an object is skipped and reported by its line number; the other lines still convert. A JSON array is refused with a pointer to the JSON to CSV tool. Quoting follows RFC 4180. Values are written as text and never coerced.

Arguments

application/json
  • ndjson

    string required

    The JSON Lines text: one JSON object per line.

  • nested

    string optional

    flatten (default): nested keys become dot paths such as user.name and array items become tags[0]. json: a nested value is written as JSON text in one cell. One of flatten · json. Default "flatten".

  • delimiter

    string optional

    Output field separator: "," (default), ";" or "\t". Default ",".

  • header

    boolean optional

    Write the header row. Default true. Default true.

Example arguments

Verified
{
  "ndjson": "{\"id\":1,\"user\":{\"name\":\"Ada\"}}\n{\"id\":2,\"user\":{\"name\":\"Linus\"},\"tags\":[\"a\"]}"
}