
quario
com.getquariov0.2.1更新于 Oct 6, 2026
Validate and render quario report definitions (JSON) to PDF, Excel, Word, HTML or CSV.
概览
让助手校验 JSON 报表定义,并将其渲染为 PDF、Excel、Word、HTML 或 CSV 文件保存到磁盘。
- 功能
- 该服务器提供两个工具。validate_report 在不渲染的情况下检查报表定义,返回问题与警告以及每个错误所在路径。render_report 将一份定义渲染为指定目标(pdf、xlsx、docx、html 或 csv),把文件写入磁盘并返回路径和大小,而不是文件内容。数据可以内联传入,也可以使用数据根目录内的 JSON 文件,图片可按路径引用或以内联 base64 提供。
- 适用场景
- 当助手需要把结构化 JSON 数据转换成可分享的办公或网页格式报表文件,并且希望拿回文件路径而不是大量二进制内容时使用。适合需要先校验定义再渲染的重复性报表生成场景。
- 运行要求
- 通过 stdio 在本地运行,使用 npx @quario/mcp 启动,需要 Node 22 或更高版本。配置仅来自环境变量:QUARIO_LICENSE 为许可证密钥,另有 QUARIO_LOCALE、QUARIO_CURRENCY、QUARIO_TIME_ZONE、QUARIO_DATA_ROOT 和 QUARIO_OUT_DIR。未声明需要账号或网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 quario,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@quario/mcp
Let an agent turn JSON data into a PDF, Excel, Word, HTML or CSV report. This MCP server gives
Claude and other MCP clients two tools. validate_report checks a report definition, and
render_report writes it to a file. One definition renders to all five formats, and the agent
gets back a path, never the file's bytes.
- Five formats. One JSON definition renders to
pdf,xlsx,docx,htmlandcsv. - Fixable errors. Each problem names the path it sits at, such as
data: expected a JSONPath string. The agent repairs that spot and tries again. - Files, not bytes.
render_reportwrites to disk and returns the path and size. A report costs the agent one line of context, whatever its size. - The host stays in charge. Query budgets, link schemes, the data root and the output directory come from the launch configuration. No tool argument changes them.
- No overwrites. A name that exists gets
-1, then-2, and so on. - Local. It runs over stdio, and
npx @quario/mcpstarts it.
A render_report call and its result:
The tool answers Wrote orders.pdf (1.3 kB): /tmp/quario-mcp/orders.pdf.
The server is open source. The engine it runs is not. This package is Apache-2.0. It installs
quarioand the five render targets. Those packages are commercial software under the Quario License. Evaluation is free. Without a license key, every render carries an unlicensed mark.
Contents
- Getting started
- Configuration
- The trust line
validate_reportrender_report- Not in this release
- Development
- License
Getting started
1. Check Node. The server needs Node 22 or later.
2. Add the server to your client. The package carries the engine and the five render targets, so there is nothing else to install.
Claude Code, for evaluation without a key:
Claude Code, with a license key:
Claude Desktop, in claude_desktop_config.json:
Leave out the env line to evaluate without a key.
3. Ask for a report. Restart the client, then ask the agent for one:
Render a PDF of these orders with a product column and a total column: Desk, 250, qty 2.
The agent answers with the path of the file it wrote. The file goes to quario-mcp under the
system temp directory unless QUARIO_OUT_DIR says otherwise.
4. Let it read your files (optional). Inline data works everywhere. To let the agent pass a
JSON file by dataPath, set QUARIO_DATA_ROOT to the directory that holds it. Claude Code sets
CLAUDE_PROJECT_DIR, and the server uses that when QUARIO_DATA_ROOT is unset.
Configuration
The server reads its configuration from environment variables. There are no flags and no config file. An empty variable counts as unset.
A value the server cannot run with stops it at startup. The message goes to stderr. That covers a budget that does not parse, a scheme the engine refuses, a data root that does not exist, and an output directory the server cannot create or write. A license key that fails verification is the one exception: the server starts, and the output carries the mark.
The trust line
The configuration the host sets in the environment is the host. The agent that calls the tools
is an author, and the engine treats an author as untrusted. So no tool argument reaches a host setting: the query budgets, the
href schemes, registered functions, fonts, the license key, the data root and the output
directory come from the environment alone.
locale, currency, timeZone and the target options are the exception. They change how a
report looks, not what the server can read, run or write, so a call may set them.
validate_report
Reads a definition for problems without rendering it.
The definition field carries the full JSON Schema of the report document, descriptions included,
so an agent reads the document's semantics from the tool itself. The server reads the envelope
against that schema and hands the definition to the engine unchecked. The engine reports a fault as
one problem at the path it sits at, which is more use to an agent than the schema's list of every
subschema that failed.
A problem is a successful result, never an error. The result carries structuredContent with
{ problems, warnings }, and one text block with the same object as JSON. Both copies are complete,
because one client gives the model the structured copy and another gives it the text.
- A problem is
{ path, source?, message, code?, start?, end? }.code,startandendcome from the located diagnostic when the engine has one. - A warning is
{ path, message }.
render_report
Renders a definition to one target and writes the output to a file.
The tool plans the definition against its target, so a required declaration that target loses
is a problem. A definition with problems returns the same { problems, warnings } as
validate_report, marked isError.
options passes to the target factory. The server refuses fonts and paths. An unknown key returns
the factory's own message as an error. The csv target takes no options.
Render data
- Give exactly one of
dataanddataPath. Both, or neither, is an error. dataPathresolves inside the data root. The server tests the path after it resolves symlinks, so a link cannot leave the root. Without a data root, the server refusesdataPath.- The file holds JSON. A file that does not parse returns the server's own message, and never the file's text.
- An image arrives in one of two forms.
{ "$image": "assets/logo.png" }names a file inside the data root.{ "$base64": "<base64>" }carries the bytes inline. Prefer$image, because a picture in base64 costs the agent's context on every call. - An object whose only key is
$imageor$base64decodes to bytes before the render. This happens at any depth, in inline data and in files alike. The definition reads the bytes as usual:=$.input.logo. - An
$imagepath resolves against the data root, also inside adataPathfile. The server tests the path after it resolves symlinks. The file must be a PNG or a JPEG. The server reads no other file. A data file reference therefore cannot copy an arbitrary file into a document. Without a data root, the server refuses$image. - The server reads each file once per call, however many times the data names it.
- A refusal is an error that names its path in the data, such as
$.input.logo. That covers a string that is not base64, and an$imagethat does not exist, leaves the root, or is not an image.
The output file
Every target writes a file and returns its location, never its content.
- The file goes to
QUARIO_OUT_DIR. filenameis a basename. It holds no separator and is not... The server forces the target's extension. Without afilename, the name isreport-<timestamp>.<ext>.- The server never overwrites. A name that exists gets
-1, then-2, and so on. - The result carries
structuredContentwith{ path, target, bytes }, and the textWrote <name> (<size>): <absolute path>.
Not in this release
Registered functions, host fonts, and remote transport.
Development
npm run check is the local gate. It runs formatting, lint, the dead-code checks, the size budget,
the unit and type suites, and the complexity check. CI runs the same gate. A green check locally
means a green pull request.
AGENTS.md holds the conventions for this repo. docs/adr holds the decisions that a reader is most likely to undo.
License
Copyright 2026 Robin van der Vleuten
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
The quario and @quario/* packages this server installs have their own license. See the
LICENSE file in each of those packages.
来源:README.md,提交 02724b9
工具
0版本历史
1- v0.2.1最新Oct 6, 2026


