overleaf-claude-mcp
Allows Claude to interact with Overleaf projects, including listing projects, selecting one, reading and editing LaTeX files and figures, compiling the project, and downloading the compiled PDF.
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-claude-mcpcompile the Efficient Reasoning project"
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-claude-mcp
Connect Claude to your Overleaf account. Claude can list your projects, pick one, read the LaTeX and the figures, edit files, compile, and pull the PDF back.
Overleaf has no public API on the free tier: the Git bridge and Dropbox sync are Premium features. So this server speaks the same internal HTTP and socket endpoints the Overleaf web app uses, authenticated with a browser session you create once. Every endpoint was read out of Overleaf's own JavaScript bundle and then exercised against a live account. See Verified endpoints.
Tutorial
What you need
Node 20 or newer (
node -v)Chrome or Edge installed
An Overleaf account, free tier is fine
Claude Code (
claude --version) or Claude Desktop
Step 1: Run setup
From this folder, on Windows:
setup.cmdOn macOS or Linux:
./setup.shSetup runs five steps and prints each one:
Installs dependencies
Builds to
dist/Checks for a working Overleaf session. If there isn't one, a browser window opens on the Overleaf login page
Reads one of your real projects back, to prove the connection works
Offers to register the server with Claude Code
Step 2: Sign in when the browser opens
The browser window is a real Chrome. Sign in the way you normally would, including 2FA. Nothing types your password for you and your password is never read or stored.
Once you land on your project list, the window closes on its own and setup continues. Your session cookies are saved to ~/.overleaf-claude-mcp/session.json.
That file is equivalent to full access to your Overleaf account. It is gitignored, and written with 0600 permissions on macOS and Linux. On Windows those permission bits are ignored, so the file is only as private as your user profile folder. Do not share it and do not commit it.
Step 3: Let setup register the server
At step 5 you get a prompt:
Register this server with Claude Code now? [y/N]Answer y. That runs:
claude mcp add overleaf -- node C:/CoolYEAH/overleaf-claude-mcp/dist/index.jsIf you skipped it, or you use a different client, register by hand. For Claude Code, run the command above. For Claude Desktop, edit %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS:
{
"mcpServers": {
"overleaf": {
"command": "node",
"args": ["C:/CoolYEAH/overleaf-claude-mcp/dist/index.js"]
}
}
}Step 4: Restart Claude
MCP servers are only picked up at startup. Quit and reopen Claude Code or Claude Desktop.
Confirm it loaded:
claude mcp listYou should see overleaf listed as connected. Inside a Claude Code session, /mcp shows the same thing.
Step 5: Use it
Just ask in plain language. Claude picks the tools itself.
List my Overleaf projectsSelect the Efficient Reasoning projectRead sections/methodology.texIn sections/results.tex, change "Table 1" to "Table~\ref{tab:main}"Compile it and tell me what the LaTeX errors areShow me figures/fig1.pngSave the compiled PDF to C:/tmp/paper.pdfPick a project once and it sticks. The selection is stored in ~/.overleaf-claude-mcp/state.json and survives restarts, so every later request applies to that project until you switch. To work on a different project in one request without switching, name it: "read main.tex from my thesis project".
Related MCP server: claudeleaf
How to trigger it
There is no slash command and nothing to type. Claude reads the tool descriptions and calls them when your request matches. Mentioning Overleaf, or a project or file you already selected, is enough.
If Claude does not reach for the tools, the usual causes are: you did not restart after registering, or no project is selected yet. Ask "what Overleaf project is selected?" to check.
Tools
Tool | Purpose |
| List projects, marking the selected one |
| Pick the active project by id or name |
| Show which project is selected |
| Full file and folder tree |
| Read a text file, with |
| View a figure inline |
| Save any file, including PDFs, locally |
| Regex search across the project |
| Create or overwrite a text file |
| Exact string replacement inside a file |
| Upload a local file such as a figure |
| Create a folder and any missing parents |
| Rename a file or folder |
| Move a file or folder |
| Delete an entry, requires |
| Server side compile |
| Compile and return parsed LaTeX errors |
| Compile and save the PDF |
| Compiled word count |
overleaf_select_project takes a project id or any part of a project name. If the name matches more than one project it lists the candidates instead of guessing. overleaf_delete refuses to run unless confirm is true, so Claude cannot delete a file by accident.
Troubleshooting
"No Overleaf session at ..." — you have not signed in yet, or the session expired. Run npm run login, or setup.cmd again.
Claude does not see the tools — you did not restart Claude after registering. Check claude mcp list.
A tool suddenly fails — Overleaf may have changed an endpoint. Run npm run recon, which probes each endpoint read-only and tells you exactly which call broke.
Check your setup from the terminal, without Claude:
npm run read -- "Efficient Reasoning"Prints the file tree and every section heading of the matching project. Add a path to dump a single file:
npm run read -- "Efficient Reasoning" sections/methodology.texRe-run setup any time. It reuses a working session and re-verifies the connection, so it doubles as a health check.
How it works
The file tree comes from Overleaf's socket connection, because that is the only source that carries entity ids, and ids are what writes need. The handshake is GET /socket.io/1/?projectId=<id>, which is socket.io 0.9 framing; the server then pushes joinProjectResponse with the whole project including rootFolder, doc ids and file hashes. The tree is cached for OVERLEAF_TREE_TTL_MS (default 15s) and invalidated after every write.
Text files are read per document, so a read always reflects the current state. overleaf_grep reads the project archive instead, so a whole project search costs one request rather than one per file.
Writes go through the upload endpoint. Uploading over an existing name is an in place update: the entity id is preserved, so Overleaf history and anyone else in the document keep working. Missing parent folders are created first.
Verified endpoints
Confirmed live against a real account, not assumed:
Operation | Call | Notes |
Project list |
|
|
CSRF |
|
|
New project |
| returns |
File tree |
|
|
Paths only |
| cheap, no ids |
Read doc |
| plain text |
Read binary |
| hash comes from the tree |
Archive |
| used for grep |
Create or overwrite |
| multipart, field |
Create doc or folder |
| body |
Rename |
| 204 |
Move |
| 204, body |
Delete |
| 204 |
Compile |
| returns |
Word count |
|
:type is doc, file or folder.
Scripts
Command | What it does |
| Full setup from scratch |
| Same, assuming dependencies are installed |
| Re-authenticate only |
| Inspect a project from the terminal |
| Read-only probe of every endpoint |
| End-to-end write test in a throwaway project |
| Compile to |
npm run smoke creates a project called claude-mcp-smoketest, then exercises write, overwrite, image upload, rename, move, delete and compile. It leaves the project in your account so you can inspect it. Trash it when you are done.
Configuration
All optional. Copy .env.example to .env in this folder and it is loaded on startup.
Variable | Default | Meaning |
|
| Point at a self-hosted instance |
|
| Where the session and selection live |
|
| |
|
| Truncation point for |
|
| File tree cache lifetime |
|
| |
|
| How long the login window waits |
Limits
None of this is a supported API, and Overleaf can change it at any time. Use it against your own account. Real time collaborative editing is not implemented: writes replace a whole document rather than sending character level operations, so avoid writing to a file while someone else is typing in it.
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-qualityBmaintenanceEnables editing Overleaf projects from Claude, with tools to list, read, edit, and sync files via Git.MIT
- 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.1038MIT
- Alicense-qualityBmaintenanceConnects Claude/ChatGPT to Overleaf projects via the Git integration, enabling read, edit, write, and file management through natural language commands.2AGPL 3.0
- Alicense-qualityBmaintenanceEnables AI agents to read, edit, and compile LaTeX documents in Overleaf projects with tracked changes via the Model Context Protocol.1MIT
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Read, edit, publish, and preview your pepita websites from Claude.
Connect Claude to Fathom meeting recordings, transcripts, and summaries
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/MarvelCollin/overleaf-claude-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server