New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-explorer-mcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-explorer-mcp

MCP server for efficiently exploring large JSON files

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

JSON Explorer MCP Server

An MCP (Model Context Protocol) server for efficiently exploring large JSON files without loading entire contents into context. Designed to help AI assistants navigate complex JSON data structures while minimizing token usage.

Features

  • Lazy exploration - Only loads and returns what you need
  • Smart truncation - Large values are automatically summarized
  • Caching - Parsed JSON is cached with file modification checks
  • Schema inference - Understand structure without reading all data
  • Schema validation - Validate data against JSON Schema with $ref resolution
  • Network schemas - Validate against remote schemas from SchemaStore
  • Aggregate statistics - Get counts, distributions, and numeric stats for arrays
  • Templates - Create JSON files from built-in or custom templates

Installation

npm install -g json-explorer-mcp

Or use directly with npx:

npx json-explorer-mcp

Usage

With Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "json-explorer": {
      "command": "npx",
      "args": ["-y", "json-explorer-mcp"]
    }
  }
}

With Claude Code

Add to .mcp.json in your project:

{
  "mcpServers": {
    "json-explorer": {
      "command": "npx",
      "args": ["-y", "json-explorer-mcp"]
    }
  }
}

Tools

Navigation

ToolDescription
json_inspectGet file overview: size, structure type, depth-limited preview
json_keysList keys/indices at a path with types and previews
json_getGet value at path (auto-truncates large values)
json_searchSearch for keys or values matching a pattern (regex)
json_sampleSample items from arrays (first, last, random, range)
json_statsAggregate statistics for arrays

Schema & Validation

ToolDescription
json_schemaInfer JSON schema from data at a path
json_validateValidate against JSON Schema (file, URL, or inline)
is_jsonCheck if a file contains valid JSON

Editing

ToolDescription
json_setSet value at path with optional schema validation
json_formatReformat with configurable indent and key sorting

Templates

ToolDescription
list_templatesList available templates with metadata and schema URLs
get_templateGet full template details including all examples
create_jsonCreate file from template example
create_templateCreate a new user template definition
add_template_exampleAdd example to existing user template

Prompts

Prompts are reusable workflow templates that guide the AI through common tasks.

PromptDescription
explore-jsonGet started exploring a JSON file with overview and suggestions
validate-configValidate a config file (tsconfig, package.json, etc.) against SchemaStore
create-configCreate a new configuration file from a template with guidance

Built-in Templates

Templates include metadata, usage instructions, multiple examples, and schema URLs for validation.

TemplateSchemaExamples
tsconfigtsconfig.jsonminimal, strict, library
packagepackage.jsonminimal, typescript, library
eslinteslintrc.jsonbasic, typescript
prettierprettierrc.jsondefault, minimal
mcp-config-basic, multiple
vscode-launch-node, node-attach, jest
vscode-tasks-npm
vscode-settings-typescript

Using Templates

// List available templates
list_templates()

// Get full template details
get_template(template: "tsconfig")

// Create a file from a template example
create_json(
  template: "tsconfig",
  example: "strict",
  outputFile: "tsconfig.json"
)

// Create with overrides
create_json(
  template: "package",
  example: "typescript",
  outputFile: "package.json",
  overrides: { name: "my-project", version: "1.0.0" }
)

Environment Variables

VariableDescription
JSON_EXPLORER_TEMPLATESDirectory path for user template definitions
JSON_EXPLORER_NO_NETWORKSet to 1 to disable all network requests
JSON_EXPLORER_NETWORK_TIMEOUTNetwork request timeout in seconds (default: 30)

User Templates

Create custom templates by setting JSON_EXPLORER_TEMPLATES to a directory path:

{
  "mcpServers": {
    "json-explorer": {
      "command": "npx",
      "args": ["-y", "json-explorer-mcp"],
      "env": {
        "JSON_EXPLORER_TEMPLATES": "/path/to/templates"
      }
    }
  }
}

Template File Format

Create a JSON file in your templates directory (e.g., my-config.json):

{
  "description": "My application configuration",
  "usage": "Place in project root to configure the app",
  "filePatterns": ["myconfig.json", ".myconfig"],
  "schemaUrl": "https://example.com/schema.json",
  "examples": [
    {
      "name": "basic",
      "description": "Minimal configuration",
      "content": {
        "setting": "value"
      }
    },
    {
      "name": "advanced",
      "description": "Full configuration with all options",
      "content": {
        "setting": "value",
        "debug": true,
        "options": {}
      }
    }
  ]
}

The filename (without .json) becomes the template name.

Creating Templates Programmatically

// Create a new template
create_template(
  name: "my-config",
  description: "My application configuration",
  usage: "Place in project root",
  filePatterns: ["myconfig.json"],
  schemaUrl: "https://example.com/schema.json",
  exampleName: "basic",
  exampleDescription: "Minimal configuration",
  exampleContent: { setting: "value" }
)

// Add another example to an existing template
add_template_example(
  templateName: "my-config",
  exampleName: "production",
  exampleDescription: "Production configuration",
  exampleContent: { setting: "value", debug: false }
)

Network Schema Validation

Validate files against remote schemas from SchemaStore:

json_validate(
  file: "package.json",
  schema: "https://json.schemastore.org/package.json",
  resolveNetworkRefs: true,
  strict: false
)

Note: Very large schemas (like tsconfig) may timeout due to AJV compilation complexity.

Tool Details

json_inspect

Get an overview of a JSON file including size, structure type, and a depth-limited preview.

json_inspect(file: "/path/to/data.json")

Returns:

{
  "file": "/path/to/data.json",
  "size": "13.1 MB",
  "type": "object",
  "preview": {
    "users": "[... 1000 items]",
    "config": "{... 5 keys}"
  },
  "topLevelInfo": "Object with 2 keys: users, config"
}

json_keys

List all keys (for objects) or indices (for arrays) at a given path with type info and previews.

json_keys(file: "/path/to/data.json", path: "$.users")

json_get

Retrieve the value at a specific path. Large values are automatically truncated.

json_get(file: "/path/to/data.json", path: "$.users[0]")

json_set

Set a value at a specific JSONPath with optional schema validation.

// Simple set
json_set(
  file: "/path/to/data.json",
  path: "$.users[0].name",
  value: "New Name"
)

// With schema validation
json_set(
  file: "/path/to/data.json",
  path: "$.users[0]",
  value: { id: 1, name: "Alice" },
  schema: "/path/to/user-schema.json"
)

// With inferred schema (validates type matches existing)
json_set(
  file: "/path/to/data.json",
  path: "$.config.maxRetries",
  value: 5,
  inferSchema: true
)

// Dry run (validate without writing)
json_set(
  file: "/path/to/data.json",
  path: "$.config.enabled",
  value: true,
  dryRun: true
)

json_format

Reformat a JSON file with configurable indentation and optional key sorting.

json_format(
  file: "/path/to/data.json",
  indent: 2,
  sortKeys: true,
  outputFile: "/path/to/formatted.json"
)

json_validate

Validate JSON data against a JSON Schema with support for $ref resolution.

// With inline schema
json_validate(
  file: "/path/to/data.json",
  schema: { type: "object", required: ["id"] },
  path: "$.users[0]"
)

// With schema file (local $refs resolved automatically)
json_validate(
  file: "/path/to/data.json",
  schema: "/path/to/schema.json"
)

// With network schema
json_validate(
  file: "/path/to/data.json",
  schema: "https://json.schemastore.org/package.json",
  resolveNetworkRefs: true,
  strict: false
)

// With schema directory (loads all schemas by $id)
json_validate(
  file: "/path/to/data.json",
  schemaDir: "/path/to/schemas/",
  schemaId: "main-schema"
)

json_stats

Get aggregate statistics for array fields.

json_stats(file: "/path/to/data.json", path: "$.users")

Returns field-level statistics including counts, distributions, and numeric stats.

JSONPath Syntax

All path parameters support JSONPath syntax:

  • $ - Root object
  • $.foo - Property access
  • $.foo.bar - Nested property
  • $.users[0] - Array index
  • $.$id - Special keys with $ prefix
  • $["special-key"] - Bracket notation for special characters

Security

Network Schema Resolution

By default, network resolution is disabled. Enable per-request with resolveNetworkRefs: true.

To completely disable network requests (overrides all options):

{
  "mcpServers": {
    "json-explorer": {
      "command": "npx",
      "args": ["-y", "json-explorer-mcp"],
      "env": {
        "JSON_EXPLORER_NO_NETWORK": "1"
      }
    }
  }
}

Schema Validation

All referenced schemas are validated to ensure they're actual JSON Schema objects before use.

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run in development mode
npm run dev

License

MIT

Keywords

mcp

FAQs

Package last updated on 14 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts