JSON MCP Filter logo

JSON MCP Filter

Community
kehvinbehvin

JSON MCP server to filter only relevant data for your LLM

Publisherkehvinbehvin
Repositoryjson-mcp-filter
LanguageJavaScript
Forks
7
Stars
26
Available tools
3
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    JSON MCP Filter exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    26 stars and 7 forks from the linked repository.

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.

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:

javascript
// 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

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

Shape Patterns

javascript
// 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

javascript
// 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)

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

Option 2: Global Install

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

Option 3: From Source

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

⚙️ MCP Integration

Claude Desktop

Add to your configuration file:

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

Claude Code

bash
# 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

bash
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

bash
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 SizeProcessing Time
< 100 KB< 10ms
1-10 MB100ms - 1s
10-50 MB1s - 5s
> 50 MBBlocked

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.

Installation

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

Available Tools

  • json_schema

    Generate TypeScript schema for a JSON file or remote JSON URL. Provide the file path or HTTP/HTTPS URL as the only parameter.

  • json_filter

    Filter JSON data using a shape object to extract only the fields you want. Provide filePath (local file or HTTP/HTTPS URL) and shape parameters.

  • json_dry_run

    Analyze the size breakdown of JSON data using a shape object to determine granularity. Returns size information in bytes for each specified field, mirroring the shape structure but with size values instead of data.

Use JSON MCP Filter MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once JSON MCP Filter is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add JSON MCP Filter as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the JSON MCP Filter MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "json-mcp-filter": {
      "command": "npx",
      "args": [
        "-y",
        "json-mcp-filter"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the JSON MCP Filter MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the JSON MCP Filter MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use JSON MCP Filter to help me with this task?
JSON MCP Filter
Sure. I read it.
Here is what I found using JSON MCP Filter.

Frequently asked questions

What is the JSON MCP Filter MCP server used for?

JSON MCP Filter is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use JSON MCP Filter MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use JSON MCP Filter with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use JSON MCP Filter MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With JSON MCP Filter connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect JSON MCP Filter MCP to TypingMind?

JSON MCP Filter runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does JSON MCP Filter MCP provide in TypingMind?

JSON MCP Filter exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use JSON MCP Filter MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If JSON MCP Filter requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇