Token导航 LogoToken导航TokenDH.com
Universal JSON Agent logo
开发工具stdio官方级别未说明来源级核验

Universal JSON Agent

MCP Server

Universal JSON Agent MCP是一款通过自然语言与JSON文件交互的工具,提供26种功能来加载、探索、查询、聚合、转换和导出JSON数据。

工具数

26

提示词数

0

GitHub Stars

3

资源数

0
开发工具PythonClaude数据分析Claude DesktopClaudeCursorVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

GautamVhavle

提供方

GautamVhavle

最后核验

2026/5/17 20:21

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx universal-json-agent-mcp # run without installing

详细介绍

通用JSON代理MCP

使用自然语言与JSON文件对话。

26个强大的工具 直接从您的AI编辑器加载、探索、查询、聚合、转换和导出。

![PyPI](https://pypi.org/project/universal-json-agent-mcp/)

![Python](https://pypi.org/project/universal-json-agent-mcp/)

](https://lobehub.com/mcp/gautamvhavle-universal-json-agent)

![License](LICENSE)

![CI](https://github.com/GautamVhavle/universal-json-agent/actions/workflows/ci.yml)

![Tests](<>)

uv tool install universal-json-agent-mcp

入门指南 · 26工具 · 网络服务器 · 发展

______________________________________________________________________

为什么?

使用JSON不应该每次都需要编写脚本。这个工具可以让你用简单的英语提问,并立即得到答案。

You:  What's the total budget across all missions?

AI:   The total budget across all missions is $18,250,000,000.50
      (Used tools: load_json → sum_values)

支持的客户

任何MCP客户端
VS代码/副本克劳德桌面光标stdio

______________________________________________________________________

⚡ 入门指南

1.安装

uv tool install universal-json-agent-mcp   # install CLI once
uvx universal-json-agent-mcp               # run without installing
uv add universal-json-agent-mcp            # add dependency to your project

2.配置编辑器

VS Code / GitHub Copilot

创建 .vscode/mcp.json 在您的工作空间中:

{
  "servers": {
    "universal-json-agent": {
      "type": "stdio",
      "command": "universal-json-agent-mcp"
    }
  }
}
提示: 更喜欢零安装?使用 "command": "uvx""args": ["universal-json-agent-mcp"] 相反。

Claude Desktop

添加 claude_desktop_config.json:

{
  "mcpServers": {
    "universal-json-agent": {
      "command": "universal-json-agent-mcp"
    }
  }
}

Cursor

添加到光标MCP设置中:

{
  "mcpServers": {
    "universal-json-agent": {
      "command": "universal-json-agent-mcp"
    }
  }
}

CLI / Standalone

universal-json-agent-mcp
# or
uv run python -m universal_json_agent_mcp

开始 标准 --将任何MCP客户端导入其中。

3.开始提问

> Load data/orders.json and tell me what's inside
> How many missions have status "in_progress"?
> What's the total budget across all missions?
> Filter personnel where role contains "engineer"
> Sort by priority descending and show codenames
> Export the filtered results to CSV

______________________________________________________________________

🛠 工具参考

加载和管理

工具它做什么
load_json将JSON文件从磁盘加载到内存中
list_loaded列出所有加载的文档及其元数据
unload_json从内存中删除文档

探索

工具它做什么
get_keys获取对象的键或数组的索引范围
get_value在路径中检索值(自动截断为10 KB)
get_type返回路径中的JSON类型
get_structure类似模式的骨架——键、类型、嵌套

查询

工具它做什么
jsonpath_query运行JSONPath-- $.missions[*].codename
filter_objects按条件筛选: eq, gt, lt, contains, regex
search_text对所有字符串值进行全文搜索

聚合

工具它做什么
count统计数组中的项目或对象中的键
sum_valuesJSONPath上的数值求和
min_max获取数值的最小值和最大值
unique_valuesJSONPath上的不同值
value_counts频率表——像熊猫 value_counts()

变换

工具它做什么
flatten将嵌套对象展开为点符号对
pick_fields数组对象中的项目特定字段
group_by按字段值对对象进行分组
sort_by按字段对对象进行排序
sample从数组中随机选取N个项目

分析

工具它做什么
describe统计数据:计数、平均值、标准差、最小值、最大值、百分位数
multi_filter带AND/OR逻辑的复合滤波器
compare区分两个值——添加、删除、更改密钥

出口

工具它做什么
export_csv将对象数组导出到CSV文件
export_json将值导出到新的JSON文件

内省

工具它做什么
distinct_paths列出每个唯一的叶路径及其类型

______________________________________________________________________

🌐 Web服务器子项目(Web/)

可选的 FastAPI+语言链 此仓库中的web服务器子项目,封装了用于集成、仪表板或非MCP工作流的所有26个根MCP工具。
uv sync --extra web                       # install web deps with uv
cp .env.example .env                     # add your OpenRouter key
uv run python -m web.run --port 8000     # start server with uv
# open docs in browser: http://127.0.0.1:8000/docs

端点

方法端点描述
GET/health健康检查
POST/query上传JSON+提问
POST/query/path参考磁盘上的文件+提问
GET/docs交互式Swagger用户界面

示例

curl -X POST http://localhost:8000/query \
  -F "file=@data/missions.json" \
  -F "query=What's the total budget?"
{
  "answer": "The total budget across all missions is $18,250,000,000.50",
  "tools_used": ["load_json", "sum_values"]
}

配置

变量必填默认描述
OPENROUTER_API_KEY你的 开放路由 API密钥
OPENROUTER_MODELopenai/gpt-4o-mini任何 支持模型

______________________________________________________________________

🧑‍💻 发展

git clone https://github.com/GautamVhavle/universal-json-agent.git
cd universal-json-agent
uv sync --extra dev
uv run pytest                            # 489 tests

More test commands

uv run pytest -v                                        # verbose
uv run pytest tests/test_tools/test_aggregate.py        # one file
uv run pytest -k "test_filter"                          # by pattern

释放

发布是通过GitHub Actions完全自动化的:

git tag v0.3.0 -m "v0.3.0"
git push origin v0.3.0

然后 对于标签,CI运行测试、构建并发布到PyPI。

______________________________________________________________________

故障排除

MCP server not appearing in Copilot / Claude / Cursor

  1. 验证配置文件是否存在(.vscode/mcp.json VS代码)
  2. 检查命令是否在PATH上: which universal-json-agent-mcp
  3. 重新启动编辑器

"No document loaded" errors

您需要先加载一个文件。问你的AI: *“加载文件data/example.json”* --这叫 load_json 在幕后。

Truncated output

较大的结果限制在约10 KB。使用更具体的路径、过滤器或 pick_fields 缩小结果。

429 Too Many Requests (web server)

模型提供商正在限制您的速率。请稍等,或切换到您的 .env 文件。

Import errors in web server

uv sync --extra web

______________________________________________________________________

目录标签

目录标签

开发工具PythonClaude数据分析JSON处理本地部署自然语言查询数据转换

支持客户端

Claude DesktopClaudeCursorVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

26

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP