OverleafMCP
Provides tools for interacting with Overleaf projects: listing and resolving projects by title or URL, creating new projects from local folders or .zip archives, uploading .tex files, binary figures, and nested folders, syncing via Overleaf's Git Bridge, and triggering remote PDF compiles with structured output.log parsing for LaTeX error diagnostics. Works with both Free and Paid Overleaf accounts as well as self-hosted Overleaf CE / Server Pro instances.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
OverleafMCP
Autonomous Overleaf Workflows for AI Coding Agents
Create Overleaf projects from local folders, upload .tex papers & figures, sync via Git Bridge, and run self-healing remote PDF builds — on both Free and Paid Overleaf accounts.
⚡ 30-Sec Install · 🔐 Auth Picker · 📋 Copy-Paste Prompts · 🧠 How It Works · 🧰 13 Tools · ❓ FAQ
✨ Why OverleafMCP?
Overleaf has no public REST API, and community Git-only MCP servers break on Free Overleaf accounts, cannot list your projects automatically, cannot create new projects, and cannot compile PDFs or read LaTeX error logs.
OverleafMCP unifies Web Session and Git Bridge under a single 13-tool MCP server:
Capability | Manual Browser | Git-Only MCPs | 🍃 OverleafMCP (Hybrid) |
Works on Free Overleaf accounts | ✅ | ❌ (Paid only) | ✅ Yes (Browser / Cookie) |
Works with Permanent Git Tokens ( | ❌ | ✅ | ✅ Yes (Transient Basic Auth) |
Auto-discover & resolve projects by Title or URL | Manual | ❌ (Hardcoded IDs) | ✅ |
Bootstrap brand-new project from local folder / | Drag & drop | ❌ | ✅ |
Upload binary figures ( | Manual | ❌ (Text only) | ✅ |
Remote PDF Compile + Structured | Manual click | ❌ | ✅ |
Self-hosted Overleaf CE / Institutional Server Pro | ✅ | Partial | ✅ Custom |
Related MCP server: overleaf-mcp-server
⚡ 30-Second Install (Choose Your Agent)
One-time prerequisite: Install uv (brew install uv on macOS, or curl -LsSf https://astral.sh/uv/install.sh | sh) so uvx runs overleaf-mcp directly from GitHub with zero manual cloning.
Click your AI coding tool below to expand copy-ready instructions:
Option A — One-liner terminal command:
codex mcp add overleaf -- uvx --from git+https://github.com/ajmainapon/OverleafMCP overleaf-mcpOption B — Add to ~/.codex/config.toml (Codex uses TOML, not JSON):
[mcp_servers.overleaf]
command = "uvx"
args = ["--from", "git+https://github.com/ajmainapon/OverleafMCP", "overleaf-mcp"]
startup_timeout_sec = 30.0
# Optional: pass credentials via env instead of configuring in chat
# [mcp_servers.overleaf.env]
# OVERLEAF_COOKIE = "overleaf_session2=s%3A..."
# OVERLEAF_GIT_TOKEN = "olp_..."Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"overleaf": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ajmainapon/OverleafMCP",
"overleaf-mcp"
]
}
}
}claude mcp add overleaf -- uvx --from git+https://github.com/ajmainapon/OverleafMCP overleaf-mcpOpen your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"overleaf": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ajmainapon/OverleafMCP",
"overleaf-mcp"
]
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project workspace):
{
"mcpServers": {
"overleaf": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ajmainapon/OverleafMCP",
"overleaf-mcp"
]
}
}
}Create .vscode/mcp.json in your workspace:
{
"servers": {
"overleaf": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ajmainapon/OverleafMCP",
"overleaf-mcp"
]
}
}
}git clone https://github.com/ajmainapon/OverleafMCP.git
cd OverleafMCP
uv syncPoint your MCP client's command directly to /absolute/path/to/OverleafMCP/.venv/bin/overleaf-mcp with empty args: [].
🔐 Connect Your Overleaf Account
Not sure which auth mode to pick? Use this quick guide:
Using Chrome or Firefox on Free/Paid Overleaf? -> Expand Mode A (zero copy-paste!)
Using Safari, Arc, Brave, or a remote Linux server? -> Expand Mode B (paste
overleaf_session2)Have Overleaf Paid / Student / Institutional plan? -> Add Mode C (permanent
olp_...Git token)
Sign into overleaf.com in Chrome or Firefox.
Send this prompt to your agent:
Check my Overleaf authentication status and list my projects.(macOS first-run) Click Always Allow if Keychain asks permission to read your browser cookie.
Open overleaf.com -> open DevTools (
Cmd+Option+IorF12).Navigate to Application (or Storage) -> Cookies ->
https://www.overleaf.com.Copy the value of
overleaf_session2(begins withs%3A...).Paste it directly to your agent in chat:
Save my Overleaf cookie: s%3A...(Saved locally with
0600user-only permissions at~/.config/overleaf-mcp/credentials.json.)
Open Overleaf Account Settings -> Git Integration -> Create Token.
Tell your agent:
Save my Overleaf Git token: olp_...
All environment variables override ~/.config/overleaf-mcp/credentials.json when set:
Variable | Default | Description |
| (Browser auto-load) |
|
|
| Overleaf Git Bridge token ( |
|
| Overleaf web domain (set to your self-hosted domain for Overleaf CE/Pro). |
|
| Overleaf Git host (auto-derived from |
|
| Directory storing |
|
| Cache directory for Git Bridge checkouts. |
📋 Copy-Paste Prompt Playbook
Click the copy icon in the top-right corner of any prompt below and drop it straight into your agent:
Create a new Overleaf project called "NeurIPS 2027 Submission" from ./paper, compile it on Overleaf, and download the compiled PDF to ./neurips_draft.pdf.Upload my local sections/ folder to my Overleaf project "NeurIPS 2027 Submission", run overleaf_compile, inspect any errors or undefined citations in diagnostics, fix them in the .tex files, and re-compile until there are 0 errors.Upload all PDFs and PNGs inside ./experiments/plots to the figures/ folder of https://www.overleaf.com/project/<YOUR_PROJECT_ID> and recompile the paper.Pull the latest files from my Overleaf project "NeurIPS 2027 Submission" into ./paper-latest and summarize what changed in main.tex.🧠 Architecture & Self-Healing Compile Loop
flowchart LR
subgraph Agents["🤖 AI Coding Clients"]
A1["OpenAI Codex"]
A2["Google Antigravity"]
A3["Claude Code / Desktop"]
A4["Cursor / VS Code"]
end
MCP["🍃 OverleafMCP<br/>(13 Stdio Tools)"]
subgraph Engines["⚡ Hybrid Transport Layer"]
W["🍪 Web Session Client<br/>• Free & Paid Accounts<br/>• CSRF + Socket.IO<br/>• Create / Upload / Compile"]
G["🌿 Git Bridge Client<br/>• Paid & Institutional<br/>• Transient HTTP Basic Auth<br/>• Clone / Diff / Rebase / Push"]
end
OL[("📄 Overleaf Cloud<br/>& Self-Hosted")]
Agents <-->|"JSON-RPC (stdio)"| MCP
MCP --> W
MCP --> G
W <-->|"HTTPS + WSS"| OL
G <-->|"Git Smart HTTP"| OLsequenceDiagram
actor User as Researcher
participant Agent as AI Agent
participant MCP as OverleafMCP
participant OL as Overleaf CLSI Compiler
User->>Agent: "Upload method.tex, compile, and fix any LaTeX errors"
Agent->>MCP: overleaf_upload_file("method.tex")
MCP->>OL: POST /project/{id}/upload (CSRF)
Agent->>MCP: overleaf_compile(project)
MCP->>OL: POST /project/{id}/compile
OL-->>MCP: status="failure" + output.log URL
MCP->>OL: GET output.log
MCP-->>Agent: diagnostics.errors: ["! Undefined control sequence l.84"]
Agent->>MCP: overleaf_write_file("method.tex", patched_tex)
Agent->>MCP: overleaf_compile(project, save_pdf_path="./paper.pdf")
MCP->>OL: POST /project/{id}/compile + GET output.pdf
MCP-->>Agent: status="success", error_count=0, saved "./paper.pdf"
Agent-->>User: "Fixed macro typo on line 84 — compiled PDF saved!"🧰 Complete Tool Explorer (13 Tools)
Every project tool accepts a 24-character Project ID, a full Overleaf project URL, or an exact Project Title.
Tool | Key Parameters | Auth | Description |
|
| Both | Verifies Web Session & Git Token validity and counts accessible projects. |
|
| Both | Writes credentials/hosts to |
|
| Web | Lists projects with |
Tool | Key Parameters | Auth | Description |
|
| Web | Creates blank/example project or auto-zips & uploads a local directory/ |
|
| Web | Uploads any text or binary file ( |
|
| Hybrid | Uploads a directory tree via Web API ( |
|
| Web | Creates or overwrites a UTF-8 file directly in Overleaf from memory. |
|
| Web | Deletes a remote file or directory inside a project. |
Tool | Key Parameters | Auth | Description |
|
| Web | Lists the full hierarchical tree of folders, |
|
| Web | Reads |
|
| Hybrid | Downloads & extracts an entire Overleaf project via |
|
| Web | Runs Overleaf's remote LaTeX compiler, parses errors/warnings from |
|
| Git | Direct Git Bridge operations with automatic |
🛡️ Security & Reliability Highlights
Bothoverleaf_session2 cookies and olp_... Git tokens grant read/write access to your Overleaf projects — never commit them to version control.
User-Only
0600Credential Vault:overleaf_configure_authstores secrets at~/.config/overleaf-mcp/credentials.json(chmod 600).Zero Plaintext Tokens in
.git/config: Git Bridge calls inject transientgit -c http.extraHeader="Authorization: Basic ..."headers per invocation and scrub tokens from error output.Deterministic WebSocket Cleanup: Fixes
pyoverleaf's Socket.IO connection leak by guaranteeingsocket.close()insidefinallyblocks across long multi-step sessions.Strict Stdio Isolation: Browser keyring/cookie loaders redirect
stdout -> stderrso third-party warnings never corrupt JSON-RPC framing in strict clients like Codex.Zip-Slip Traversal Defense: Archive extraction enforces
Path.is_relative_to()containment against..and sibling-prefix attacks.
❓ Interactive Troubleshooting FAQ
Overleaf browser session cookies (overleaf_session2) expire periodically or when you sign out. Open overleaf.com in Chrome/Firefox to refresh your login, or paste a fresh overleaf_session2 cookie in chat (Save my Overleaf cookie: s%3A...).
On the first uvx invocation, uv resolves and caches dependencies (~5–10s). Set startup_timeout_sec = 30.0 under [mcp_servers.overleaf] in ~/.codex/config.toml (subsequent launches take ~150ms), or run from a local clone .venv/bin/overleaf-mcp.
Overleaf restricts git.overleaf.com to Paid, Student/Institutional, and Server Pro plans. On a Free account, use overleaf_create_project, overleaf_upload_file, overleaf_upload_folder(..., method="web"), overleaf_pull_project(..., method="zip"), and overleaf_compile — all of which work on Free accounts!
Overleaf's .zip project importer rejects archives without a .tex root file (HTTP 422). overleaf_create_project automatically catches this and falls back to creating a blank project and uploading your directory tree file-by-file!
🧪 Local Development & CI Tests
git clone https://github.com/ajmainapon/OverleafMCP.git
cd OverleafMCP
uv sync
uv run python tests/test_server.pyReleased under the MIT License · Built by Ajmain Istiak Apon
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
A hosted LaTeX editor your assistant can actually use. Search 1,019 free templates, create and edit projects, and compile them to PDF on a real TeX Live farm, getting back the PDF or the compile log when a build fails. Thirteen tools behind OAuth 2.1, with nothing to install and nothing to run locally.
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables 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.101-
- AlicenseAqualityCmaintenanceEnables AI agents to read, write, compile, and manage Overleaf projects through MCP, including file operations, project administration, and LaTeX compilation diagnostics.16MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to read, write, compile, and download LaTeX projects on a self-hosted Overleaf instance.1MIT
- 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