MCP Connector

Generate JSON Schemas and Filter Data

MCP server that filters large JSON files or API responses to a specific shape and generates TypeScript types via quicktype.

Works with githubnpm

91
Spark score
out of 100
Updated 4 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Automate data processing by generating JSON schemas and filtering local or remote JSON files. This asset helps extract specific data structures and provides TypeScript interfaces for better code integration.

Outcomes

What it gets done

01

Generate TypeScript interfaces from JSON data using quicktype.

02

Filter JSON files and API responses to extract specific fields.

03

Analyze large datasets and recommend chunking strategies.

04

Process data from HTTP/HTTPS endpoints and local files.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-json | bash

Capabilities

Tools your agent gets

json_schema

Generates TypeScript interfaces from JSON data using quicktype

json_filter

Extracts specific fields using shape-based filtering and automatic chunking of large datasets

json_dry_run

Analyzes data size and provides chunking recommendations before filtering

Overview

JSON MCP Server

MCP server that filters large local or remote JSON down to a defined shape with automatic 400KB chunking, and generates TypeScript interfaces from the same data via quicktype. Use to trim large JSON files or API responses to only the needed fields, or to generate TypeScript types from JSON, before passing data into an LLM's context.

What it does

MCP server that generates TypeScript interfaces from JSON data and filters JSON - from local files or remote HTTP/HTTPS endpoints - down to a specific shape, built on quicktype for schema generation. It auto-chunks large filtered results in 400KB pieces and rejects anything over a 50MB size limit for memory safety, making it suited for extracting only the relevant fields from a large JSON file or API response before feeding it into LLM context.

When to use - and when NOT to

Use it when an LLM needs to work with a large JSON file or API response but only needs specific fields, or needs a TypeScript type definition generated from JSON data, from either local files or remote HTTP/HTTPS endpoints. Because it fetches remote data, users are responsible for verifying URLs point to legitimate endpoints, using trusted public APIs, respecting rate limits and terms of service, and reviewing data sources before processing - the maintainers are not responsible for external URL content, privacy implications of remote requests, or third-party API abuse; only trusted, public data sources are recommended.

Capabilities

Three tools: json_schema generates TypeScript interfaces from a local file or HTTP/HTTPS URL's JSON data using quicktype; json_filter extracts specific fields using shape-based filtering (an object naming which fields to keep, supporting single fields, nested objects, arrays applied per item, and complex nesting), returning all data at or under 400KB or auto-chunking with metadata above that, with an optional chunkIndex parameter to page through large datasets; json_dry_run analyzes data size against a given shape and returns a size breakdown with chunking recommendations before running the actual filter. All sources are capped at 50MB with pre-download Content-Length checking. Error handling covers local file issues (not found, permissions, invalid JSON), remote failures (network errors, 401/403 auth errors, 500+ server errors, 429 rate limiting with retry instructions), oversized content, and HTML/XML format-detection guidance, all with actionable debugging information. Processing time scales with file size: under 10ms for files under 100KB, 100ms-1s for 1-10MB, 1s-5s for 10-50MB, and blocked above 50MB.

How to install

Quick start via npx (no install required):

npx json-mcp-filter@latest

Or install globally with npm install -g json-mcp-filter@latest then run json-mcp-server, or build from source with git clone, npm install, npm run build. For Claude Desktop, add an mcpServers entry running npx -y json-mcp-filter@latest; for Claude Code, add it via claude mcp add json-mcp-filter npx -y json-mcp-filter@latest. Development commands include npm run build to compile, npm run start to run the compiled server, and npm run inspect for interactive debugging with the MCP inspector. A hosted deployment is also available on Fronteir AI.

Who it's for

Developers who need to feed large JSON API responses or files into an LLM's context window without noise, extracting only the fields they need and generating type-safe TypeScript interfaces from the same data.

Source README

MseeP.ai Security Assessment Badge

JSON MCP Filter

A powerful Model Context Protocol (MCP) server that provides JSON schema generation and filtering tools for local files and remote HTTP/HTTPS endpoints. Built with quicktype for robust TypeScript type generation.

JSON Server MCP server

Perfect for: Filtering large JSON files and API responses to extract only relevant data for LLM context, while maintaining type safety.

โœจ Key Features

  • ๐Ÿ”„ Schema Generation - Convert JSON to TypeScript interfaces using quicktype
  • ๐ŸŽฏ Smart Filtering - Extract specific fields with shape-based filtering
  • ๐ŸŒ Remote Support - Works with HTTP/HTTPS URLs and API endpoints
  • ๐Ÿ“ฆ Auto Chunking - Handles large datasets with automatic 400KB chunking
  • ๐Ÿ›ก๏ธ Size Protection - Built-in 50MB limit with memory safety
  • โšก MCP Ready - Seamless integration with Claude Desktop and Claude Code
  • ๐Ÿšจ Smart Errors - Clear, actionable error messages with debugging info

๐Ÿ› ๏ธ Available Tools

json_schema

Generates TypeScript interfaces from JSON data.

Parameters:

  • filePath: Local file path or HTTP/HTTPS URL

Example:

// Input JSON
{"name": "John", "age": 30, "city": "New York"}

// Generated TypeScript
export interface GeneratedType {
    name: string;
    age:  number;
    city: string;
}

json_filter

Extracts specific fields using shape-based filtering with automatic chunking for large datasets.

Parameters:

  • filePath: Local file path or HTTP/HTTPS URL
  • shape: Object defining which fields to extract
  • chunkIndex (optional): Chunk index for large datasets (0-based)

Auto-Chunking:

  • โ‰ค400KB: Returns all data
  • 400KB: Auto-chunks with metadata

json_dry_run

Analyzes data size and provides chunking recommendations before filtering.

Parameters:

  • filePath: Local file path or HTTP/HTTPS URL
  • shape: Object defining what to analyze

Returns: Size breakdown and chunk recommendations

๐Ÿ“‹ Usage Examples

Basic Filtering

// Simple field extraction
json_filter({
  filePath: "https://api.example.com/users",
  shape: {"name": true, "email": true}
})

Shape Patterns

// Single field
{"name": true}

// Nested objects
{"user": {"name": true, "email": true}}

// Arrays (applies to each item)
{"users": {"name": true, "age": true}}

// Complex nested
{
  "results": {
    "profile": {"name": true, "location": {"city": true}}
  }
}

Large Dataset Workflow

// 1. Check size first
json_dry_run({filePath: "./large.json", shape: {"users": {"id": true}}})
// โ†’ "Recommended chunks: 6"

// 2. Get chunks
json_filter({filePath: "./large.json", shape: {"users": {"id": true}}})
// โ†’ Chunk 0 + metadata

json_filter({filePath: "./large.json", shape: {"users": {"id": true}}, chunkIndex: 1})
// โ†’ Chunk 1 + metadata

๐Ÿ”’ Security Notice

Remote Data Fetching: This tool fetches data from HTTP/HTTPS URLs. Users are responsible for:

โœ… Safe Practices:

  • Verify URLs point to legitimate endpoints
  • Use trusted, public APIs only
  • Respect API rate limits and terms of service
  • Review data sources before processing

โŒ Maintainers Not Responsible For:

  • External URL content
  • Privacy implications of remote requests
  • Third-party API abuse or violations

๐Ÿ’ก Recommendation: Only use trusted, public data sources.

๐Ÿš€ Quick Start

Option 1: NPX (Recommended)

# No installation required
npx json-mcp-filter@latest

Option 2: Global Install

npm install -g json-mcp-filter@latest
json-mcp-server

Option 3: From Source

git clone <repository-url>
cd json-mcp-filter
npm install
npm run build

โš™๏ธ MCP Integration

Claude Desktop

Add to your configuration file:

{
  "mcpServers": {
    "json-mcp-filter": {
      "command": "npx",
      "args": ["-y", "json-mcp-filter@latest"]
    }
  }
}

Claude Code

# Add via CLI
claude mcp add json-mcp-filter npx -y json-mcp-filter@latest

Or add manually:

  • Name: json-mcp-filter
  • Command: npx
  • Args: ["-y", "json-mcp-filter@latest"]

๐Ÿ”ง Development

Commands

npm run build      # Compile TypeScript
npm run start      # Run compiled server  
npm run inspect    # Debug with MCP inspector
npx tsc --noEmit   # Type check only

Testing

npm run inspect    # Interactive testing interface

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ index.ts                    # Main server + tools
โ”œโ”€โ”€ strategies/                 # Data ingestion strategies
โ”‚   โ”œโ”€โ”€ JsonIngestionStrategy.ts  # Abstract interface
โ”‚   โ”œโ”€โ”€ LocalFileStrategy.ts      # Local file access
โ”‚   โ””โ”€โ”€ HttpJsonStrategy.ts       # HTTP/HTTPS fetching
โ”œโ”€โ”€ context/
โ”‚   โ””โ”€โ”€ JsonIngestionContext.ts   # Strategy management
โ””โ”€โ”€ types/
    โ””โ”€โ”€ JsonIngestion.ts          # Type definitions

๐Ÿšจ Error Handling

Comprehensive Coverage

  • Local Files: Not found, permissions, invalid JSON
  • Remote URLs: Network failures, auth errors (401/403), server errors (500+)
  • Content Size: Auto-reject >50MB with clear messages
  • Format Detection: Smart detection of HTML/XML with guidance
  • Rate Limiting: 429 responses with retry instructions
  • Processing: Quicktype errors, shape filtering issues

All errors include actionable debugging information.

โšก Performance

Processing Times

File Size Processing Time
< 100 KB < 10ms
1-10 MB 100ms - 1s
10-50 MB 1s - 5s
> 50 MB Blocked

Size Protection

  • 50MB maximum for all sources
  • Pre-download checking via Content-Length
  • Memory safety prevents OOM errors
  • Clear error messages with actual vs. limit sizes

Best Practices

  • Use json_dry_run first for large files
  • Filter with json_filter before schema generation
  • Focus shapes on essential fields only

๐ŸŒ Supported Sources

  • Public APIs - REST endpoints with JSON responses
  • Static Files - JSON files on web servers
  • Local Dev - http://localhost during development
  • Local Files - File system access

๐Ÿ’ก Common Workflows

LLM Integration:

  1. API returns large response
  2. json_filter extracts relevant fields
  3. Process clean data without noise
  4. json_schema generates types for safety

Hosted deployment

A hosted deployment is available on Fronteir AI.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.