SuperAPIAI Directory

json-mcp-filter

github.com · AI developer platforms

Query and extract only the needed parts of JSON files to keep LLM context small.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

json-mcp-filter is a Model Context Protocol (MCP) server designed to help users filter out only the parts of JSON data relevant to the LLM context, thereby reducing context size. It supports local files and remote HTTP/HTTPS endpoints, and provides robust TypeScript type generation based on quicktype.

Purpose

This tool is mainly used to filter large JSON files and API responses, extracting data useful to the LLM while maintaining type safety. It is suitable for scenarios that require streamlining large amounts of JSON data before feeding it to an LLM.

Main Capabilities

  • Schema Generation: Use quicktype to convert JSON data into TypeScript interfaces.
  • Smart Filtering: Extract specific fields through shape-based filtering, and automatically chunk large datasets.
  • Remote Support: Can handle HTTP/HTTPS URLs and API endpoints.
  • Automatic Chunking: Automatically chunks datasets larger than 400KB, with accompanying metadata.
  • Size Protection: Built-in 50MB limit to prevent memory overflow.
  • MCP Ready: Seamlessly integrates with Claude Desktop and Claude Code.
  • Smart Errors: Provides clear, actionable error messages and debugging information.

Available Tools

  • json_schema: Generate TypeScript interfaces from JSON data. Parameters: filePath (local file path or HTTP/HTTPS URL).
  • json_filter: Extract specific fields using shape-based filtering, and automatically chunk large datasets. Parameters: shape (an object defining the fields to extract), chunkIndex (optional, the chunk index for large datasets, starting from 0). Behavior: returns all data for ≤400KB; automatically chunks and attaches metadata for >400KB.
  • json_dry_run: Analyze data size before filtering and provide chunking suggestions. Parameters: shape (the object defining what to analyze). Returns: size breakdown and chunking suggestions.

Usage

Installation methods:

  • Option 1: NPX (recommended)
  • Option 2: Global installation
  • Option 3: Install from source

MCP Integration: Add to the configuration file, or add manually: name: json-mcp-filter, args: ["-y", "json-mcp-filter@latest"].

Applicable Scenarios

  • Public APIs: REST endpoints with JSON responses.
  • Static files: JSON files on web servers.
  • Local development: during development http://localhost。
  • Local files: file system access.

Common workflow: during LLM integration, the API returns a large response, use json_filter to extract the relevant fields, process the clean data, then use json_schema to generate types to ensure safety.

Limitations and Security

  • Remote data fetching: the tool fetches data from HTTP/HTTPS URLs. Users are responsible for verifying that URLs point to legitimate endpoints, using only trusted public APIs, complying with API rate limits and terms of service, and reviewing data sources before processing. The maintainers are not responsible for external URL content, the privacy implications of remote requests, third-party API abuse, or violations. It is recommended to use only trusted public data sources.
  • Error handling: covers local files (not found, permissions, invalid JSON), remote URLs (network failures, authentication errors 401/403, server errors 500+), content size (automatically rejects >50MB with a clear message), format detection (intelligently detects HTML/XML and provides guidance), rate limiting (429 responses and retry instructions), processing (quicktype errors, shape filtering issues). All errors include actionable debugging information.
  • Size protection: maximum 50MB for all sources, pre-download check via Content-Length, memory safety to prevent OOM errors, clear error messages showing actual vs. limit size.
  • Recommendations: for large files, use json_dry_run first, filter with json_filter before schema generation, and focus shapes only on necessary fields.

Project Structure

(Detailed project structure content was not provided in the materials)

Hosted Deployment

Hosted deployment is provided on Fronteir AI.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools