Overleaf MCP
Provides tools for managing Overleaf projects, including listing projects and files, reading and writing files, compiling projects on Overleaf's servers, retrieving compile logs, and downloading PDFs.
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 MCPUpdate the abstract in main.tex and recompile"
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
An MCP (Model Context Protocol) server that lets AI assistants like Claude read, edit, and compile your Overleaf projects.
MCP spec compatibility: This server is built on FastMCP 3.x, which targets the classic handshake-based MCP spec (2025-11-25 and earlier) — it does not yet implement the stateless 2026-07-28 spec ("MCP 2.0"). Current clients (Claude Code, Claude Desktop, etc.) still support handshake-era servers, so it works fine today. It will move to the stateless spec once FastMCP 4 is released.
Works with free Overleaf accounts — no premium Git integration required. It authenticates with your browser session cookie and talks to Overleaf's web API via pyoverleaf.
Tools
Tool | Description |
| List all projects on your Overleaf account |
| List files in a project (supports glob filters like |
| Read any file from a project |
| Create or overwrite a file (preserves Overleaf history; creates folders as needed) |
| Compile on Overleaf's servers; returns the log tail on failure |
| Fetch the full LaTeX log from the latest compile |
| Download the compiled PDF to a local path |
Projects can be referenced by id, exact name, or a unique name substring — e.g. read_file("thesis", "main.tex").
Related MCP server: Unofficial Overleaf MCP Server
Setup
1. Clone and install
git clone https://github.com/SudheerNaraharisetty/overleaf-mcp.git
cd overleaf-mcp
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt2. Get your Overleaf session cookie
Log in at www.overleaf.com
Open browser DevTools (F12) → Application (Chrome) or Storage (Firefox) → Cookies →
https://www.overleaf.comCopy the value of the
overleaf_session2cookie
3. Configure the cookie
Create a .env file next to server.py:
echo 'OVERLEAF_SESSION_COOKIE=<paste cookie value here>' > .envNote: The cookie expires when your Overleaf session does. If the server starts returning auth errors, grab a fresh cookie and update
.env.
4. Add to your MCP client
Claude Code:
claude mcp add overleaf -- /path/to/overleaf-mcp/.venv/bin/python /path/to/overleaf-mcp/server.pyClaude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"overleaf": {
"command": "/path/to/overleaf-mcp/.venv/bin/python",
"args": ["/path/to/overleaf-mcp/server.py"]
}
}
}(Any other MCP client works the same way — run server.py with the venv's Python over stdio.)
5. Try it
Ask your assistant something like:
"List my Overleaf projects" "Fix the compile errors in my thesis project" "Update the abstract in main.tex and recompile"
How it works
Authenticates with the
overleaf_session2cookie (same session your browser uses)Reads/writes files through Overleaf's project API — edits show up live in the web editor and in project history
Compiles run on Overleaf's servers, so you get the exact same output as clicking "Recompile"
Security notes
Your session cookie grants full access to your Overleaf account — keep
.envprivate (it's gitignored)The server runs locally over stdio; nothing is exposed to the network
License
MIT
This server cannot be deployed
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.
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
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.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Claude and AI agents to read and edit Overleaf documents in real time, with support for project listing, document manipulation, LaTeX compilation, and live collaboration.44 npm19MIT
- FlicenseBqualityCmaintenanceEnables 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.10-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to read, edit, and compile LaTeX documents in Overleaf projects with tracked changes via the Model Context Protocol.2MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to read, edit, and compile LaTeX projects on Overleaf using session cookie authentication, bypassing the need for a paid plan.8MIT