Unofficial Overleaf MCP Server
This server lets AI agents manage and edit Overleaf projects in real time via MCP.
Authenticate: Log in to Overleaf and capture the session cookie (
overleaf_login)Manage projects: List, create, rename, clone, and archive Overleaf projects
Browse files: List the full directory tree and read file contents
Edit documents: Apply precise text edits in real time using Operational Transformation (
overleaf_edit_file)Create and organize: Create docs/folders, rename, move, and delete files or folders
Upload files: Upload local files or files from a public URL, including binaries like images and PDFs
Collaborate: Invite collaborators by email, list members/invites, and revoke access
Compile: Compile LaTeX projects and download the resulting PDF
Provides tools for managing Overleaf projects, including creating projects, listing and manipulating files, real-time document editing via Operational Transformation, and triggering LaTeX compilation for PDF download.
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., "@Unofficial Overleaf MCP Server Create a new Overleaf project named 'test'."
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.
Unofficial Overleaf MCP Server
An unofficial Model Context Protocol (MCP) server that provides AI agents with the ability to interact with Overleaf projects directly. This server allows agents to create projects, list files, read contents, manage files, and securely edit documents in real-time using Overleaf's native Operational Transformation (ShareJS) WebSocket protocol.
Features
Project Management: Create new Overleaf projects natively.
File System (CRUD): List, upload, create, move, and delete files or folders within an Overleaf project.
Real-Time Document Editing: Edits files natively without full ZIP downloads. Utilizes a reverse-engineered Socket.IO 0.9 shim and the
diff-match-patchlibrary to translate semantic edits into precise ShareJStext0Operational Transformation (OT) updates.Compilation: Trigger server-side LaTeX compilation and download the resulting PDF.
Related MCP server: overleaf-mcp
Prerequisites
Node.js (v18+)
An active Overleaf account.
Configuration & Authentication
This MCP server authenticates to Overleaf using your session cookie (overleaf_session2).
Option 1: Automated Login (Recommended)
You can let the AI or CLI handle login automatically:
Via AI: Just ask the AI agent: "Faça login no Overleaf" (it will call the
overleaf_logintool).Via Terminal: Run
npm run login.
A browser window will open for you to log into your account. As soon as you log in, the cookie is automatically captured, saved to .env, and loaded into the server.
Option 2: Manual Cookie in mcp_config.json
If you prefer manual configuration:
Log into your Overleaf account in your browser.
Open Developer Tools (F12) -> Application / Storage -> Cookies.
Copy
overleaf_session2and set it in your MCP configuration.
Adding to Antigravity IDE / Gemini
Add the following to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"overleaf": {
"command": "node",
"args": [
"/absolute/path/to/unofficial-overleaf-mcp-server/build/index.js"
]
}
}
}(Notice: You don't even need to manually define the env block if you let overleaf_login manage your .env file!)
Available MCP Tools
Authentication
overleaf_login(timeoutSeconds?): Opens a browser window, captures the session cookie upon login, saves it to.env, and activates the session.
Project Management
overleaf_list_projects(includeArchived?, search?): Lists all projects belonging to or shared with the user.overleaf_create_project(projectName): Creates a new blank project.overleaf_rename_project(projectId, newName): Renames an existing project.overleaf_clone_project(projectId, projectName): Duplicates/clones a project.overleaf_archive_project(projectId): Archives a project.
File & Entity Operations
overleaf_list_files(projectId): Returns the complete directory tree.overleaf_read_file(projectId, filePath): Reads the full text of a LaTeX document.overleaf_edit_file(projectId, filePath, targetContent, replacementContent): Edits text in real-time via OT/WebSocket.overleaf_create_doc(projectId, name, parentFolderPath?): Creates a new LaTeX document.overleaf_create_folder(projectId, name, parentFolderPath?): Creates a new folder.overleaf_rename_entity(projectId, path, newName): Renames a document, file, or folder.overleaf_move_entity(projectId, path, newParentFolderPath): Moves an entity to a destination folder.overleaf_delete_entity(projectId, path): Deletes an entity from the project.overleaf_upload_file(projectId, filePath?, contentBase64?, fileName?, parentFolderPath?, folderId?): Uploads a file (text or binary such as images, PDFs, ZIPs) from disk or memory base64.overleaf_upload_from_url(projectId, url, name, parentFolderPath?): Downloads and links a file directly from a public URL.
Collaboration & Sharing
overleaf_share_project(projectId, email, privileges?): Invites a collaborator by email with read/write or read-only access.overleaf_list_collaborators(projectId): Lists accepted members and pending invitations.overleaf_revoke_collaborator(projectId, emailOrId): Revokes a pending invite or removes an accepted collaborator.
Compilation
overleaf_compile_and_download(projectId, rootDocId, outputPath): Compiles the project and downloads the resulting PDF.
Security Note
This server requires your Overleaf session cookie to operate. Do not commit your session cookie or any specific project IDs into version control.
Build
npm install
npm run buildUsage
npm startAvailable Tools
10 toolsoverleaf_compile_and_downloadB
Compiles the Overleaf project and downloads the resulting PDF.
Inputs: projectId (required), rootDocId (required), outputPath (required).
overleaf_create_docC
Creates a new blank document in an Overleaf project.
Inputs: name (required), projectId (required), parentFolderPath.
overleaf_create_folderB
Creates a new folder in an Overleaf project.
Inputs: name (required), projectId (required), parentFolderPath.
overleaf_create_projectB
Creates a new blank project in Overleaf.
Inputs: projectName (required).
overleaf_delete_entityB
Deletes a document, file, or folder from an Overleaf project.
Inputs: path (required), projectId (required).
overleaf_edit_fileA
Edits a file in an Overleaf project using Operational Transformation. You can either replace a specific chunk of text, or replace the entire file content.
Inputs: filePath (required), projectId (required), replacementContent (required), targetContent.
overleaf_list_filesC
Lists all files and folders in an Overleaf project.
Inputs: projectId (required).
overleaf_move_entityB
Moves a document, file, or folder to a new folder.
Inputs: path (required), projectId (required), newParentFolderPath (required).
overleaf_read_fileB
Reads the full contents of a file in an Overleaf project.
Inputs: filePath (required), projectId (required).
overleaf_upload_fileC
Uploads a file to a specific Overleaf project.
Inputs: filePath (required), projectId (required), folderId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct action: compilation, document creation, folder creation, project creation, deletion, editing, listing, moving, reading, and uploading. There is no overlap in functionality.
All tools follow a consistent 'overleaf_verb_noun' pattern (e.g., overleaf_create_doc, overleaf_list_files). The only minor variation is 'overleaf_compile_and_download' which combines two verbs, but it is still clearly patterned after the same prefix.
With 10 tools, the server covers project/file management (CRUD), editing, compilation, and uploads—appropriate for a LaTeX collaboration platform without being excessive or sparse.
The tool set provides core operations for managing and editing Overleaf projects. Missing a dedicated rename tool (though move could serve that purpose indirectly), but overall covers the main workflows (create, read, update, delete, compile).
Related MCP Connectors
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Create and improve live, shared interactive documents with your agent.
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
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.128 npm41MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, edit, and compile LaTeX documents in Overleaf projects with tracked changes via the Model Context Protocol.5MIT
- AlicenseAqualityCmaintenanceEnables AI agents to read, write, compile, and manage Overleaf projects through MCP, including file operations, project administration, and LaTeX compilation diagnostics.169 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to read, edit, upload, compile, and manage projects in a self-hosted Overleaf Community Edition via MCP, while also providing a git remote for cloning and pushing changes.1MIT