Skip to main content
Glama

jsonsafe-mcp — Offline Lossless BigInt JSON/JSONL, RFC 6902 Diff & 5-Target Schema MCP Server, CLI & GitHub Action

z121245017-ai/jsonsafe-mcp MCP server

Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to inspect .json and 1,000+ row .jsonl / NDJSON payloads without JSON.parse() IEEE-754 float64 truncation (> 2^53 - 1), decode Twitter / Discord / Epoch 64-bit Snowflake timestamps, recursively un-escape nested stringified JSON logs, compute lossless RFC 6902 JSON Patches catching 1-ULP int64 mutations, and emit TypeScript, Zod v3, Go struct, PostgreSQL CREATE TABLE, and JSON Schema Draft 2020-12 definitions.

MCP Tools Exposed (stdio)

Tool

Purpose

Safety Annotations

inspect_lossless_bigint_json

Parses raw JSON or multi-line .jsonl streams offline without IEEE-754 float64 rounding, flagging unsafe int64/uint64/decimal paths, decoding Snowflake UTC timestamps, catching duplicate keys, and previewing JWT claims.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

infer_multi_target_schema

Infers unified types across single JSON payloads or 1,000+ .jsonl rows (optional ?, | null, UUID, ISO-8601 timestamps, and string | bigint hazards) into TypeScript, Zod v3, Go struct, PostgreSQL DDL, and JSON Schema Draft 2020-12.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

diff_lossless_rfc6902_patch

Computes a lossless RFC 6902 JSON Patch (add, remove, replace) between two JSON snapshots, catching 1-ULP int64 Snowflake mutations (...82593 -> ...82594) that JSON.parse() silently misses.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

unescape_nested_json_logs

Recursively un-escapes double- or triple-escaped JSON string fields inside gateway, Kafka, CloudWatch, or OpenTelemetry .json/.jsonl logs while preserving exact 64-bit integers.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

Related MCP server: agent-core-mcp

Quick Start (MCP Client & Local CLI)

# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/jsonsafe-mcp

# List MCP tool schemas from terminal
npx -y github:z121245017-ai/jsonsafe-mcp --list

# Audit a JSONL stream for unsafe 64-bit integers (exits 2 on IEEE-754 truncation hazards)
npx -y github:z121245017-ai/jsonsafe-mcp --input ./events.jsonl --fail-on-unsafe

# Generate TypeScript / Zod / Go / PostgreSQL / JSON Schema from multi-row JSONL
npx -y github:z121245017-ai/jsonsafe-mcp --input ./events.jsonl --target ts --root-name OrderEvent

# Invoke any MCP tool directly via --cli
npx -y github:z121245017-ai/jsonsafe-mcp --cli diff_lossless_rfc6902_patch '{"leftContent":"{\"id\":1861928374659182593}","rightContent":"{\"id\":1861928374659182594}"}'

Claude Desktop / Cursor / Windsurf / Antigravity Config

{
  "mcpServers": {
    "jsonsafe": {
      "command": "npx",
      "args": ["-y", "github:z121245017-ai/jsonsafe-mcp"]
    }
  }
}

Docker (node:22-alpine, non-root USER node)

docker build -t jsonsafe-mcp .
docker run -i --rm jsonsafe-mcp

GitHub Action (z121245017-ai/jsonsafe-mcp@v1)

Block silent 64-bit Snowflake ID corruption, high-precision financial decimal rounding, and duplicate JSON keys in API fixtures and golden test snapshots:

name: JsonSafe Precision & Schema Gate

on:
  pull_request:
    paths:
      - '**/*.json'
      - '**/*.jsonl'

permissions:
  contents: read

jobs:
  jsonsafe:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Audit JSON/JSONL fixtures for IEEE-754 int64 rounding
        uses: z121245017-ai/jsonsafe-mcp@v1
        with:
          paths: 'fixtures'
          fail-on-unsafe: 'true'
          schema-target: 'ts'
          schema-output: 'generated/fixtures.d.ts'

IEEE-754 float64 vs Lossless JsonSafe Reference Matrix

Numeric Literal Class

Example Raw Literal

Standard JSON.parse() Output

jsonsafe-mcp Verdict & TypeScript / SQL Mapping

Safe 53-Bit Integer

9007199254740991

9007199254740991 (Exact)

SAFE -> number / BIGINT

Signed 64-Bit Snowflake

1861928374659182593

1861928374659182600 (Corrupted -7 ULP!)

UNSAFE int64 -> string | bigint / BIGINT + UTC timestamp

Unsigned uint64

18446744073709551615

18446744073709552000 (Corrupted!)

UNSAFE uint64 -> string | bigint / NUMERIC(20, 0)

Financial / Crypto Decimal

192837.123456789012345678

192837.12345678902 (Truncated!)

UNSAFE decimal -> string / NUMERIC(38, 18)

Commercial Air-Gapped Browser Workbench & Developer Suite

Need a zero-install Bilingual Air-Gapped Browser Workbench (connect-src 'none') or Chrome DevTools MV3 Inspector for pasting production API responses, decoding JWT timestamps offline, and exporting 5-target schemas without touching the terminal?

Explore JsonSafe BigInt & Schema Studio and our full offline developer utility catalog at https://z121245017-ai.github.io/.

Verification

npm test

License

MIT License — 0 external npm dependencies, 0 network calls, 100% local deterministic execution.

Available Tools

4 tools
diff_lossless_rfc6902_patchA
Read-onlyIdempotent

Computes a lossless RFC 6902 JSON Patch (add, remove, replace) between two JSON snapshots, catching 1-ULP 64-bit Snowflake and high-precision decimal mutations that JSON.parse() silently misses.

Inputs: leftPath, rightPath, leftContent, rightContent, +1 more.

infer_multi_target_schemaA
Read-onlyIdempotent

Infers unified schemas across single JSON payloads or 1,000+ .jsonl rows (optional ?, | null, UUID, ISO timestamps, and string | bigint hazards) into TypeScript, Zod v3, Go struct, PostgreSQL DDL, and JSON Schema Draft 2020-12.

Inputs: targets, filePath, rootName, tableName, +2 more.

inspect_lossless_bigint_jsonA
Read-onlyIdempotent

Parses raw JSON or multi-line .jsonl payloads offline without IEEE-754 float64 truncation (> 2^53 - 1), flagging unsafe int64/decimal paths, decoding Snowflake timestamps, detecting duplicate keys, and previewing JWT claims.

Inputs: format, filePath, payloadContent, expandUnescaped, +1 more.

unescape_nested_json_logsA
Read-onlyIdempotent

Recursively un-escapes nested stringified JSON fields inside gateway, Kafka, or OpenTelemetry .json/.jsonl logs while preserving exact 64-bit Snowflake IDs and redacting JWT signatures.

Inputs: filePath, payloadContent, quoteUnsafeNumbers.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool targets a distinct JSON-safety concern: inspection, schema inference, diffing/patching, and log unescaping. The main overlap is between inspect_lossless_bigint_json and unescape_nested_json_logs, since both parse JSON/.jsonl logs, but their descriptions clarify analysis versus transformation.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb-first pattern with descriptive noun phrases. The convention is predictable across the set, even though the names are long and specialized.

    Tool Count5/5

    Four tools is well-scoped for a focused JSON safety utility. Each tool covers a distinct workflow—inspection, schema inference, patch diffing, and log unescaping—without obvious filler.

    Completeness3/5

    The surface covers several important JSON-safety workflows, but there are notable gaps such as applying RFC 6902 patches, safe serialization/stringification, and explicit validation or repair operations. Agents may need external tools to complete patch-apply and encode-side workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Deterministic JSON validation and repair for AI agents. Validates, repairs, schema-checks, and diffs JSON so long-running agents don't corrupt their session state with malformed writes.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to perform exact, reproducible mechanical computation — text diffing, hashing, JSON querying, calendar arithmetic, deadline-bounded regex extraction, CSV parsing, similarity scoring, unit and base conversion — instead of relying on probabilistic guessing. Runs dependency-free, read-only and offline over stdio, with schema validation and hard caps on every operation so no call can hang the client.
      15
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables validating JSON/JSONC, getting/setting values with jq-like paths, pretty-printing or minifying, validating against Ajv JSON Schema, and diffing local files or inline strings without network calls.
      8
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Lets an agent query JSON files too large for its context: JSONPath with aggregation pipes, schema, field profiles, samples, identity-keyed diff, CSV and spreadsheet export, and checks that gate a file. Int64 IDs and decimals keep their exact digits, and zstd, Base64-Zstd and PostgreSQL bytea payloads open directly.
      12
      100 npm
      2
      MIT