Get the FREE Ultimate OpenClaw Setup Guide →

JSON

JSON handling and processing mcp server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gongrzhe-json-mcp-server npx -y @gongrzhe/server-json-mcp@1.0.3

How to use

This MCP server implements tools for querying and manipulating JSON data. It exposes two primary tools: query and filter. The query tool evaluates JSON data sources using JSONPath expressions with a set of extended operations, enabling you to fetch, transform, and extract values from JSON documents or endpoints. The filter tool applies a base JSONPath expression and a conditional filter to return only the items that satisfy the given condition. The server supports a variety of operations across arrays, strings, numbers, dates, and aggregations (e.g., slicing, sorting, mapping, grouping, and basic arithmetic). You can compose complex data processing pipelines by chaining these operations through the provided inputs to the tools (url, jsonPath, condition, etc.).

How to install

Prerequisites:

  • Node.js (v14+ recommended) and npm installed on your machine
  • Internet access to pull NPM packages

Installation steps:

  1. Install the MCP server package globally via npx (recommended for quick start): npx -y @gongrzhe/server-json-mcp@1.0.3

  2. Alternatively, install globally with npm (if you prefer a persistent binary): npm install -g @gongrzhe/server-json-mcp@1.0.3

  3. Run the MCP server after installation: server-json-mcp

  4. If you need to run a specific version directly via npx without global install: npx -y @gongrzhe/server-json-mcp@1.0.3

Additional notes

Notes and tips:

  • All JSONPath expressions start with $ to represent the root object. Indices are zero-based for arrays.
  • When performing string operations, wrap string literals in quotes (e.g., $.contains("text")).
  • Date operations support units like days, months, and years (e.g., $.add(1, 'days')).
  • Numeric operations support basic arithmetic operators such as +, -, *, and / (e.g., $.math(+10)).
  • The tools expect inputs like url (JSON data source URL), jsonPath (expression with optional operations), and condition (for filtering).
  • If you run into network or CORS issues fetching remote JSON, consider providing a data URL with appropriate CORS headers or hosting the JSON at a reachable endpoint.
  • The MCP server version included here is 1.0.3; for production, pin to a specific version and monitor updates from the package maintainers.

Related MCP Servers

Sponsor this space

Reach thousands of developers