The JSON MCP Server is a Model Context Protocol implementation that allows Large Language Models to interact with JSON data. It provides standardized tools for querying and manipulating JSON using JSONPath syntax with extended operations, enabling powerful data extraction and transformation capabilities.
You can run the JSON MCP Server in several ways:
Run the server directly with npx without installation:
npx @gongrzhe/[email protected]
Install the package globally and then run it:
# Install globally
npm install -g @gongrzhe/[email protected]
# Run the server
server-json-mcp
The server provides two main tools for interacting with JSON data:
The query tool allows you to extract data using JSONPath expressions with extended operations.
Input parameters:
url
(string): URL of the JSON data sourcejsonPath
(string): JSONPath expression with optional operationsThe filter tool lets you filter JSON data based on specified conditions.
Input parameters:
url
(string): URL of the JSON data sourcejsonPath
(string): Base JSONPath expressioncondition
(string): Filter condition$[0:5]
, $[-3:]
, $[1:4]
$.sort(price)
, $.sort(-price)
$.distinct()
$.map(fieldName)
$.flatten()
$.union([1,2,3])
$.intersection([1,2,3])
$.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)
To use this server with the Claude Desktop app, add the following configuration to your claude_desktop_config.json
:
{
"json": {
"command": "npx",
"args": [
"@gongrzhe/[email protected]"
]
}
}
If you have the package installed, you can use the node command directly:
{
"json": {
"command": "node",
"args": [
"path/to/build/index.js"
]
}
}
$
representing the root objectTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "json" '{"command":"npx","args":["@gongrzhe/[email protected]"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"json": {
"command": "npx",
"args": [
"@gongrzhe/[email protected]"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"json": {
"command": "npx",
"args": [
"@gongrzhe/[email protected]"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect