Back to MCP Catalog

JSON Query and Manipulation MCP Server

Developer ToolsJavaScript
Query and manipulate JSON data using JSONPath expressions with extended operations
Available Tools

query

Query JSON data using JSONPath syntax with extended operations

urljsonPath

filter

Filter JSON data using conditions

urljsonPathcondition

The JSON Query and Manipulation server provides a powerful interface for interacting with JSON data through JSONPath expressions. It extends standard JSONPath functionality with additional operations for filtering, transforming, and analyzing JSON data. This server enables AI assistants to perform complex operations on JSON data sources, including array manipulations, string operations, numeric calculations, date handling, and data aggregation. With support for both simple queries and advanced transformations, it's a versatile tool for working with structured data.

Overview

The JSON Query and Manipulation server allows you to interact with JSON data using extended JSONPath syntax. It provides tools for querying, filtering, and transforming JSON data from various sources.

Installation

You can install and run the server using npm:

# Using npx with specific version (recommended)
npx @gongrzhe/server-json-mcp@1.0.3

# Install specific version globally
npm install -g @gongrzhe/server-json-mcp@1.0.3

# Run after global installation
server-json-mcp

Configuration

Claude Desktop Configuration

To use this server with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "json": {
    "command": "npx",
    "args": [
      "@gongrzhe/server-json-mcp@1.0.3"
    ]
  }
}

If you have the package installed locally, you can use:

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

JSONPath Syntax

All JSONPath expressions start with $ representing the root object. The server supports standard JSONPath syntax plus extended operations:

Basic JSONPath Examples

  • $.store.book[0] - First book in the store
  • $.store.book[*].author - All authors of all books
  • $.store.book[?(@.price < 10)] - All books with price less than 10

Extended Operations

Array Operations

  • Slicing: $[0:5], $[-3:], $[1:4]
  • Sorting: $.sort(price), $.sort(-price) (descending)
  • Distinct: $.distinct()
  • Transformations:
    • $.map(fieldName) - Extract specific field from each item
    • $.flatten() - Flatten nested arrays
    • $.union([1,2,3]) - Combine arrays
    • $.intersection([1,2,3]) - Find common elements

String Operations

  • Case: $.toLowerCase(), $.toUpperCase()
  • Tests: $.startsWith('test'), $.endsWith('test')
  • Search: $.contains('test'), $.matches('pattern')

Numeric Operations

  • Math: $.math(+10), $.pow2()
  • Rounding: $.round(), $.floor(), $.ceil()
  • Functions: $.abs(), $.sqrt()

Date Operations

  • Format: $.format('YYYY-MM-DD')
  • Check: $.isToday()
  • Modify: $.add(1, 'days')

Aggregation Operations

  • Group: $.groupBy(category)
  • Stats: $.sum(price), $.avg(price), $.min(price), $.max(price)

Usage Notes

  1. Array indices are zero-based
  2. String values in operations should be wrapped in quotes
  3. Date operations support 'days', 'months', and 'years' units
  4. Numeric operations support basic arithmetic operators (+, -, *, /)

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.