JSON MCP 服务器是一个用于查询和操作 JSON 数据的 JSON 模型上下文协议 (MCP) 服务器实现。它让大型语言模型 (LLMs) 能够借助一组标准化工具与 JSON 数据进行交互。
JSON MCP 服务器可帮助大型语言模型方便地与 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')。$.diff()。$.sum()。$.avg()。$.max()。$.min()。若要配置此服务器以与 Claude Desktop 一起使用,请将以下内容添加到 claudius.config.js 文件中:
module.exports = {
mcp: {
server: 'http://localhost:3000'
}
}
若您未全局安装包,而是直接通过 Node.js 运行服务器,请确保提供完整的路径。
要在开发环境中运行此服务器,请执行以下命令:
npm run dev
之后您可以通过访问 http://localhost:3000 使用服务器。