Overleaf MCP
Provides tools to read, write, and compile LaTeX documents in a self-hosted Overleaf instance using native operational-transform protocol.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Overleaf MCP
A real-time Model Context Protocol server for Overleaf — self-hosted Community Edition / Server Pro and overleaf.com. No git-bridge, no fork, no extra infrastructure.
Overleaf MCP lets AI coding agents read, edit, comment on and compile LaTeX projects on your own Overleaf server or on overleaf.com. It speaks the same live editing protocol as Overleaf's own editor, so the agent's edits show up in the browser as a collaborator typing: no "file changed externally" toast, and people working in the same file are never interrupted.
It is published on npm as overleaf-mcp-rt (rt for real-time) and works with any MCP client.
Table of contents
More detail lives in docs/: configuration and login, the tool reference, and developing.
Related MCP server: overleaf-claude-mcp
Installation
You need Node.js ≥ 20. Nothing is installed on the Overleaf server.
As a plugin (recommended)
The plugin bundles the MCP server with the agent skills and two slash commands.
Harness | Install |
Claude Code |
|
Codex |
|
Cursor | Add this repository as a plugin marketplace, then install |
As an MCP server
For any other MCP client, add the server to its config:
{
"mcpServers": {
"overleaf": {
"command": "npx",
"args": ["-y", "overleaf-mcp-rt@latest"]
}
}
}The server reads the credentials that login saves (see Quick start). If you would rather configure it in place, set OVERLEAF_URL and OVERLEAF_SESSION_COOKIE in the entry's env. Is your Overleaf behind an auth proxy such as Cloudflare Access? See configuration.
Quick start
# 1. Sign in. A browser window opens; log in as usual and it closes itself.
npx overleaf-mcp-rt login --url https://overleaf.example.com --browser
# 2. Check the connection.
npx overleaf-mcp-rt diagnose
# 3. List your projects.
npx overleaf-mcp-rt lsThen ask your agent something like "list my Overleaf projects" or "fix the compile error in my thesis".
For overleaf.com, use --url https://www.overleaf.com. On a machine without a browser, login also takes a pasted cookie or an email and password — see logging in.
Multiple hosts
One server can be logged in to several Overleaf instances at once. Run login once for each:
npx overleaf-mcp-rt login --url https://tex.example.org --browser
npx overleaf-mcp-rt login --url https://www.overleaf.com --name overleaf.com --browser
npx overleaf-mcp-rt hosts # list themThe first host is the default. Every tool takes an optional host argument to pick another. More in configuration.
Agent skills
Skills are short instructions that an agent loads only when it needs them. They teach it to use these tools well.
Skill | Teaches |
| Installing, logging in, multiple hosts, and what each auth or config error means. |
| Making small, exact edits that fit around what people are typing. |
| Finding the main document, compiling, reading the errors, and leaving the project building. |
| When to comment instead of edit, and how to sign, reply to and resolve comments. |
The plugin installs them, along with the /overleaf-login and /overleaf-status commands. Without the plugin, copy them into your agent's skills directory:
npx overleaf-mcp-rt skills install --target <your skills dir>They are plain SKILL.md folders in skills/, written for any agent.
Tools
There are 29 tools. Each takes an optional host. The tool reference covers edit matching, compiling, what comes back, and the error codes.
Discover and read
Tool | Purpose |
| The Overleaf instances you are logged in to. |
| Your projects. |
| A project's folders and files, and how it is set up to compile. |
| The live text of a document. |
| Part of a document, by lines or by offset. |
| A binary file, such as an image or a PDF. |
| What collaborators changed since the agent last looked. |
Projects
Tool | Purpose |
| Create a blank project, or Overleaf's example project. |
| Copy a project under a new name. |
| Rename a project. |
| Archive a project, or bring it back. |
| Move a project to the trash, or restore it. There is no permanent delete. |
Edit
Tool | Purpose |
| Replace exact strings in a document. The recommended way to edit. With |
| Replace a whole document. Refuses to overwrite text the agent hasn't seen. Also takes |
Comments (overleaf.com and Server Pro)
Tool | Purpose |
| The comment threads on a document. |
| Attach a comment to a passage. |
| Reply in a thread. |
| Resolve or reopen a thread. |
Files and folders
Tool | Purpose |
| Create a text document. |
| Create a folder. |
| Upload a binary file. |
| Rename a document, file or folder. |
| Move a document, file or folder. |
| Delete a document, file or folder. |
Compile
Tool | Purpose |
| Compile the project, or one file, and report errors and warnings. |
| Compile and return the full log. |
| Compile and return the PDF. |
Supported Overleaf servers
Community Edition | Server Pro | overleaf.com | |
Versions | 4.x – 6.x | same code base as CE ¹ | current |
Read, edit, create, move, delete | ✅ | ✅ | ✅ ² |
Compile, log, PDF | ✅ | ✅ | ✅ |
Review-panel comments | — ³ | ✅ | ✅ |
Edits as tracked changes | — ³ | ✅ | ✅ ⁴ |
Login | browser, password or cookie | same | browser or cookie |
Behind an auth proxy | ✅ | ✅ | n/a |
¹ Not tested separately; reports welcome.
² Projects that Overleaf has moved to its newer document format are read-only unless you opt in. See configuration.
³ Stock Community Edition has no review panel, so the comment tools return COMMENTS_UNSUPPORTED, tracked edits TRACK_CHANGES_UNSUPPORTED, and nothing is changed.
⁴ When the project owner's plan includes track changes, and not yet on documents in the newer format. See tracked changes.
Why real-time?
Most other Overleaf integrations sync through git-bridge. This one joins the document the way a browser does.
Overleaf MCP | git-bridge–style servers | |
Community Edition | ✅ | ❌ git-bridge is a Server Pro feature |
overleaf.com | ✅ any plan | only plans with git integration |
Time until an edit appears in the editor | about 100 ms | minutes |
"File changed externally" toast | never | on every sync |
Someone typing in the same file | both edits survive | merge conflicts |
Contributing
Issues and pull requests are welcome on GitHub.
npm ci && npm run typecheck && npm test && npm run buildRead AGENTS.md for the project's constraints and architecture, and developing for testing the plugin from a checkout. Release notes are in the changelog.
License
AGPL-3.0-or-later, because parts of this project are ported from Overleaf-Workshop, which is AGPL-3.0.
Acknowledgements
The auth and OT client are ported from Overleaf-Workshop by iamhyc and contributors, the VS Code extension that pioneered speaking Overleaf's native protocol from outside the browser.
Built on the Model Context Protocol. This project is not affiliated with Overleaf.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Hosted Notion MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server teaching AI agents to implement TideCloak: auth, E2EE, IGA, security analysis
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server for Overleaf that allows Claude or other agents to navigate projects, read and edit .tex files, compile, and interact with review-panel comments via Overleaf's real-time Socket.IO API, with seamless support for tracked changes as pending suggestions.33473 npm9AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets Claude read, write, and push Overleaf LaTeX projects from the chat, with token-efficient features like sparse checkout and smart diffs.16MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to compile LaTeX documents and inspect the resulting PDF, supporting an autonomous write-compile-check-revise loop via a self-hosted Overleaf CLSI instance.1MIT
- AlicenseAqualityDmaintenanceAn MCP server for self-hosted Overleaf Community Edition that lets coding agents create projects, write LaTeX, compile, and receive structured diagnostics while humans edit the same document in the browser.8MIT