JSON MCP Server
Node.js server implementing Model Context Protocol (MCP) for JSON operations.
Features
Query JSON files using jq notation with complex filters and transformations
Generate JSON schemas automatically from existing JSON data
Validate JSON schemas to ensure they are properly formed
S3 sync support for remote JSON file synchronization
Support for both stdio and HTTP transport protocols
Note: The server requires jq binary to be installed on your system and will only allow operations on files with absolute paths.
Related MCP server: JSON MCP Server
Prerequisites
🚨 Required: Install jq binary on your system
macOS:
Linux:
Windows:
Winget (recommended)
Verify installation:
API
Resources
file://json: JSON file operations interface
Tools
query_json
Execute jq queries on JSON files with complex filters and transformations
Input:
filePath(string, optional if default set): Absolute path to JSON filequery(string): jq query expression
Example queries:
"."- Return entire JSON (not recommended)".users"- Get users array".users[0].name"- Get first user's name".users[] | select(.active == true)"- Filter active users".[].price | add"- Sum all prices
generate_json_schema
Generate JSON schemas automatically from existing JSON data using genson-js
Input:
filePath(string, optional if default set): Absolute path to JSON fileReturns: Complete JSON schema that describes the structure of your data
validate_json_schema
Validate that JSON schemas are properly formed using AJV
Input:
schema(object): JSON schema object to validate, ORschemaFilePath(string): Path to file containing JSON schema
Returns: Validation result with detailed feedback
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
NPX (Recommended)
Stdio Transport (Default):
HTTP Transport:
Local Development
Stdio Transport:
HTTP Transport:
With S3 Sync (Optional)
Command Line Usage
Start server locally (stdio transport - default):
Start server with HTTP transport:
Transport options:
Testing:
MCP Inspector (for debugging):
Build
NPM Installation:
Local Development:
Dependencies
@modelcontextprotocol/sdk: MCP protocol implementationnode-jq: Node.js wrapper for jq binary (requires system jq installation)genson-js: JSON schema generationajv: JSON schema validationcommander: Command line argument parsingwhich: Binary path detection utility@aws-sdk/client-s3: AWS S3 client for optional file synchronizationexpress: HTTP server framework for HTTP transportcors: Cross-origin resource sharing middleware
Example JSON Data
Create a test file test-data.json:
License
This MCP server is licensed under the ISC License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the ISC License. For more details, please see the LICENSE file in the project repository.