{
  "markdown": "<!-- mcp-name: io.github.zxyasfas/paper-format-agent -->\n\n# Paper Format Agent\n\n[中文说明](README.zh-CN.md) | English\n\n![CI](https://github.com/zxyasfas/paper_format_agent/actions/workflows/ci.yml/badge.svg)\n![Python](https://img.shields.io/badge/python-3.9%2B-3776AB)\n![License](https://img.shields.io/badge/license-MIT-lightgrey)\n\nA local DOCX formatter for theses and papers.\n\nIt changes fonts, spacing, indents, headings and captions to match a format\nguide. It does not rewrite the paper. Before saving, it compares a fingerprint\nof the body and table text from before and after the run. If the text changed,\nit aborts instead of writing the formatted file.\n\nEverything runs on your machine. Nothing is uploaded.\n\n## the content check\n\nReport fields from a real run (`--engine python`):\n\n```json\n{\n  \"content_fingerprint_before\": \"793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db\",\n  \"content_fingerprint_after\":  \"793e6533fd670418141d11fdcf014be19750408129ecff8b1b78a2641a3786db\",\n  \"content_changed\": false,\n  \"content_guard_enforced\": true\n}\n```\n\nThe two hashes should match. If they don't, the formatter exits with\n`content guard failed` and the formatted DOCX is not written.\n\nWhat the check covers: body paragraphs and tables, with whitespace and stray\nbullet characters normalized before comparing. Headers and footers are out of\nscope because the formatter sets those on purpose. Use `--engine python` when\nthe fingerprint must cover the final saved DOCX; the other engines run a local\npost-processor after the check, e.g. to refresh the table of contents.\n\nTo watch the guard trip, run `python tools/demo_content_guard.py`. It formats\na synthetic paper, then repeats the run with the styling step patched to edit\none sentence of the in-memory document. The second run aborts without writing\nthe DOCX.\n\n[docs/BENCHMARK.md](docs/BENCHMARK.md) tracks which authored strings survive\na run in small synthetic fixtures, and lists the known gaps.\n\n## install and run\n\n```bash\npip install -r requirements.txt\n\npython -m paper_format_agent.cli \\\n  --format-file \"format_guide.docx\" \\\n  --paper-file \"paper.docx\" \\\n  --out-dir \"./output\" \\\n  --engine python\n```\n\nThere is also a GUI (`python run_gui.py`), a batch mode, and JSON template\npacks for Chinese thesis, journal and IEEE-style formats. See\n[docs/USAGE.md](docs/USAGE.md).\n\n## limits\n\nEarly project. Ordinary paragraphs, headings and tables work better than\nequations, footnotes and complex layouts. With `--strict-required-sections`,\nchecks may include `char_below_min` or `blank_page_risk`. Do not use it as the\nonly check before a real submission. Keep your original file.\n\nReference-list formatting is out of scope here: that part is mechanical\nrules, so it lives in a separate tool,\n[gbt7714_check](https://github.com/zxyasfas/gbt7714_check), which lints\nreference entries against GB/T 7714.\n\n## why I made this\n\nI did not want to upload an unfinished thesis to a formatting website, and I\nwanted a way to check that formatting did not touch the text. So the default\nengine runs locally and refuses to save if the text changed.\n\n## agents\n\nThe repo doubles as an installable agent skill ([SKILL.md](SKILL.md)), and the\nsame pipeline is available as an optional MCP server (Python 3.10+):\n\n```bash\npip install \"paper-format-agent[mcp]\"\npaper-format-agent-mcp\n```\n\nTools: `format_paper`, `extract_format_rules`, `score_paper`. Client config in\n[docs/MCP.md](docs/MCP.md).\n\n## contributing\n\nSmall PRs are welcome. Adding a synthetic test for a school or journal\nformatting rule is a good place to start:\n[docs/CONTRIBUTOR_TASKS.md](docs/CONTRIBUTOR_TASKS.md),\n[CONTRIBUTING.md](CONTRIBUTING.md). Notes on the pipeline are in\n[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).\n\nDo not commit real papers, private school templates, reviewer comments, API\nkeys or generated output. Synthetic fixtures only.\n\n## license\n\nMIT. See [LICENSE](LICENSE).\n",
  "bytes": 3918,
  "sha": "0908552e463c0ba434fc6926b0aaf2aa78f61db9fe861f21596b1bf7d7233e46",
  "repo_slug": "zxyasfas/paper_format_agent",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_zxyasfas_paper_format_agent_6eb47b8a/readme"
}