JSON 模型上下文协议 (MCP) 服务器用于查询和操作 JSON 数据。它为大型语言模型 (LLMs) 提供了一组标准化工具,使其能够与 JSON 数据进行交互。
你可以通过以下方式安装并运行该服务器:
# 使用特定版本的 npx(推荐)
npx @gongrzhe/server-json-mcp@1.0.3
# 全局安装特定版本
npm install -g @gongrzhe/server-json-mcp@1.0.3
# 全局安装后运行
server-json-mcp
本服务器提供了多种工具和支持丰富的操作,具体如下:
url (字符串):JSON 数据源的 URL。jsonPath (字符串):带有可选操作的 JSONPath 表达式。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)。