JSON Filter MCP

JSON Filter MCP

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

Category
Visit Server

Tools

json_schema

Generate TypeScript schema for a JSON file. Provide the file path as the only parameter.

json_filter

Filter JSON data using a shape object to extract only the fields you want. Provide filePath and shape parameters.

README

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

Quick Start (Recommended)

# 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured