Skip to main content
Glama
GongRzhe

JSON MCP Server

by GongRzhe

JSON MCP 服务器 (@gongrzhe/server-json-mcp@1.0.3)

用于查询和操作 JSON 数据的 JSON 模型上下文协议 (MCP) 服务器实现。该服务器使 LLM 能够通过一组标准化工具与 JSON 数据进行交互。

安装与使用

# 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

Related MCP server: MCP Database Server

成分

工具

  • 询问

    • 使用 JSONPath 语法和扩展操作查询 JSON 数据

    • 输入:

      • url (字符串):JSON 数据源的 URL

      • jsonPath (字符串):带有可选操作的 JSONPath 表达式

  • 筛选

    • 使用条件过滤 JSON 数据

    • 输入:

      • url (字符串):JSON 数据源的 URL

      • jsonPath (字符串):基本 JSONPath 表达式

      • 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)

配置

与 Claude Desktop 一起使用

要将此服务器与 Claude Desktop 应用程序一起使用,请将以下配置添加到您的claude_desktop_config.json中:

{
  "json": {
    "command": "npx",
    "args": [
      "@gongrzhe/server-json-mcp@1.0.3"
    ]
  }
}

或者,如果您已经安装了该包,则可以直接使用 node 命令:

{
  "json": {
    "command": "node",
    "args": [
      "path/to/build/index.js"
    ]
  }
}

发展

从源代码构建

  1. 克隆存储库

  2. 安装依赖项:

    npm install
  3. 构建项目:

    npm run build

笔记

  1. 所有 JSONPath 表达式都以$开头,表示根对象

  2. 数组索引从零开始

  3. 操作中的字符串值应该用引号引起来

  4. 日期操作支持‘天’、‘月’和‘年’单位

  5. 数字运算支持基本算术运算符(+、-、*、/)

执照

麻省理工学院

Available Tools

2 tools
filterC

Filter JSON data using conditions

ParametersJSON Schema
NameRequiredDescriptionDefault
conditionYesFilter condition (e.g. @.price < 10)
jsonPathYesBase JSONPath expression
urlYesURL of the JSON data source

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Filter' implies a read-only operation, the description doesn't clarify whether this tool fetches data from a URL, processes it locally, or has any side effects like caching. It also omits details about error handling, performance, or output format, leaving significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it lacks front-loading of critical information—it doesn't immediately clarify the tool's scope or differentiate it from siblings, which slightly reduces its effectiveness despite the brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a tool that filters JSON data from a URL with three required parameters and no output schema, the description is incomplete. It fails to explain the output format, error conditions, or how the filtering integrates with the data source. Without annotations or an output schema, the agent lacks sufficient context to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning the input schema already documents all three parameters with descriptions. The tool description adds no additional meaning beyond what the schema provides, such as explaining how parameters interact or providing usage examples. However, since the schema is comprehensive, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Filter JSON data using conditions' states the tool's purpose with a clear verb ('Filter') and resource ('JSON data'), but it's vague about scope and doesn't distinguish from its sibling 'query'. It doesn't specify what kind of filtering or what the output looks like, leaving the agent uncertain about the exact operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling 'query', nor does it mention any prerequisites or alternative scenarios. Without any context about when this tool is appropriate, the agent must guess based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

queryC

Query JSON data using JSONPath syntax

ParametersJSON Schema
NameRequiredDescriptionDefault
jsonPathYesJSONPath expression (e.g. $.store.book[*].author)
urlYesURL of the JSON data source

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool queries JSON data but doesn't disclose behavioral traits like error handling, performance implications, rate limits, or what happens if the URL is invalid or JSONPath is malformed. For a tool with no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Query JSON data using JSONPath syntax.' It is front-loaded with the core purpose and has zero waste, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of querying external JSON data, the description is incomplete. No annotations exist, and there's no output schema, so the agent lacks information on return values, error cases, or behavioral constraints. The description doesn't compensate for these gaps, making it inadequate for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters ('jsonPath' and 'url'). The description adds minimal value beyond the schema, as it only reiterates the use of JSONPath without providing additional syntax or format details. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query JSON data using JSONPath syntax.' It specifies the verb ('query'), resource ('JSON data'), and method ('JSONPath syntax'). However, it doesn't explicitly differentiate from the sibling tool 'filter,' which might have overlapping functionality, preventing a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tool 'filter' or any other context for usage, such as prerequisites or scenarios where this tool is preferred. This leaves the agent with minimal direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 2 tool updatesv1.0.0
    • First observedfilter
    • First observedquery

TDQS

C2.8/5.0

Scored across 2 tools

Disambiguation3/5

The tools 'filter' and 'query' both operate on JSON data, which creates some overlap in purpose, as filtering can be seen as a subset of querying. However, the descriptions differentiate them: 'filter' uses conditions (likely simpler, boolean-based operations), while 'query' uses JSONPath syntax (a more expressive, path-based language). This distinction helps reduce confusion, but an agent might still struggle to choose between them for certain tasks.

Naming Consistency5/5

Both tool names follow a consistent pattern: they are single, lowercase verbs ('filter' and 'query') that clearly indicate actions. There are no deviations in style (e.g., no mixing with snake_case or camelCase), making the naming predictable and easy to understand across the set.

Tool Count2/5

With only 2 tools, this server feels thin for a JSON processing domain, which typically involves operations like parsing, transforming, validating, or merging JSON. The limited scope may force agents to work around gaps, as basic tasks like reading or writing JSON files are not covered, making it under-scoped for a general-purpose JSON server.

Completeness2/5

The tool set is severely incomplete for JSON processing. While 'filter' and 'query' handle retrieval and selection, there are no tools for creating, updating, validating, or manipulating JSON structures (e.g., add, remove, merge). This leaves significant gaps that will likely cause agent failures when trying to perform common JSON operations beyond simple queries.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.
    318 PyPI
    6
    Apache 2.0
  • A
    license
    D
    quality
    D
    maintenance
    A Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.
    5
    3 npm
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides standardized interfaces for interacting with Ollama API, offering JSON responses, error handling, and intelligent guidance for LLM-based API calls.
    9
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server for querying large JSON files using JSONPath expressions, enabling LLMs to efficiently search and extract information from large JSON data.
    3
    11
    -