This server is a powerful Model Context Protocol (MCP) tool that processes, filters, and generates schemas from JSON data sourced from local files or remote URLs.
Core capabilities:
Generate TypeScript interfaces from JSON data using
json_schemafor type safetySmart filtering with
json_filterto extract specific fields based on defined shapes, supporting nested objects and arraysPre-filtering analysis using
json_dry_runto analyze data size and get chunking recommendations before processingHandle large datasets with automatic 400KB chunking and
chunkIndexparameter for manageable data retrievalMulti-source support for local files, HTTP/HTTPS URLs, and API endpoints
Built-in protection with 50MB size limits and comprehensive error handling to prevent memory issues
LLM optimization by filtering large JSON responses to reduce noise and improve performance in AI contexts
Provides specific configuration instructions for integrating with Claude Desktop on macOS systems through the macOS configuration file.
Leverages quicktype to convert JSON samples into TypeScript type definitions, enabling type safety and improved code structure when working with JSON data.
Generates TypeScript type definitions from JSON files, providing type safety and better code structure when working with JSON data in TypeScript environments.
Click on "Install 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., "@JSON Filter MCPfilter this API response to only show user names and emails"
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.
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.
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
Related MCP server: Ashra Structured Data Extractor MCP
π οΈ 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 URLshape: Object defining which fields to extractchunkIndex(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 URLshape: 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@latestOption 2: Global Install
npm install -g json-mcp-filter@latest
json-mcp-serverOption 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@latestOr add manually:
Name:
json-mcp-filterCommand:
npxArgs:
["-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 onlyTesting
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_runfirst for large filesFilter with
json_filterbefore schema generationFocus shapes on essential fields only
π Supported Sources
Public APIs - REST endpoints with JSON responses
Static Files - JSON files on web servers
Local Dev -
http://localhostduring developmentLocal Files - File system access
π‘ Common Workflows
LLM Integration:
API returns large response
json_filterextracts relevant fieldsProcess clean data without noise
json_schemagenerates types for safety