overleaf-mcp
Allows AI agents to work with Overleaf projects, including reading and editing LaTeX sources, compiling, viewing PDFs, and managing tracked changes.
Click on "Install 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-mcpcompile main.tex and show errors"
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
Overleaf MCP lets an AI agent work with your Overleaf projects through the Model Context Protocol. The agent can find and read LaTeX, suggest edits, compile the project, inspect errors, and view the rendered PDF without leaving its normal coding environment.
Every source edit is submitted as a tracked-change suggestion. You remain in control and accept or reject the changes in Overleaf.
The project owner needs an Overleaf plan that supports tracked changes. The MCP never falls back to direct editing when tracked changes are unavailable.
What it can do
List joined projects and pending invitations, accept an invitation, and switch projects.
Search and read live LaTeX sources without downloading whole files.
Read review comment threads together with their source anchors.
Add, replace, revise, or withdraw tracked suggestions.
Follow concurrent human edits through Overleaf's live document channel.
Compile in draft or clean mode and report errors and warnings.
Render PDF pages and download project assets to local artifact paths.
Route document tasks to multiple named agents.
Reviewer accounts cannot create files or accept suggestions. If an agent needs
a new file, create_file tells it to ask you to create the empty file first.
Related MCP server: Overleaf MCP
Install
Python 3.11 or newer is required. pipx is recommended because it exposes the
MCP commands globally while keeping their dependencies isolated:
pipx install --include-deps "overleaf-mcp[login]"
playwright install chromiumThe Playwright dependency is used only for the one-time browser login. The MCP server itself runs headlessly.
To install from a source checkout instead:
git clone https://github.com/ayghri/overleaf-mcp.git
cd overleaf-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[login]"
python -m playwright install chromiumOn Windows, activate the environment with .venv\Scripts\activate.
Authenticate with Overleaf
Run the login command once on a machine with a display:
overleaf-mcp-loginA Chromium window opens. Sign in and complete any captcha. The session is saved
under ~/.local/state/overleaf-mcp/auth/ and reused by the MCP server. Run the
login command again when the session expires.
No configuration file is required for overleaf.com. For a self-hosted instance
or optional login-form prefill, create
~/.config/overleaf-mcp/config.toml:
base_url = "https://www.overleaf.com"
email = "bot@example.com"
password = "optional-login-prefill"A dedicated Overleaf account invited as a reviewer is recommended. The MCP still forces tracked suggestions if the account has broader permissions.
Connect an agent
Overleaf MCP is a standard local stdio server. Give each running agent a unique
--agent-id so its cursor, suggestions, and assigned tasks are identifiable.
Claude Code
claude mcp add overleaf -s user -- overleaf-mcp --agent-id writer
claude mcp listOpenAI Codex CLI
Add this to ~/.codex/config.toml:
[mcp_servers.overleaf]
command = "overleaf-mcp"
args = ["--agent-id", "writer"]OpenCode
Add this to opencode.json or ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"overleaf": {
"type": "local",
"command": ["overleaf-mcp", "--agent-id", "writer"],
"enabled": true
}
}
}Other MCP clients
Claude Desktop, Cursor, Cline, Windsurf, and similar clients accept the usual local-server JSON:
{
"mcpServers": {
"overleaf": {
"command": "overleaf-mcp",
"args": ["--agent-id", "writer"]
}
}
}If the client cannot find overleaf-mcp, use the executable's absolute path.
Restart the client after changing its MCP configuration.
Start using it
Ask the agent to initialize the workflow and select a project:
Use the Overleaf MCP. Call
workflow_help, list my projects, and select the project named KATA.
list_projects labels each result as joined or pending. Use
accept_project_invite with a pending project id before selecting it.
After selection, ordinary requests are enough:
“Find the expressivity section and tighten the first paragraph.”
“Compile cleanly and show me the remaining warnings.”
“Render page 4 so we can inspect the table.”
“Show my pending suggestions in
main.tex.”
The usual edit flow is search, a bounded read_file, goto_text, and an edit
operation. Suggestions stay pending until you accept them in Overleaf.
The selected project persists for that agent. You can optionally pin a default
project in ~/.config/overleaf-mcp/agents/writer.toml:
project_id = "your-overleaf-project-id"Use overleaf-mcp --list-agents to see live agent ids and their selected
projects.
Optional document task inbox
An agent can wait for work addressed to its id in LaTeX comments:
%%bot: writer
%%todo: rewrite this paragraph
Text the agent should work on.
%%end bot: writerThe agent uses wait_for_command, claim_command, and complete_command to
move the task from todo to doing to done. These comments do not appear in
the compiled PDF.
Docker
Perform the browser login on the host, then build the runtime image:
overleaf-mcp-login
docker build -t overleaf-mcp .Run the image as the MCP client's stdio command, mounting the saved session:
docker run -i --rm \
-v ~/.config/overleaf-mcp:/config:ro \
-v ~/.local/state/overleaf-mcp/auth:/session:ro \
overleaf-mcp --agent-id writerUse absolute mount paths in clients that do not perform shell expansion.
Troubleshooting
Authentication expired: run
overleaf-mcp-loginagain.No project selected: ask the agent to call
list_projectsandselect_project.Agent id already running: choose another
--agent-idor inspectoverleaf-mcp --list-agents.Client cannot start the server: run
overleaf-mcp --agent-id testin a terminal to expose the startup error.A non-BMP character is rejected: the legacy Overleaf editing endpoint does not safely preserve characters such as emoji in source mutations.
Development and design
poetry install --with dev
poetry run ruff check overleaf_mcp tests
poetry run pytestThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables access to Overleaf LaTeX projects through Git integration, allowing users to read files, analyze document structure, extract sections, and manage multiple projects through natural language commands.Last updated337MIT
- Flicense-qualityCmaintenanceEnables LLM agents to read and update Overleaf LaTeX papers via git, with tools for reading/writing main.tex and bibliography files.Last updated
- Alicense-qualityCmaintenanceEnables 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.Last updated1397MIT
- 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.Last updated10
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ayghri/overleaf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server