TeXFlow
Enables creation, editing, and compilation of LaTeX documents to PDF, with support for mathematical formulas, TikZ diagrams, bibliography management, and LaTeX syntax validation.
Provides tools for creating, editing, and converting Markdown documents to PDF or LaTeX format, with support for standard formatting, tables, code blocks, and math expressions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TeXFlow create a new project for my research paper"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TeXFlow MCP
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.
Install
pip install texflow-mcpOr run without installing:
uvx texflow-mcpSystem dependencies (optional)
TeXFlow compiles documents to PDF using XeLaTeX. Without it, you can still build and export .tex files.
# Arch
pacman -S texlive-xetex texlive-fontsrecommended texlive-fontsextra
# Debian/Ubuntu
apt install texlive-xetex texlive-fonts-recommended texlive-fonts-extra
# Fedora
dnf install texlive-xetex texlive-collection-fontsrecommended texlive-collection-fontsextraFor page preview (PNG), install poppler-utils (provides pdftoppm).
Related MCP server: MagicTeX MCP Server
Configure with Claude Code
claude mcp add texflow -- uvx texflow-mcpThat'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/TeXFlowConfigure 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:
Scaffold —
document(action="create")builds an empty document skeleton. Add content withedit(action="insert").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
Tool | Purpose |
| Create, ingest markdown, show outline, read sections |
| Columns, fonts, paper, margins, headers/footers, TOC |
| Insert, replace, delete, move blocks (section, paragraph, figure, table, code, equation, list, raw) |
| Compile to PDF, preview page as PNG, export |
| Search LaTeX commands, symbols, packages, error help |
| Batch 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 serverLicense
MIT
Available Tools
6 toolsdocumentB
Create, ingest, and inspect documents.
Actions:
create: Scaffold a new empty document. Optionally set class, title, author.
ingest: Parse markdown text, .tex file, or .md file into the document model.
outline: Show document structure (sections, block counts).
read: Read content of a specific section as prose text.
update: Update document metadata (title, author, date, abstract).
reset: Clear the current document and saved state. Next create/ingest starts fresh.
bib_add: Add a bibliography entry (provide BibTeX-format entry as source).
bib_remove: Remove a bibliography entry by key (provide key as source).
bib_list: List all bibliography entries.
bib_style: Set bibliography style (provide style name as source, e.g. "authoryear", "numeric").
Inputs: action (required), document_class, title, author, +4 more. Returns: result
editC
Manipulate document content structurally.
Actions:
insert: Add a new block at a position within a section.
replace: Replace a block at a position with new content.
delete: Remove a block at a position.
move: Move a block from one location to another.
read_raw: Read a RawLatex block with line numbers.
replace_raw: Update a RawLatex block (full or line-level) with lint check.
Sections are addressed by title path (e.g., 'Methods/Data Collection'). Blocks within a section are addressed by 0-based index.
page_break: For sections — "before", "after", "both", or "" to clear. Emits \clearpage before/after the section.
Inputs: action (required), block_type, section, position, +14 more. Returns: result
layoutB
Configure document typesetting and layout.
Only provided parameters are changed; others are left as-is.
section_break: Page break before level-1 sections. "before" inserts \clearpage before each \section. Works in any column mode. Individual sections can override via edit(page_break="before").
Inputs: columns, font, font_sans, font_mono, +15 more. Returns: result
queueA
Execute multiple operations in a single call.
Each operation is a dict with 'tool' (document, layout, edit, render, reference) plus the arguments for that tool. Operations run sequentially; disk is written once at the end.
Example: queue(operations=[ {"tool": "document", "action": "create", "title": "My Doc"}, {"tool": "edit", "action": "insert", "block_type": "section", "title": "Intro", "level": 1}, {"tool": "edit", "action": "insert", "content": "Hello world.", "section": "Intro"}, {"tool": "layout", "columns": 2, "font": "palatino"} ])
Args: operations: List of operation dicts. continue_on_error: If False (default), stop on first error.
Inputs: operations (required), continue_on_error. Returns: result
referenceA
Search LaTeX documentation, symbols, packages, and error solutions.
Actions:
search: Search for LaTeX commands or general topics.
symbol: Find symbols by description (e.g., "approximately equal").
package: Get information about a LaTeX package.
check_style: Analyze a .tex file for best practices.
error_help: Get help for LaTeX error messages.
example: Get working examples for a topic (table, equation, figure, list, code).
templates: Browse available LaTeX templates. Optionally filter by category or slug.
capabilities: Enumerate system LaTeX support (engines, tools, packages).
styles: Browse document style presets. Optionally filter by slug or keyword.
Inputs: action (required), query, description, name, +3 more. Returns: result
renderA
Compile and export the document.
Actions:
compile: Serialize model to .tex, compile to PDF. Returns PDF path.
preview: Render a specific page as PNG file. Returns file path and dimensions.
tex: Export the raw .tex source. Returns the LaTeX content.
Inputs: action (required), output_path, page, dpi. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: document management, structural editing, layout, queued operations, reference, and rendering. Even within document and edit, actions are well-separated with no overlap.
All tool names are lowercase descriptive nouns (document, edit, layout, queue, reference, render) and actions follow a consistent verb_noun pattern (e.g., create, ingest, bib_add, insert, replace). No naming irregularities.
6 top-level tools with well-organized sub-actions cover the full LaTeX workflow without being excessive. The count is appropriate for the domain, avoiding both sparse and bloated tool sets.
The tool set provides comprehensive coverage: document creation/ingestion, structural editing, layout configuration, batched operations, reference lookup, and full compilation pipeline (PDF/preview/TeX). No obvious gaps for a typical writing session.
Maintenance
Related MCP Connectors
Collaborative LaTeX editor: edit, compile and share PDFs, with full version history.
Write, compile and share Typst documents (papers, slides, drawings) from any AI agent.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to read, write, and compile LaTeX projects locally, view PDF pages as images, and manage project files, with live updates reflected in a web-based editor.-
- AlicenseAqualityCmaintenanceEnables AI agents to edit LaTeX documents with a live PDF preview, source editor, and PDF-anchored comments that become edit instructions. Requires no local TeX install, using a WASM TeX engine.792 npm5AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables agents to compile LaTeX documents, manage anchored comments as actionable review tasks, inspect section-level history, and view diff images in a live workspace.AGPL 3.0
- AlicenseAqualityCmaintenanceEnables AI agents to perform safe, semantic edits on Markdown and DOCX documents through a normalized model with staging, diff review, and stale-edit protection.13MIT