Skip to main content
Glama

JSON Filter MCP

JSON MCP Filter

A Model Context Protocol (MCP) server that provides JSON schema generation and filtering tools. This server uses quicktype to convert JSON samples into TypeScript type definitions and offers JSON data filtering capabilities.

Particulary helpful for JSON files that are on the larger side which contains data you don't want included in your LLM context.

Features

  • JSON Schema Generation: Convert JSON files into TypeScript type definitions using quicktype-core
  • JSON Filtering: Extract specific fields from JSON data using shape-based filtering
  • MCP Integration: Seamlessly integrates with Claude Desktop and Claude Code
  • Type Safety: Built with TypeScript and includes comprehensive error handling

Tools Provided

json_schema

Generates TypeScript type definitions from JSON files.

Parameters:

  • filePath: Path to the JSON file to analyze

Example:

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

Generates TypeScript interfaces with proper typing.

json_filter

Extracts specific fields from JSON data using a shape definition.

Parameters:

  • filePath: Path to the JSON file to filter
  • shape: Shape object defining which fields to extract

Shape Examples:

// Extract single field {"name": true} // Extract multiple fields {"name": true, "age": true} // Extract nested fields {"user": {"name": true, "email": true}} // Extract from arrays (applies to each item) {"users": {"name": true, "age": true}}

Installation

# Using npx (no installation required) npx json-mcp-filter@latest # Or install globally npm install -g json-mcp-filter@latest json-mcp-server

From Source

  1. Clone this repository:
git clone <repository-url> cd json-mcp-filter
  1. Install dependencies:
npm install
  1. Build the server:
npm run build

Setup for Claude Desktop

Add this server to your Claude Desktop configuration file:

macOS

{ "mcpServers": { "json-mcp-filter": { "command": "node", "args": ["/path/to/json-mcp-filter/build/index.js"] } } }

Setup for Claude Code

Add this server to your Claude Code MCP settings:

Add a new server with:

  • Name: json-mcp-filter
  • Command: node
  • Args: ["/path/to/json-mcp-filter/build/index.js"]

Or, use the npx method for easier setup:

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

Or claude mcp add json-mcp-filter node /path/to/json-mcp-filter/build/index.js

Development

Scripts

  • npm run build - Compile TypeScript and make executable
  • npm run start - Run the compiled server
  • npm run inspect - Run with MCP inspector for debugging
  • npx tsc --noEmit - Type check without emitting files

Testing

Test the server using the MCP inspector:

npm run inspect

This will start the server with the MCP inspector interface for interactive testing.

Project Structure

src/ index.ts # Main server implementation with tools test/ test.json # Sample JSON file for testing build/ # Compiled TypeScript output

Error Handling

The server includes error handling for:

  • File not found errors
  • Invalid JSON format
  • Quicktype processing errors
  • Shape filtering errors
Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Query only the data you need from your JSON file and keep your context clean

  1. Features
    1. Tools Provided
      1. json_schema
      2. json_filter
    2. Installation
      1. Quick Start (Recommended)
      2. From Source
    3. Setup for Claude Desktop
      1. macOS
    4. Setup for Claude Code
      1. Development
        1. Scripts
        2. Testing
      2. Project Structure
        1. Error Handling

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server implementation that enables LLMs to query and manipulate JSON data using JSONPath syntax with extended operations for filtering, sorting, transforming, and aggregating data.
            Last updated -
            2
            522
            67
            JavaScript
            MIT License
            • Apple
            • Linux
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server for querying large JSON files using JSONPath expressions, enabling LLMs to efficiently search and extract information from large JSON data.
            Last updated -
            3
            5
            TypeScript
          • A
            security
            A
            license
            A
            quality
            Extract content from URLs, documents, videos, and audio files using intelligent auto-engine selection. Supports web pages, PDFs, Word docs, YouTube transcripts, and more with structured JSON responses.
            Last updated -
            1
            33
            MIT License
            • Apple
          • -
            security
            F
            license
            -
            quality
            Provides powerful JSON manipulation tools through Model Context Protocol, enabling complex queries, schema generation, and validation with jq notation and native Node.js operations.
            Last updated -
            129
            JavaScript
            • Apple
            • Linux

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/kehvinbehvin/json-mcp-filter'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server