Writing
A LaTeX MCP server: compile, fix and check a paper without leaving your agent
Most papers written with an AI today make the same round trip. The agent drafts LaTeX, you paste it into an editor that compiles, the compile fails, and you paste the error back. People describe chat tools that leave you to paste it somewhere and hope it builds, and the setups that avoid it ask you to install a full TeX distribution on your own machine first.
hedwigai’s MCP server now has a tool, render_document, that compiles where the agent already is. The agent sends its LaTeX, with the .bib and any chapters and figures; real TeX compiles it; and the agent gets back either a link to the PDF or the line that failed, which it fixes before it calls again. It also takes Typst and Markdown. Compiling is free.

render_document on 15 October 2026: the class’s own layout, a numbered equation with a working reference, and the bibliography built.What the agent does
- Writes the paper, or edits the one you gave it.
- Calls
render_documentwith the main.tex, and the rest of the project as files: the.bib, chapters, a class file, figures. - Reads what comes back. A failure is the compiler’s own account of it, cut to the line that broke; on our test paper, sent first without its bibliography, that was
main.bbl:24: LaTeX Error: Something’s wrong--perhaps a missing \item. - Fixes the source and calls again, until it compiles.
- Hands you a link to the PDF, kept in your own storage for about six days.
The compiler is Tectonic 0.17, released in July 2026: XeTeX and TeX Live packages underneath, so a journal’s class file sets the page as it would on the author’s machine, and BibTeX runs as often as the document needs. Packages are kept warm on the server; the first compile of a rarely used one can take a minute while it is fetched.
How it compares
Overleaf is still the place to write a paper with co-authors: live editing, track changes and full history are what it is for, and none of that is here. What changes is who compiles. Overleaf’s free plan cut its compile limit to 10 seconds in 2025, a thesis or a figure-heavy paper can run past that, and its API does not compile for an agent. OpenAI’s Prism is a whole editor, but one you work in, not a tool your own agent can call.
| Option | Where you write | Who fixes a failed compile | Compile limit | To install | Working together | Price |
|---|---|---|---|---|---|---|
| render_document (hedwigai) | In your agent: Claude Code, Claude, Codex, Cursor, Hermes, any MCP client | The agent reads the failing line and fixes it | 4 minutes | None: one URL | Share the PDF link; no co-editing | Free to compile |
| Overleaf Free | Overleaf's web editor | You, with 5 AI uses a day | 10 seconds | None | 1 collaborator a project | $0 |
| Overleaf Standard | Overleaf's web editor | You, with the AI assistant, 10 uses a day | 4 minutes | None | 10 collaborators, track changes, Git | $25 a month or $199 a year |
| OpenAI Prism | Prism's web editor, inside ChatGPT | Its built-in AI | Not published | None | Unlimited collaborators | Free with a ChatGPT account at launch |
| Local LaTeX or Overleaf MCP servers | In your agent, on your machine | The agent, once you wire up the loop | Your machine's | A TeX distribution and latexmk, or Tectonic; Overleaf ones need a Git token (paid plans) | Through Overleaf or Git | Free, plus your setup |
Overleaf from its plans page and AI features (prices in US dollars; they differ by country). Prism from its launch coverage in January 2026 (Hacker News); check OpenAI for its current terms. Local servers such as OverleafMCP and WebLatexMCP run on your own machine.
What it does not do
- No live co-editing, track changes or history: share the PDF, or keep the source in Git or Overleaf.
- No shell escape, so
minteddoes not run;listingsdoes the same job. It stays off because a document must not run commands on our servers; Overleaf allows it inside its own sandbox, so minted works there. - BibTeX, not biber: a
biblatexdocument with the biber backend needs switching to BibTeX. - No LuaLaTeX: the engine is XeTeX, which compiles pdfLaTeX and XeLaTeX documents.
- The package set is TeX Live 2022’s, older than Overleaf’s default; almost every paper is unaffected.
Then check what it cites
A paper that compiles can still cite a work that does not exist, or a real one for a claim it does not make. The same server checks both: every entry looked up in Crossref and OpenAlex, and each sentence that cites one read against what was found. They are the checks behind the free reference checker and claim checker; from your agent they run on the draft it just compiled. Those checks, and research with a source for every claim, are what hedwigai’s prepaid credits pay for.
Connect it
One URL, in whichever agent you write with. A new account starts with $1 of credit and no card.
Claude Code, then type /mcp, choose hedwigai and Authenticate:
claude mcp add --transport http --scope user hedwigai https://mcp.hedwigai.com
Codex:
codex mcp add hedwigai --url https://mcp.hedwigai.com codex mcp login hedwigai
Hermes Agent, in ~/.hermes/config.yaml, then hermes mcp login hedwigai (Hermes’s MCP docs):
mcp_servers:
hedwigai:
url: "https://mcp.hedwigai.com"
auth: oauthClaude on the web or desktop: Settings, Connectors, Add custom connector, and paste https://mcp.hedwigai.com. Cursor: add it under mcpServers in ~/.cursor/mcp.json and click Connect.
Then ask your agent to write the paper, compile it, and send you the PDF.
More head-to-head evals
| Measure | Qwen3 235B | GLM-5.2 | Gemini 3.8 Flash | Claude Opus 5 |
|---|---|---|---|---|
| Seconds to the plan, median | 27 | 48 | 57 | 94 |
| Plans written, of three runs | 2 | 3 | 3 | 3 |
| Measure | SubQ | jev | Decider | Nimble |
|---|---|---|---|---|
| Found, mean of five columns at section length | 64% | 65% | 66% | 68% |
| Mechanism of action, found at section length | 57% | 51% | 61% | 54% |
| Measure | ask | Apollo | treg |
|---|---|---|---|
| Usable leads | 13 of 40 | 7 of 40 | 6 of 28 |
| Cost per usable lead | $0.037 | $0.27 | $0.23 |
| Measure | ask with jev | ask with Decider |
|---|---|---|
| Questions right, of 92 | 89 | 89 |
| Wrong answers | 1 | 2 |
| Measure | jev | ask |
|---|---|---|
| Our 370 clinical decisions, right | 94.6% | 93.0% |
| PubMedQA, right (best EdgeEvals scored: 62.2%) | 77.0% | 74.4% |
| Measure | ask | Claude Opus 5.5 |
|---|---|---|
| Questions right, of 95 | 59 | 63 |
| Small companies right, of 20 | 13 | 9 |
| Measure | realestate-us | Best of four assistants |
|---|---|---|
| Floor-plan rents right, of 26 | 26 | 23 |
| Amenities claimed the listing doesn't state | 12 | 129 |
| Measure | ask | jev |
|---|---|---|
| Right, of the questions answered | 98% | 79% |
| Wrong answers, of 92 | 2 | 19 |
| Measure | Trained localiser | Best of four frontier models |
|---|---|---|
| Mean overlap with the defect (IoU, 0 to 1) | 0.421 | 0.109 |