overleaf-mcp
Overleaf MCP lets Claude safely read, edit, compile, and push LaTeX projects in Overleaf through the git bridge.
open_project: pulls the project, verifies every\usepackageresolves locally, and baseline-compiles roots; required before any write.files,outline,read,grep: explore the project — list.texfiles and roots, show structure with line numbers, read line ranges, and regex-search.edit: replace a unique snippet, then compile and push; reverts if the result does not compile.write: create or overwrite a whole file, then compile and push.add_asset: copy a local image or binary into the project and push; compiles only roots that reference it.compile: compile the root owning a path, reporting errors and warnings.render: render one page of the compiled PDF as an image to check layout, floats, and figures.
Provides the ability to read and edit Overleaf projects, with atomic compile-gated writes via git bridge, including listing files, outlining structure, reading, searching, editing, writing, compiling, and rendering Overleaf documents.
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., "@overleaf-mcp Add a paragraph about the results to section 4"
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.
Overleaf MCP
Read and edit Overleaf projects from Claude, using the Overleaf git bridge.
WARNING: When your provide the MCP with a project ID, This gives Claude access to the ENTIRE project directory.
Requirements
Overleaf premium (check your institution's access!)
uv,git, TeX distribution, andpdftocairo(you couldbrew install poppleron Macs)
Related MCP server: overleaf-mcp
Setup
Clone this repo.
Create
~/.overleaf-mcp/projects.json. An example is inprojects.json.example.{ "default": "paper", "projects": { "paper": "<project-id>" } }Add the server to your Claude config. You can generate the git token in Overleaf Account Settings.
{ "mcpServers": { "overleaf": { "command": "/absolute/path/to/uv", "args": ["run", "--directory", "/absolute/path/to/overleaf-mcp", "overleaf-mcp"], "env": { "OVERLEAF_TOKEN": "your_git_token" } } } }Restart your Claude Desktop.
How it works
A project is unverified until open_project succeeds, which checks that
every \usepackage resolves against your local TeX environment, and baseline-compiles each root.
All writes are refused until open_project passes
A .tex containing \documentclass is a root, while children are included with
by \input/\include/\subfile. Editing a child re-compiles the roots that include
it. For instance, this covers a standard main.tex + sections/ project, a single-file paper, or even a
folder of standalone one-page documents with the same rule.
Further, any errors block a push while warnings are only reported.
Tools
tool | description |
| pull, verify environment, and baseline-compile |
| list |
| structure with line numbers |
| line-numbered, optionally a range ( |
| regex search, |
| replace an exact unique snippet, compile-gated |
| create or overwrite a whole file |
| create or overwrite one section, using the exact title |
| copy an image or binary |
| compile the owning root, return a digest |
| one page as an image - very useful for layout/images |
Available Tools
10 toolsadd_assetA
Copy a local image or binary into the project, then push. Compiles only the roots that actually reference it — an unreferenced file cannot break a build.
Inputs: dest (required), message (required), local_path (required), project. Returns: result
compileA
Compile the root owning path and return a digest. Errors block a push;
warnings do not. verbose=True shows every error and warning.
Inputs: path (required), project, verbose. Returns: result
editA
Replace an exact snippet, then compile and push. old must appear exactly
once. Reverts if the result does not compile.
Inputs: new (required), old (required), path (required), message (required), +1 more. Returns: result
filesC
List .tex files, marking which are roots.
Inputs: project. Returns: result
grepB
Regex-search the project, returning file:line: match.
Inputs: pattern (required), glob, project. Returns: result
open_projectA
Open a project and run the safety gate: pull, verify every \usepackage resolves locally, then baseline-compile each root. Required before any write.
Inputs: name. Returns: result
outlineA
Map a document's structure with line numbers — sections, figures, labels, includes. Use before reading; far cheaper than the whole file.
Inputs: path (required), project. Returns: result
readA
Read a file, line-numbered. lines='150-190' reads a range; omit for all. Prefer a range guided by outline.
Inputs: path (required), lines, project. Returns: result
renderA
One page of the compiled PDF as an image, for layout only — float placement, overlap, figure sizing. Expensive: try compile() warnings first, and use read() for anything about the text itself.
Inputs: path (required), page, project.
writeA
Create or overwrite a file, then compile and push. For new documents and whole-file rewrites; prefer edit() for changes to an existing document.
Inputs: path (required), content (required), message (required), project. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a distinct purpose: project setup, structural navigation, content search, precise edits, whole-file writes, compilation, rendering, and asset additions. There is no meaningful overlap between tools that would cause an agent to select the wrong one.
Names are readable and consistently lowercase, but the pattern is mixed. add_asset and open_project follow verb_noun, while outline, read, grep, files, compile, render, edit, and write are bare commands, making the naming convention less predictable.
Ten tools is well-scoped for an Overleaf/LaTeX workflow: the server covers project setup, reading, searching, editing, writing, compilation, asset management, and visual rendering without unnecessary clutter.
The core workflow is well covered, including open, explore, read, search, edit, write, compile, render, and add assets. The most notable gap is the absence of delete/rename operations, but most agents can work around this for typical LaTeX editing tasks.
Maintenance
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
Read, edit, publish, and preview your pepita websites from Claude.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to Overleaf projects via Git integration, allowing Claude and other MCP clients to read LaTeX files, analyze document structure, and extract content.6190 npm362MIT
- AlicenseNot gradedqualityFmaintenanceEnables editing Overleaf projects from Claude, with tools to list, read, edit, and sync files via Git.MIT
- AlicenseNot gradedqualityBmaintenanceConnects Claude/ChatGPT to Overleaf projects via the Git integration, enabling read, edit, write, and file management through natural language commands.2AGPL 3.0
- AlicenseAqualityDmaintenanceEnables Claude Code to manage Overleaf projects by auto-discovering them and reading/editing files across all projects, with a review-before-push local-workspace workflow.17MIT