JSON MCP Server logo

JSON MCP Server

by GongRzhe

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.

View on GitHub

Last updated: N/A

What is JSON MCP Server?

The JSON MCP Server is a server implementation that allows querying and manipulating JSON data using the Model Context Protocol (MCP). It provides a standardized way for Large Language Models (LLMs) to interact with JSON data sources.

How to use JSON MCP Server?

The server can be installed and run using npx @gongrzhe/[email protected] or by installing it globally with npm install -g @gongrzhe/[email protected] and then running server-json-mcp. It can be configured for use with Claude Desktop by adding a configuration block to claude_desktop_config.json.

Key features of JSON MCP Server

  • Query JSON data using JSONPath with extended operations.

  • Filter JSON data based on conditions.

  • Supports array operations like slicing, sorting, distinct, map, flatten, union, and intersection.

  • Supports string operations like case conversion, tests, and search.

  • Supports numeric operations like math, rounding, and functions.

  • Supports date operations like format, check, and modify.

  • Supports aggregation operations like group and stats.

Use cases of JSON MCP Server

  • Enabling LLMs to extract specific information from JSON data.

  • Filtering JSON data based on user-defined criteria.

  • Transforming JSON data into a desired format for LLM consumption.

  • Performing calculations and aggregations on JSON data.

FAQ from JSON MCP Server

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML.

How do I specify a URL for the JSON data?

The url parameter in the query and filter tools is used to specify the URL of the JSON data source.

What is the root object represented by in JSONPath expressions?

The root object is represented by $.

How do I sort an array by a specific field?

Use the $.sort(fieldName) operation. For descending order, use $.sort(-fieldName).

How do I perform date arithmetic?

Use the $.add(value, 'unit') operation, where unit can be 'days', 'months', or 'years'.