overleaf-mcp
Enables integration with GitHub repositories linked to Overleaf projects, allowing users to check sync status, push Overleaf content as a commit, and pull the repository's default branch into Overleaf.
Provides tools for managing Overleaf projects, including listing and creating projects, reading and writing .tex/.bib files, compiling documents, reading LaTeX logs, and downloading PDFs.
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.
overleaf-mcp
Let your coding agent (Claude Code, Cursor, Codex CLI, Windsurf, Claude
Desktop, …) work on your Overleaf projects: list projects, read and write
.tex/.bib files, compile, read the LaTeX log, download the PDF.
Built for our team Overleaf at overleaf.yihome.org (API at
https://github.yihome.org/api/v1, used by default). Works with any
self-hosted Overleaf running the
overleaf-selfhost companion
API — set OVERLEAF_API_URL to point elsewhere. (overleaf.com has no such API.)
Using an AI coding agent? Paste this repo's URL to it and say "install this MCP server". The agent should follow
llms-install.md, which contains everything it needs.
What you need
An API key — sign in at https://github.yihome.org with your Overleaf account → API keys → Create key. Copy it once; it's shown only once. Tip: create a separate Overleaf account for your AI and share only the projects it should touch, then make the key from that account.
(Only for other deployments) the API URL, shaped like
https://github.<domain>/api/v1, passed asOVERLEAF_API_URL.
Related MCP server: Unofficial Overleaf MCP Server
Install (one command per client)
No clone, no build — npx fetches and runs it straight from GitHub.
Claude Code
claude mcp add overleaf -s user -e OVERLEAF_API_KEY=olk_... -- npx -y github:yidong72/overleaf-mcpCodex CLI (~/.codex/config.toml)
[mcp_servers.overleaf]
command = "npx"
args = ["-y", "github:yidong72/overleaf-mcp"]
env = { OVERLEAF_API_KEY = "olk_..." }Cursor (.cursor/mcp.json in the project, or ~/.cursor/mcp.json) /
Windsurf (~/.codeium/windsurf/mcp_config.json) /
Claude Desktop (claude_desktop_config.json) — same JSON shape:
{
"mcpServers": {
"overleaf": {
"command": "npx",
"args": ["-y", "github:yidong72/overleaf-mcp"],
"env": { "OVERLEAF_API_KEY": "olk_..." }
}
}
}Verify (any shell):
OVERLEAF_API_KEY=olk_... npx -y github:yidong72/overleaf-mcp --check
# → OK: connected to ... as you@example.com (key "..."); 3 project(s) visibleTools
tool | what it does |
| projects you can access (id, name, access) |
| new blank project |
| delete a project you own (only on explicit user request; name must match) |
| all files with sizes |
| file contents |
| atomic multi-file write for small hand edits (whole-file contents; |
| bulk upload from local disk — text or binary, any size; content never passes through the model (use for .bib, figures, large .tex) |
| download a project file to disk without passing it through the model |
| delete |
| compile; returns status + log tail |
| compile if needed, save the PDF locally |
| is the project linked to a GitHub repo; commits to pull / changes to push |
| push Overleaf content to the linked GitHub repo as one commit |
| pull the repo's default branch into Overleaf |
| connect a project to GitHub: create a new repo (and push) or link an existing one (project owner only) |
| disconnect (repo untouched) |
Typical agent loop: list_projects → read_file main.tex → write_files (small edits) or
upload_files (whole files from disk) → compile (read the log on failure, fix, repeat) →
download_pdf → optionally github_push.
Speed note: write_files makes the model generate the file as tokens (a 200 KB .bib ≈ 50K
tokens). upload_files reads the bytes locally and sends them straight to the API, so large
or binary files transfer in seconds.
The GitHub tools need the user to have linked their GitHub account and the project to a repository once in the sync web UI (the same place API keys are made); until then they return a 409 explaining what to do.
Notes
Writes are whole-file replacements applied atomically; Overleaf users editing the same file in the browser see a "changed externally" notice.
The API acts with exactly the permissions of the account that made the key.
The full REST API this wraps is documented at
https://<your api host>/api/v1/docsand, for agents,/api/v1/llms.txt.Requires Node.js ≥ 18 (for
fetchandnpx).Different Overleaf deployment? Add
-e OVERLEAF_API_URL=https://github.<domain>/api/v1(or the same key in the JSONenv).
License
MIT
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.
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.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
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
- 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-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, edit, and compile LaTeX documents in Overleaf projects with tracked changes via the Model Context Protocol.5MIT
- FlicenseAqualityBmaintenanceEnables agents to create, duplicate, read, write, and edit Overleaf projects, compile them, and download the resulting PDFs using a session cookie.11-