Labsco
aaronsb logo

TeXFlow

β˜… 20

from aaronsb

A document authoring and composition server for creating PDFs from LaTeX and Markdown, supporting collaborative editing and project-based workflows.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

TeXFlow MCP

License PyPI Python

A LaTeX document compiler with an MCP interface. AI agents operate on a structured document model β€” sections, paragraphs, figures, tables β€” while TeXFlow handles all LaTeX mechanics: packages, preamble, fonts, and compilation.

Configure with Claude Code

claude mcp add texflow -- uvx texflow-mcp

That's it. Restart Claude Code and the tools are available.

To set a workspace directory (where documents are saved):

claude mcp add texflow -- uvx texflow-mcp ~/Documents/TeXFlow

Configure with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "texflow": {
      "command": "uvx",
      "args": ["texflow-mcp"]
    }
  }
}

How it works

TeXFlow has two entry flows, both converging on the same in-memory document model:

  1. Scaffold β€” document(action="create") builds an empty document skeleton. Add content with edit(action="insert").
  2. Markdown ingest β€” document(action="ingest", source="paper.md") parses markdown into the model. Refine layout from there.

The model auto-saves to disk as JSON. LaTeX is only ever an output artifact β€” you never edit .tex directly.

Tools

ToolPurpose
documentCreate, ingest markdown, show outline, read sections
layoutColumns, fonts, paper, margins, headers/footers, TOC
editInsert, replace, delete, move blocks (section, paragraph, figure, table, code, equation, list, raw)
renderCompile to PDF, preview page as PNG, export .tex
referenceSearch LaTeX commands, symbols, packages, error help
queueBatch multiple operations in one call

Every response includes a workflow state hint showing where you are and what to do next.

Example session

> document(action="create", title="My Paper", document_class="article")

> queue(operations=[
    {"tool": "edit", "action": "insert", "block_type": "section", "title": "Introduction", "level": 1},
    {"tool": "edit", "action": "insert", "content": "This paper explores...", "section": "Introduction"},
    {"tool": "edit", "action": "insert", "block_type": "section", "title": "Methods", "level": 1},
    {"tool": "layout", "font": "palatino", "columns": 2}
  ])

> render(action="compile")

Development

git clone https://github.com/aaronsb/texflow-mcp
cd texflow-mcp
uv sync
uv run pytest tests/ -v    # 222 tests
uv run texflow              # Start MCP server

License

MIT