overleaf-connect
Provides tools for managing Overleaf projects and files, including creating and duplicating projects, listing/reading/writing/editing .tex files, compiling projects, downloading the resulting PDF, and trashing projects.
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-connect Compile my latest Overleaf project and download the PDF."
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-connect
An MCP server to have agents use Overleaf for free.
Once it's connected, an agent can:
create or duplicate projects
list, read, write, and edit
.texfilescompile a project and pull the PDF back locally
Installation
If you dont have uv installed, install it.
It needs your Overleaf session cookie to do anything, so grab that first:
Sign in at overleaf.com.
Open DevTools -> Network, reload the project list, click any
overleaf.comrequest, and copy the fullCookierequest header.
Copy over this for the OVERLEAF_SESSION environment variable in the MCP server.
Claude Code
claude mcp add overleaf -e OVERLEAF_SESSION="overleaf_session2=s%3A...; GCLB=..." -- uvx overleaf-connectClaude Desktop
Open Settings -> Developer -> Edit Config and add an overleaf entry under mcpServers (keep any servers you already have):
{
"mcpServers": {
"overleaf": {
"command": "uvx",
"args": ["overleaf-connect"],
"env": {
"OVERLEAF_SESSION": "overleaf_session2=s%3A...; GCLB=..."
}
}
}
}Afterwards, restart Claude Desktop to reload the MCP servers and get Overleaf connected.
Related MCP server: overleaf-mcp
Authentication
Overleaf issues a fresh cookie on every request. After the first success the server saves the rotating value to:
Windows:
%LOCALAPPDATA%\overleaf-connect\session.jsonmacOS / Linux:
~/.overleaf-connect/session.json
The OVERLEAF_SESSION environment variable is treated as a seed - the server will automatically refresh the session whenever requests are done to Overleaf, and store it. You only need to change it in the future if the cookie has expired from not using it.
Optional environment variables
OVERLEAF_SESSION_FILE=... # where the rotating session cookie is cached
OVERLEAF_CACHE_DIR=... # compiled-PDF cache
OVERLEAF_OUTPUT_DIR=... # allowed download_pdf destination root
# (default: ~/Downloads/overleaf-connect, or
# ~/Documents/overleaf-connect, else ~/overleaf-connect)Tools
Tool | What it does |
| check if session cookie works |
| id, name, owner email, last updated |
| blank project |
| clone an existing project |
| paths in a project |
| text contents of a file ( |
| whole-file create/replace |
| exact old/new string replace in a file |
| Overleaf compile -> cached |
| compile and copy the PDF under |
| move a project to Overleaf trash |
Writes replace the whole file, so write_file refuses to write back a file that
was only read in part - read it again with full=true, or use edit_file.
Don't edit a file while someone is typing in it in the browser.
Available Tools
11 toolscompile_projectAIdempotent
Compile the project on Overleaf and save output.pdf locally.
Returns status, local pdf_path on success, and parsed LaTeX errors.
Inputs: project (required). Returns: object
create_projectA
Create a new blank Overleaf project. Returns id and editor URL.
Inputs: name (required). Returns: object
download_pdfADestructive
Compile the project and copy the PDF to dest.
If dest ends with .pdf it is the file path; otherwise dest is treated as a directory.
Inputs: dest (required), project (required). Returns: object
duplicate_projectA
Duplicate an Overleaf project. Returns the new id and editor URL.
Inputs: name (required), project (required). Returns: object
edit_fileADestructive
Replace an exact substring in a project file and upload the result.
Fails if old is missing, or if it appears more than once and replace_all is false. Prefer this over write_file for a paragraph or sentence change.
Inputs: new (required), old (required), path (required), project (required), +2 more. Returns: object
list_filesARead-only
List file and folder paths in an Overleaf project.
Inputs: project (required). Returns: object
list_projectsARead-only
List Overleaf projects (id, name, owner email, last updated).
Inputs: include_trashed, include_archived. Returns: object
read_fileARead-only
Read a text file from an Overleaf project.
Files over 100000 characters are truncated unless full=True, and the response sets truncated=true. write_file refuses to replace a file that was only read in part, because the unseen tail would be lost.
Inputs: path (required), project (required), full. Returns: object
statusARead-only
Check whether OVERLEAF_SESSION is set and still a valid Overleaf login.
Inputs: no named parameters. Returns: object
trash_projectADestructive
Move an Overleaf project to trash. Recoverable from the Overleaf dashboard.
Inputs: project (required). Returns: object
write_fileADestructive
Create or replace a text file. Missing folders are created.
Refuses to overwrite a file that changed since the last read_file, or that was only read in part, unless force=True.
Inputs: path (required), content (required), project (required), force. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools are clearly distinct, but compile_project and download_pdf both trigger a compile and produce a PDF, differing mainly in the output destination. This overlap could cause occasional confusion.
The naming pattern is largely consistent with snake_case verb_noun (list_projects, create_project, read_file, download_pdf), except 'status' stands out as a noun-only command. Overall the convention is clear and predictable.
With 11 tools, the surface is well-scoped for an Overleaf integration covering projects, files, compilation, and PDF download. It is neither too sparse nor overloaded.
Core workflows are covered: project listing/creation/duplication/trash, file read/write/edit, and compile/download. Minor gaps exist such as project renaming, file deletion, or folder management, but these are not essential for typical use.
Maintenance
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
A hosted LaTeX editor your assistant can actually use. Search 1,019 free templates, create and edit projects, and compile them to PDF on a real TeX Live farm, getting back the PDF or the compile log when a build fails. Thirteen tools behind OAuth 2.1, with nothing to install and nothing to run locally.
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI agents to interact with Overleaf projects directly, including creating projects, managing files, and editing documents in real-time using Overleaf's native Operational Transformation protocol.101-
- AlicenseAqualityDmaintenanceEnables AI assistants to read, edit, and compile LaTeX projects on Overleaf using session cookie authentication, bypassing the need for a paid plan.8MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, edit, and compile Overleaf LaTeX projects via the Overleaf web API using a browser session cookie.-
- AlicenseAqualityDmaintenanceEnables AI agents to read, write, compile, and manage Overleaf projects through MCP, including file operations, project administration, and LaTeX compilation diagnostics.16MIT