Query JSON data using JSONPath syntax with extended operations
Filter JSON data using conditions
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.
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.
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
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"
]
}
}
All JSONPath expressions start with $
representing the root object. The server supports standard JSONPath syntax plus extended operations:
$.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$[0:5]
, $[-3:]
, $[1:4]
$.sort(price)
, $.sort(-price)
(descending)$.distinct()
$.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$.toLowerCase()
, $.toUpperCase()
$.startsWith('test')
, $.endsWith('test')
$.contains('test')
, $.matches('pattern')
$.math(+10)
, $.pow2()
$.round()
, $.floor()
, $.ceil()
$.abs()
, $.sqrt()
$.format('YYYY-MM-DD')
$.isToday()
$.add(1, 'days')
$.groupBy(category)
$.sum(price)
, $.avg(price)
, $.min(price)
, $.max(price)