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.
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 file - Returns: 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.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Provides powerful JSON manipulation tools through Model Context Protocol, enabling complex queries, schema generation, and validation with jq notation and native Node.js operations.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that extracts embedded data (such as i18n translations or key/value configurations) from TypeScript/JavaScript source code into structured JSON configuration files.Last updated -24266JavaScriptMIT License
- AsecurityAlicenseAqualityA comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.Last updated -74JavaScriptMIT License
- AsecurityAlicenseAqualityA 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 -252267JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that transforms text into structured JSON data using templates with placeholders.Last updated -21TypeScriptMIT License