Skip to main content
Glama
JSON Query MCP

JSON Query MCP

by mgraczyk

JSON 查询 MCP

用于查询大型 JSON 文件的模型上下文协议 (MCP) 服务器。该服务器提供处理大型 JSON 数据的工具,可供实现模型上下文协议的LLM 模型使用。

特征

  • 使用 JSONPath 表达式查询 JSON 文件

  • 搜索与查询字符串相似的键

  • 搜索与查询字符串相似的值

Related MCP server: JSON MCP Server

例子

下面是一个 Cursor Agent 使用工具读取一个非常大(>1M 个字符)的 JSON Swagger 定义,并提取一小部分来编写 typescript 接口的示例。

例子

用法

npx json-query-mcp

在 Cursor 中安装

将以下内容添加到您的游标 mcp json 中(在 macOS 上这是/Users/$USER/.cursor/mcp.json )

{
  "mcpServers": {
    ... other mcp servers
    "json-query": {
      "command": "npx",
      "args": [<local path to this repo>],
    },
  }
}

发展

# Run in development mode
npm run dev

# Run tests
npm test

# Format code
npm run format

# Lint code
npm run lint

# Fix lints
npm run fix

执照

麻省理工学院

Available Tools

3 tools
json_query_jsonpathB

Query a JSON file using JSONPath. Use to get values precisely from large JSON files.

Inputs: file_path (required), jsonpath (required).

json_query_search_keysA

Search for keys in a JSON file. Use when you do not know the path to a key in a large JSON file, but have some idea what the key is.

Inputs: file_path (required), query (required), limit.

json_query_search_valuesA

Search for values in a JSON file. Use when you do not know the path to a value in a large JSON file, but have some idea what the value is.

Inputs: file_path (required), query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: json_query_jsonpath targets precise path-based queries, json_query_search_keys focuses on key discovery, and json_query_search_values handles value discovery. There is no overlap in functionality, making it easy for an agent to select the correct tool based on the query need.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'json_query_' as a prefix, followed by specific descriptors (jsonpath, search_keys, search_values). This uniformity enhances readability and predictability across the tool set.

    Tool Count4/5

    With 3 tools, the server is well-scoped for JSON querying, covering path-based queries, key searches, and value searches. However, it might be slightly thin if more advanced operations like filtering or transformation are expected, but it reasonably covers core query needs.

    Completeness4/5

    The tools provide comprehensive coverage for querying JSON files, including precise path queries and exploratory searches for keys and values. A minor gap exists in lacking tools for JSON manipulation (e.g., update or delete), but this is acceptable given the server's focus on querying rather than editing.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers