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.
An agent and a person editing the same file at the same time.
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.
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 | /plugin marketplace add DanielHou315/overleaf-mcp-rt then /plugin install overleaf-mcp-rt@overleaf-mcp-rt |
| Codex | codex plugin marketplace add DanielHou315/overleaf-mcp-rt then codex plugin add overleaf-mcp-rt@overleaf-mcp-rt |
| Cursor | Add this repository as a plugin marketplace, then install overleaf-mcp-rt |
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 ls
Then 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 them
The 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 |
|---|
overleaf-setup | Installing, logging in, multiple hosts, and what each auth or config error means. |
overleaf-editing | Making small, exact edits that fit around what people are typing. |
overleaf-latex-workflow | Finding the main document, compiling, reading the errors, and leaving the project building. |
overleaf-comments | When to comment instead of edit, and how to sign, reply to and resolve comments. |