JSON Query MCP server

Provides tools for efficiently querying, searching, and extracting specific information from large JSON files without processing entire structures
Back to servers
Provider
Michael Graczyk
Release date
Apr 18, 2025
Language
TypeScript
Stats
2 stars

This MCP server provides a powerful way to query large JSON files using JSONPath expressions. It's designed to work with Large Language Models (LLMs) that implement the Model Context Protocol, allowing them to effectively analyze and extract information from JSON data that would otherwise be too large to process.

Installation

Global Installation

You can install and run the JSON Query MCP server directly using npx:

npx json-query-mcp

Setup in Cursor

To integrate with the Cursor editor:

  1. Locate your Cursor MCP configuration file:

    • On macOS: /Users/$USER/.cursor/mcp.json
    • On other systems: Check Cursor documentation for the location
  2. Add the JSON Query MCP server to your configuration:

{
  "mcpServers": {
    "json-query": {
      "command": "npx",
      "args": ["json-query-mcp"],
    }
  }
}

Usage

The JSON Query MCP server provides several useful capabilities for working with large JSON data:

Query Using JSONPath

You can extract specific data from large JSON files using JSONPath expressions. JSONPath is a query language for JSON, similar to XPath for XML.

Example JSONPath expressions:

  • $.store.book[*].author - Get all authors of all books
  • $.store.book[?(@.price < 10)] - Get all books with price less than 10
  • $.store.book[-1:] - Get the last book

Search for Keys

You can search for keys within a JSON structure that match or are similar to a provided query string.

Search for Values

Similarly, you can search for specific values within the JSON data that match your search criteria.

Features

The server supports:

  • JSONPath Queries: Extract precisely the data you need from complex JSON structures
  • Key Similarity Search: Find JSON keys that are similar to your query string
  • Value Similarity Search: Locate specific values within the JSON data

These capabilities are particularly useful when working with very large JSON files (over 1M characters) like API definitions, configuration files, or datasets.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later