Skip to main content
Glama

Helx

面向 AI 智能体的通用工件运行时。 一个引擎即可读取、创建、编辑、校验、差异比较并渲染智能体实际使用的格式——DOCX、XLSX、PPTX、PDF、Markdown、HTML、CSV——以及图表、流程图、模板、跨格式转换和 CSV 数据操作。提供三种使用方式:

  • CLI — 面向人类和 shell 脚本的 helx

  • MCP 服务器 — 通过 stdio 为 AI 智能体提供 20 个工具(Claude、Cursor 等)

  • TypeScript SDK — 为你的代码提供简洁的 Artifact 门面

npm version license PRs welcome

one model, every file
create → read → edit → save → validate → diff → render → convert

可视化图库

下面的每个工件都是由 Helx 自身创建和编辑,然后由 Helx 预览。点击任意卡片即可打开文件。

DOCX 报告

XLSX 销售

PPTX 演示文稿

PDF 季度报告

Markdown 手册

HTML 落地页

CSV 客户

DOCX 信函(模板合并)

流程图

使用 helx chart 生成的图表:

各地区收入 趋势 构成

图库由 npx tsx scripts/make-gallery.ts 生成——它通过 SDK 打开每个示例文件,并使用 @resvg/resvg-js 将样式化的 SVG 预览栅格化为 PNG。

Related MCP server: LibreOffice MCP Tools

为什么选择 Helx 而非 OfficeCLI

OfficeCLI 是一个面向 AI 智能体的强大 Word/Excel/PPT 编辑器。Helx 更进一步:

能力

Helx

OfficeCLI

格式

DOCX、XLSX、PPTX、PDF、Markdown、HTML、CSV

仅 Word、Excel、PPT

跨格式转换

helx convert report.docx report.md — DOCX↔MD/HTML/PDF、XLSX↔CSV/HTML/MD、PPTX→MD/HTML/DOCX、PDF→MD/HTML/DOCX、CSV↔XLSX

图表与流程图

helx chart(柱状/折线/饼图/环形/面积/散点),helx diagram(mermaid 风格流程图)

模板

{{var}}/{{#each}}/{{#if}} + 原地 DOCX 合并

仅 DOCX 合并

CSV 数据操作

analyzefiltersortgroupaggregateprofilededupeclean

PDF

创建、提取文本、合并、拆分

面向智能体视觉的渲染

DOCX/XLSX/CSV→HTML、PPTX→SVG、PDF→文本、MD→HTML、图表→SVG

渲染 → PNG

接口

CLI + MCP(20 个工具)+ TypeScript SDK

CLI + MCP

智能体路径

统一的 /p[2]/sheet[X]/cell[C3]css:.hero、... 支持所有格式

按格式区分

校验与差异比较

每个引擎都支持 validate + 语义化 diff

Helx 还在所有接口中提供 stat(文档统计)和 move(重排段落/行/幻灯片/形状)。

安装

npm install -g helx        # CLI + MCP server
# or
npm install helx           # SDK for your own TypeScript/JavaScript project

然后运行 helx --help,或将 MCP 服务器添加到你的 AI 客户端:

{
  "mcpServers": {
    "helx": { "command": "helx", "args": ["mcp"] }
  }
}

就这么简单——任何 AI 模型或智能体(Claude、Cursor、Cline、LangChain、自定义脚本)都可以创建、读取、编辑和渲染真实的 Office 与 Web 文档。

从源码构建

git clone https://github.com/Asno-dev/Helx.git
cd Helx
npm install
npm run build        # tsc → dist/
npm test             # 71 integration checks (tsx test/smoke.ts)

Node >= 18(动态 ESM 导入要求 >= 12.20;已在 Node 22 上验证)。

快速开始(CLI)

# Create a DOCX from a JSON spec (type inferred from the extension)
helx create report.docx '{"title":"Q3 Report","paragraphs":["Revenue grew 20% to $52k."],"tables":[{"headers":["Metric","Value"],"rows":[["ARR","4.2M"]]}]}'

# Inspect the structure as a path-addressed tree
helx inspect report.docx

# Read / write a single value via an agent path
helx get report.docx "/p[1]"
helx set report.docx "/table[0]/row[1]/cell[1]" "4.5M"

# Insert / remove / move, then validate and render to HTML for a visual check
helx insert report.docx "/p[2]" '{"text":"New paragraph","style":"Heading 2"}'
helx remove report.docx "/p[4]"
helx move report.docx "/p[2]" "/p[5]" --after
helx stat report.docx
helx validate report.docx
helx render report.docx --out report-preview.html

# Cross-format conversion (any direction, any engine)
helx convert report.docx report.md
helx convert report.md report.pdf
helx convert sales.xlsx sales.csv
helx convert deck.pptx deck.md

# Spreadsheets
helx create data.xlsx '{"sheet":"Revenue","rows":[["Quarter","Amount"],["Q1","10"]]}'
helx get data.xlsx "/sheet[Revenue]/cell[B2]"
helx analyze data.csv
helx filter data.csv '{"col":"score","op":"gt","value":80}'

# Decks
helx create deck.pptx '{"title":"Investor Deck","subtitle":"Q3 2026","bullets":["Market size: $10B"]}'
helx get deck.pptx "/slide[0]/shape[1]"

# PDFs (create via model; merge/split for structure)
helx create a.pdf '{"title":"Doc A","sections":[{"heading":"Intro","text":"Hello."}]}'
helx merge merged.pdf a.pdf b.pdf
helx split page1.pdf merged.pdf --pages 1
helx extract merged.pdf

# Charts, diagrams, templates
helx chart '{"type":"bar","labels":["Q1","Q2"],"values":[10,12]}' --out chart.svg
helx diagram 'graph TD; A[Start] --> B[End];' --out diagram.svg
helx template 'Hello {{name}}' '{"name":"Ada"}'

# Run the MCP server (for AI agents)
helx mcp

智能体路径

每个工件都暴露一棵稳定的、基于路径寻址的树,智能体可以读取/写入任意值:

格式

示例路径

DOCX

/p[2], /p[1]/text, /table[0]/row[1]/cell[0]

XLSX

/sheet[Revenue]/cell[C24], /sheet[0]/row[3]

PPTX

/slide[0]/shape[1], /slide[0]/shape[2]/text

PDF

/page[0], /page[0]/text

Markdown

/heading[0], /p[2]

HTML

css:h1, css:.summary > p

CSV

/row[3]/cell[1]

setinsertremovemove 会修改模型,save() 会将其往返写回文件。

跨格式转换

convert 遍历真实的内容模型——不是字符串拼接:

从 \ 到

DOCX

XLSX

PPTX

PDF

MD

HTML

CSV

DOCX

XLSX

PPTX

PDF

MD

HTML

CSV

const md = await Artifact.create('markdown', { root: { children: [] } });
await md.insert('/node', { type: 'heading', depth: 1, text: 'Hello' });
const docx = await md.convertTo('docx');   // real DOCX bytes
const html = await docx.convertTo('html');

MCP 服务器

helx mcp 通过 stdio 运行 Model Context Protocol 服务器。它暴露了 20 个工具:

create_artifact, inspect, get, set, insert, remove, move, convert, stat, render, validate, diff, merge_pdf, split_pdf, extract, analyze_csv, filter_csv, chart, diagram, template

这些工具基于文件系统路径——智能体传入文件路径和 JSON 值,服务器即可读取、编辑、保存或渲染工件。在类似 Claude Desktop 的客户端中注册它:

{
  "mcpServers": {
    "helx": { "command": "node", "args": ["/path/to/helx/dist/cli/index.js", "mcp"] }
  }
}

TypeScript SDK

import { Artifact, chartToSvg, dataFilter, renderTemplate } from 'helx';

// Create, edit, save
const doc = await Artifact.create('docx', {
  title: 'Report',
  paragraphs: ['Revenue grew 20% to $52k.'],
  tables: [{ headers: ['Metric', 'Value'], rows: [['ARR', '4.2M']] }],
});
await doc.set('/p[0]/text', 'Updated headline');
await doc.insert('/p[1]', { text: 'Inserted paragraph' });
const bytes = await doc.save();
await fs.writeFile('report.docx', bytes);

// Open any file, regardless of format
const art = await Artifact.open('data.xlsx', buffer);
console.log(await art.get('/sheet[Revenue]/cell[B2]'));
console.log(await art.inspect());

// Convert to another format, get stats, move elements
const md = await art.convertTo('markdown');
console.log(await art.stat());
await art.move('/sheet[Revenue]/row[3]', '/sheet[Revenue]/row[1]', 'before');

// Validation and diff
console.log(await art.validate());   // { status, issues[] }
console.log(await art.diff(other));  // DiffEntry[]

// Generator utilities
const svg = chartToSvg({ type: 'pie', labels: ['A', 'B'], values: [3, 7] });
const rows = dataFilter(data, { col: 'score', op: 'gt', value: 80 });
const out = renderTemplate('Hi {{name}}', { name: 'Ada' });

此外还导出:convertArtifact, canConvert, mergePdfs, splitPdf, dataProfile, dataSort, dataAggregate, dataDedupe, dataClean, parseDiagram, diagramToSvg, renderDocxTemplate, detectType, engineForFile, registerEngine, engines

架构

src/
  core/
    types.ts        # shared model contracts (Engine, ArtifactModel, ValidationReport, ...)
    base.ts         # BaseEngine with typed dispatch for set/insert/remove/move
    paths.ts        # agent-path parser (/p[0], /sheet[X], css:..., /row[n]/cell[n])
    utils.ts        # LCS diff, diffText/diffSeqMerged, HTML document shell
    convert.ts      # cross-format converter (content-model based, 19 directions)
    index.ts        # engine registry + Artifact facade (create/open/save/...)
    engines/
      docx.ts       # paragraphs, heading styles, tables
      xlsx.ts       # sheets, cells, formula read-back
      pptx.ts       # slides, shapes, text boxes
      pdf.ts        # create (pdfkit), extract text (pdfjs-dist), merge/split (pdf-lib)
      markdown.ts   # remark/rehype round-trip
      html.ts       # cheerio DOM editing + css: selectors
      csv.ts        # rows + data ops: profile/filter/sort/group/aggregate/clean/dedupe
      chart.ts      # SVG charts (bar, line, pie, donut, area, scatter, grouped bar, stacked bar)
      diagram.ts    # mermaid-style flowchart → SVG
      template.ts   # {{var}}/{{#each}}/{{#if}} + in-place DOCX placeholder merge
  cli/index.ts      # helx CLI (commander)
  mcp/index.ts      # MCP stdio server (20 tools)
  sdk/index.ts      # public package surface
scripts/make-gallery.ts   # README gallery generator
examples/demo/            # all demo files created by Helx itself

每个文件引擎实现同一个契约:read(bytes) → modelwrite(model) → bytes,以及 create(spec)get/set/insert/remove/move(path)inspect()validate()diff(other)render()Artifact 门面保留原始字节,因此即使在编辑后,不可变格式(如 PDF)仍可往返转换到其他格式。

说明与设计决策

  • PDF 在模型上是不可变的:文本提取是只读的(pdfjs-dist;pdf-parse 被移除,因为它捆绑的 pdf.js 2.x 无法解析 pdfkit 输出)。结构操作使用 pdf-libmergePdfssplitPdf

  • 渲染为 HTML 以用于智能体的视觉循环:DOCX/XLSX/CSV → HTML 表格,PPTX → 每张幻灯片 SVG,PDF → 每页文本,Markdown → HTML,图表/流程图 → SVG。

  • helx charthelx diagramhelx template 是生成器工具;它们不是已注册的文件引擎。

  • 转换基于模型:转换器读取每种格式的真实模型(DocxModelXlsxModel 等),并生成另一个引擎的规范,因此 convert 保留结构而不是粘贴原始文本。

许可证

Apache-2.0 — 参见 LICENSE

贡献

欢迎提交 Bug 报告、功能请求和拉取请求。请参阅 CONTRIBUTING.md 了解开发流程、约定和行为准则。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Make videos and docs with your AI agent — describe what you need, every output stays editable.

  • Generate PDF/DOCX/XLSX/PPTX from templates+JSON. Convert Office/HTML/MD to PDF. Universal templating

  • Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Asno-dev/Helx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server