overleaf-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OL_CSRF | No | Force a specific CSRF token. Only needed if your server doesn't ship the ol-csrfToken meta tag. | |
| OL_BROWSER | No | Path to a Chromium-family browser if auto-detection fails (Chrome / Brave / Edge / Arc / Chromium). | |
| OL_BASE_URL | No | Override for self-hosted Overleaf. | https://www.overleaf.com |
| OL_INSECURE | No | Set to '1' to pass --ignore-certificate-errors to the captured Chrome instance — for self-hosted CE with a self-signed cert. | |
| OL_MCP_LOG_LEVEL | No | debug, info, warn, error. Goes to stderr; stdout is reserved for MCP JSON-RPC. | info |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Overleaf MCP server. Operates on .tex files via Overleaf's Socket.IO web API (not the Git bridge), so edits land in real time and respect tracked-changes mode.
Every project tool accepts an optional project_id. When MCP sessions may change between calls (e.g. behind an HTTP gateway), pass it on every call; the tool opens the project when needed. A read with a different project_id switches the active project but never retargets writes: a write without project_id is refused unless it goes to the project last confirmed by open_project or by a write naming it.
Typical flow:
list_projects -> pick an id
open_project(id) -> joins the Socket.IO room, returns file tree + tc state
read_file / edit_file by path (e.g. 'chapters/intro.tex')
compile to verify edits build
Review workflow: open_project reports track_changes_on_for_me; set_track_changes turns the Review panel's 'Track changes' switch on or off. add_comment anchors a new comment thread on existing text without editing it; reply_comment, resolve_comment and delete_comment manage threads. search_project finds text across all docs.
Files: create_project, create_doc, create_folder, upload_file, rename_entity, move_entity, delete_entity. History: list_history, then diff_file between two versions. After compile, label_pages gives the PDF page of every \label.
Auth UX (important for the user-facing message): If no session cookie is stored yet, or the previous one has expired (Overleaf cookies last ~5 days), the next tool call will spawn an isolated Chrome window pointed at Overleaf so the user can log in. The window uses a dedicated profile that does NOT share the user's main browser data, saved passwords, or any password-manager extension — they must type their Overleaf credentials (or click their SSO provider) manually. The window then closes automatically. Before triggering an Overleaf tool call when you don't already know the user is authenticated, briefly warn them: "a Chrome window may pop up asking you to log in — type your credentials there, it's a clean isolated profile."
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pingA | Health check. Returns 'pong' and the server version. Does not contact Overleaf. |
| list_projectsA | Lists projects on the configured Overleaf account, sorted by most recently updated. Returns each project's id, name, last update time, and owner. Use the returned id with |
| open_projectA | Joins the project's real-time Socket.IO session and caches its file tree. Must be called before list_files / read_file / edit_file. Switching projects automatically closes the previous session. |
| list_filesA | Returns the file tree of the currently open project as a flat list of project-relative paths. Uses the cached file tree when the requested project is already active; otherwise project_id opens it first. Each entity has a path (e.g. 'chapters/intro.tex'), an id, and a kind ('doc' | 'file' | 'folder'). |
| read_fileA | Reads the contents of a file by project-relative path. Pass project_id to read without a prior open_project in this session. For text docs (.tex, .bib, .md, etc.) the full text appears in both the |
| edit_fileA | Replaces the contents of a doc by computing a minimal diff and submitting it as an OT operation over the live Socket.IO connection. The change lands in the web editor in real time. By default the edit appears as a pending suggestion in the Review panel (track:'on'); pass track:'off' to write directly. If |
| find_and_replaceA | Replace one occurrence — or all, with |
| compileA | Triggers a LaTeX compile on Overleaf's CLSI, then fetches |
| read_logA | Returns the full LaTeX log from the most recent |
| label_pagesA | Reads the |
| list_commentsA | Returns all review-panel comment threads in the open project, sorted by most recently updated. Each entry includes the thread id, the doc path it's anchored on, the quoted text it refers to, the latest message preview, and whether it's resolved. Use |
| read_comment_threadA | Fetches the full message history of one thread (all replies with author + timestamp). Use this when |
| reply_commentA | Adds a new message to an existing comment thread. Threads come from |
| resolve_commentA | Marks a thread as resolved. Use after addressing the comment (e.g. by editing the doc and replying). Also works for orphaned threads. Pass |
| reopen_commentB | Reopens a previously-resolved thread. Pass |
| add_commentA | Starts a new comment thread anchored to |
| delete_commentA | Permanently deletes a comment thread and all its messages (Overleaf's 'Delete' in the thread menu). Cannot be undone; prefer resolve_comment unless the thread should disappear entirely. Also works for orphaned threads (see list_comments). |
| edit_comment_messageA | Replaces the text of one message in a thread. Overleaf only allows editing your own messages. |
| delete_comment_messageA | Deletes one message (e.g. a reply) from a thread, leaving the rest of the thread. Own messages by default; |
| list_tracked_changesA | Enumerates every pending tracked-change suggestion in the open project (across all docs), with author name + email, doc path, op kind ('insert' | 'delete'), position, inserted/deleted text, and a stable change_id. Use this to plan an |
| accept_changesA | Permanently accepts tracked-change suggestions. The text stays in the doc; the pending-change metadata is cleared. Select changes either by |
| reject_changesA | Rejects the specified tracked-change suggestions. For tracked inserts the inserted text is removed; for tracked deletes the strikethrough is cleared and the text stays. Implemented as an OT update with |
| set_track_changesA | Turns Overleaf's 'Track changes' mode on or off for the logged-in user only, the same switch as in the Review panel. Other collaborators' and guests' settings are left as they are. While it is on for you, the server records every edit you make (including |
| search_projectA | Searches every text doc in the project (like Overleaf's 'Search in project') and returns matches with path, line and column. Use it to find where a term, label, citation key or phrase appears before editing. |
| create_projectA | Creates a new project owned by the logged-in user and returns its id. Open it with open_project. |
| create_docA | Creates a new .tex/.bib/... doc at |
| create_folderB | Creates a folder (and any missing parents) at |
| upload_fileA | Uploads a file from the local disk ( |
| rename_entityA | Renames the entity at |
| move_entityB | Moves the entity at |
| delete_entityB | Deletes the entity at |
| list_historyA | Lists recent versions from the project's History view, newest first: version range, time, authors, files touched, file additions/renames/removals and named labels. Use the versions with diff_file to see what changed. |
| diff_fileA | Shows what changed in one file between two versions from list_history. Changed lines are marked with |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 33 tools
Tools are grouped by clear resource domains (files, comments, tracked changes, history, compile) and the descriptions explicitly separate the closest pairs — edit_file vs find_and_replace, add_comment vs reply_comment, delete_comment vs delete_comment_message — including 'USE WHEN' / 'AVOID FOR' guidance. A couple of pairs (compile/read_log/label_pages, and the comment-message vs thread deletion tools) still require reading the descriptions carefully, but there is no true duplication.
Almost everything follows a snake_case verb_noun pattern (open_project, list_comments, resolve_comment, create_doc, delete_entity), which is easy to predict. Minor deviations exist: bare verbs (compile, ping) and a reversed noun_verb form (diff_file), plus label_pages, but these are few and readable.
33 tools is heavy for a single MCP server, even though the domain genuinely spans projects, files, editing, compile, comments, tracked changes and history. Each cluster is coherent, but the surface is large enough that an agent must navigate eight distinct sub-areas; a few tools (reopen_comment, delete_comment_message, label_pages) are edge operations that could be folded into siblings.
Coverage is strong: full file lifecycle (create/read/edit/upload/rename/move/delete), full comment thread CRUD plus per-message editing, and complete tracked-change list/accept/reject/mode. Gaps are modest — no project delete/rename, no PDF download or version restore in history, and no collaborator management — all of which agents can work around via the web editor.