Paper Format Agent

io.github.zxyasfas由 GitHub 账号 zxyasfas 发布v3.1.0更新于 Oct 24, 2026

Local-first DOCX formatter for academic papers with a content-fingerprint integrity guard.

已验证STDIO仅桌面效率与工作流文件与存储

概览

AI 生成的概览

本地运行的 DOCX 论文排版工具,按格式规范调整样式,并在正文文本被改动时拒绝保存。

可以做什么
  • 按格式规范文件排版论文 DOCX,调整字体、行距、缩进、标题与图表题注
  • 从格式规范文档中提取排版规则
  • 对论文进行格式评分
  • 全程在本机运行,并在运行前后比对正文内容指纹
适用场景
适合需要在不把论文上传到外部网站的前提下,让学位论文或期刊稿件符合格式规范,并希望确认排版没有改动正文的场景;也适合从规范文档提取规则或给现有稿件打分。
运行要求
以本地 Python 进程运行(MCP 服务器需 Python 3.10 及以上),从 PyPI 安装并带 mcp 附加组件。未声明需要账号、API 密钥或环境变量。需要提供格式规范 DOCX 与论文 DOCX 作为输入。
安装前请注意
会在输出目录写出新的排版后 DOCX,请保留原始文件。内容校验只覆盖正文段落与表格,页眉页脚不在范围内,部分引擎会在校验后再做后处理。公式、脚注和复杂版式支持较弱,正式提交前不应只依赖它做检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Paper Format Agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Paper Format Agent

中文说明 | English

[CI] [Python] [License]

A local DOCX formatter for theses and papers.

It changes fonts, spacing, indents, headings and captions to match a format guide. It does not rewrite the paper. Before saving, it compares a fingerprint of the body and table text from before and after the run. If the text changed, it aborts instead of writing the formatted file.

Everything runs on your machine. Nothing is uploaded.

the content check

Report fields from a real run (--engine python):

json
{  "content_fingerprint_before": "793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db",  "content_fingerprint_after":  "793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db",  "content_changed": false,  "content_guard_enforced": true}

The two hashes should match. If they don't, the formatter exits with content guard failed and the formatted DOCX is not written.

What the check covers: body paragraphs and tables, with whitespace and stray bullet characters normalized before comparing. Headers and footers are out of scope because the formatter sets those on purpose. Use --engine python when the fingerprint must cover the final saved DOCX; the other engines run a local post-processor after the check, e.g. to refresh the table of contents.

To watch the guard trip, run python tools/demo_content_guard.py. It formats a synthetic paper, then repeats the run with the styling step patched to edit one sentence of the in-memory document. The second run aborts without writing the DOCX.

docs/BENCHMARK.md tracks which authored strings survive a run in small synthetic fixtures, and lists the known gaps.

install and run

bash
pip install -r requirements.txt
python -m paper_format_agent.cli \  --format-file "format_guide.docx" \  --paper-file "paper.docx" \  --out-dir "./output" \  --engine python

There is also a GUI (python run_gui.py), a batch mode, and JSON template packs for Chinese thesis, journal and IEEE-style formats. See docs/USAGE.md.

limits

Early project. Ordinary paragraphs, headings and tables work better than equations, footnotes and complex layouts. With --strict-required-sections, checks may include char_below_min or blank_page_risk. Do not use it as the only check before a real submission. Keep your original file.

Reference-list formatting is out of scope here: that part is mechanical rules, so it lives in a separate tool, gbt7714_check, which lints reference entries against GB/T 7714.

why I made this

I did not want to upload an unfinished thesis to a formatting website, and I wanted a way to check that formatting did not touch the text. So the default engine runs locally and refuses to save if the text changed.

agents

The repo doubles as an installable agent skill (SKILL.md), and the same pipeline is available as an optional MCP server (Python 3.10+):

bash
pip install "paper-format-agent[mcp]"paper-format-agent-mcp

Tools: format_paper, extract_format_rules, score_paper. Client config in docs/MCP.md.

contributing

Small PRs are welcome. Adding a synthetic test for a school or journal formatting rule is a good place to start: docs/CONTRIBUTOR_TASKS.md, CONTRIBUTING.md. Notes on the pipeline are in docs/ARCHITECTURE.md.

Do not commit real papers, private school templates, reviewer comments, API keys or generated output. Synthetic fixtures only.

license

MIT. See LICENSE.

来源:README.md,提交 f17a9e4

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v3.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分