MCP JSON Lens
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP JSON Lensinspect the shape of ./data.json"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP JSON Lens
Look at big JSON without loading big JSON.
MCP JSON Lens is an MCP server and CLI that summarize and query JSON and JSONL files with a small jq-like expression language. Ask for the shape of a document, or pull exactly the values you need — the rest never reaches your context. Use it as an MCP tool so agents can explore datasets safely, or straight from the terminal.
Sixth tool in the TokenSaver family: TokenSaver MCP maps repositories, MCP Context Budget audits tool costs, MCP Web Snapshot reads the web, MCP Log Tail summarizes logs, MCP Secret Scan guards commits, and JSON Lens explores data.
Why
The fastest way to destroy a context window is pasting a large JSON file into it. But agents constantly need to answer small questions about big data: what shape is this export, which records failed, what are the ids. JSON Lens answers those questions with compact, bounded output instead of the whole document.
Related MCP server: Fetch JSONPath MCP
Quick start
Inspect structure — no expression needed:
npx -y mcp-json-lens inspect ./data.json# JSON inspection: ./data.json
Kind: json | 198 B
Type: object (3 keys)
- users: array[3] of object
items:
- id: number (sample 1)
- name: string (sample "Ada")
- roles: array[2]
- total: number (sample 3)
- page: number (sample 1)Query values with a jq-like expression:
npx -y mcp-json-lens query ./data.json --expr '.users[*].name'# Query: .users[*].name
Kind: json | matches: 3 | showing: 3
[
"Ada",
"Budi",
"Citra"
]Works the same on JSONL, with line numbers:
npx -y mcp-json-lens query ./events.jsonl --expr '.level, .user' --limit 2[
{ "line": 1, "value": { ".level": "info", ".user": "ada" } },
{ "line": 2, "value": { ".level": "error", ".user": "budi" } }
]Expression cheatsheet
Expression | Meaning |
| Every name in the users array |
| First and last item |
| Iterate the root array or object |
| Multiple paths — returns an object per record |
| Pipe: |
| Pipe: |
| Pipe: |
Pipes: keys, length, type. Multiple paths and pipes cannot be combined in v0.1.0.
MCP server
Add it to any MCP-compatible client:
{
"mcpServers": {
"jsonlens": {
"command": "npx",
"args": ["-y", "mcp-json-lens", "serve"]
}
}
}From a local checkout, point command at node and args at the built entry point:
{
"mcpServers": {
"jsonlens": {
"command": "node",
"args": ["/absolute/path/to/mcp-json-lens/dist/index.js", "serve"]
}
}
}Tools
Tool | What it returns |
| Types, keys, array lengths, and samples — up to a depth limit and output budget. |
| Matching values for an expression, limited by count and token budget, with truncation reported. |
Design principles
Bounded: file size caps, line caps, result limits, and token budgets everywhere.
Offline: no network, no telemetry; data never leaves your machine.
Read-only: never writes to your files.
Format-tolerant: JSON and JSONL, including mislabeled files.
Honest: truncation and omitted keys are always reported.
CLI reference
mcp-json-lens inspect <file> [--json]
mcp-json-lens query <file> --expr <expression> [--limit <n>] [--json]
mcp-json-lens serveExit codes: 0 success, 1 file or expression failure, 2 usage error.
Roadmap
More pipes:
sort,unique,map(.field),select(.field == value).Bracket-quoted keys (
.["weird key"]) and slices (.[1:5]).Streaming JSONL queries with early exit for very large files.
NDJSON output mode for piping between tools.
CSV and Parquet inspection.
Development
npm install
npm run typecheck
npm run build
npm testThe suite covers the expression parser and evaluator, schema summarization, JSON and JSONL loading, query execution, rendering, CLI behavior, and MCP round trips.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic JSON repair, validate, example-gen, schema-coerce for agents. Zero LLM, sub-10ms.
Turn messy text into strict JSON schemas agents can trust (invoice, receipt, contact, resume).
JSON/YAML, regex, diff, JWT, SQL dialects — the keyless millisecond ops an agent needs mid-task.
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 38 tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceA Model Context Protocol server for querying large JSON files using JSONPath expressions, enabling LLMs to efficiently search and extract information from large JSON data.311-
- FlicenseAqualityDmaintenanceEnables efficient extraction of specific data from JSON APIs using JSONPath patterns, reducing token usage by up to 99% compared to fetching entire responses. Supports single and batch operations for both JSON extraction and raw text retrieval from URLs.44-
- FlicenseNot gradedqualityDmaintenanceEnables efficient navigation and search of large JSON files (>10MB) through intelligent path exploration and fuzzy search capabilities, designed to save tokens by avoiding loading entire files into context.1-
- AlicenseNot gradedqualityCmaintenanceEnables natural language interaction with JSON files, providing tools to load, query, aggregate, transform, and export data directly from AI editors.3MIT