Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

JSON-MCP-Server

MCP.Pizza Chef: GongRzhe

JSON-MCP-Server is a Model Context Protocol (MCP) server designed to facilitate querying and manipulation of JSON data by large language models (LLMs). It exposes a set of standardized tools, including JSONPath-based querying and conditional filtering, allowing LLMs to interact with JSON data sources efficiently. This server supports extended JSONPath operations and flexible filtering conditions, making it ideal for applications requiring structured data extraction, transformation, and analysis. Installation is straightforward via npm or npx, enabling quick integration into AI-enhanced workflows that need real-time JSON data access and manipulation.

Use This MCP server To

Query JSON data using JSONPath expressions Filter JSON datasets based on complex conditions Enable LLMs to interact with remote JSON APIs Extract structured data from JSON for analysis Transform JSON data dynamically within AI workflows

README

JSON MCP Server (@gongrzhe/server-json-mcp@1.0.3)

A JSON Model Context Protocol (MCP) server implementation for querying and manipulating JSON data. This server enables LLMs to interact with JSON data through a set of standardized tools.

JSON Server MCP server

Installation & Usage

# 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

Components

Tools

  • query

    • Query JSON data using JSONPath syntax with extended operations
    • Input:
      • url (string): URL of the JSON data source
      • jsonPath (string): JSONPath expression with optional operations
  • filter

    • Filter JSON data using conditions
    • Input:
      • url (string): URL of the JSON data source
      • jsonPath (string): Base JSONPath expression
      • condition (string): Filter condition

Supported Operations

Array Operations
  • Slicing: $[0:5], $[-3:], $[1:4]
  • Sorting: $.sort(price), $.sort(-price)
  • Distinct: $.distinct()
  • Transformations:
    • Map: $.map(fieldName)
    • Flatten: $.flatten()
    • Union: $.union([1,2,3])
    • Intersection: $.intersection([1,2,3])
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)

Configuration

Usage with Claude Desktop

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

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

Alternatively, you can use the node command directly if you have the package installed:

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

Development

Building from Source

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build

Notes

  1. All JSONPath expressions start with $ representing the root object
  2. Array indices are zero-based
  3. String values in operations should be wrapped in quotes
  4. Date operations support 'days', 'months', and 'years' units
  5. Numeric operations support basic arithmetic operators (+, -, *, /)

License

MIT

JSON-MCP-Server FAQ

How do I install JSON-MCP-Server?
You can install it globally using npm with 'npm install -g @gongrzhe/server-json-mcp@1.0.3' or run it directly with npx using 'npx @gongrzhe/server-json-mcp@1.0.3'.
What inputs do the JSON-MCP-Server tools require?
The 'query' and 'filter' tools require a 'url' pointing to the JSON data source and a JSONPath expression or filter condition string to operate on the data.
Can JSON-MCP-Server handle complex JSONPath queries?
Yes, it supports extended JSONPath syntax with additional operations for advanced querying capabilities.
Is JSON-MCP-Server compatible with multiple LLM providers?
Yes, it is designed to work with various LLMs including OpenAI, Anthropic Claude, and Google Gemini by exposing standardized JSON interaction tools.
How does JSON-MCP-Server improve AI workflows?
It enables real-time, structured access and manipulation of JSON data, allowing LLMs to perform multi-step reasoning and data extraction seamlessly.
Can I use JSON-MCP-Server to interact with remote JSON APIs?
Yes, by providing the URL of the JSON API, the server can query and filter data remotely for LLM consumption.
What is the recommended way to run JSON-MCP-Server?
Using npx with the specific version is recommended for ease of use and avoiding global installs, but global installation is also supported.
Does JSON-MCP-Server support filtering JSON data?
Yes, it includes a 'filter' tool that allows filtering JSON data based on specified conditions.