overleaf-mcp
Provides an MCP bridge for Overleaf, enabling interaction with projects on an Overleaf instance via its web API using the configured account's permissions. Targets self-hosted Overleaf Community Edition.
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., "@overleaf-mcpshow me the files in my thesis 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 MCP Bridge
MCP bridge for Overleaf that uses its web API directly. Targets self-hosted Overleaf Community Edition and CEP-only features. Not guaranteed to work with the official Overleaf SaaS or Server Pro, as the author has no paid account to verify against.
Install
From Source Code
This project is a Python package, requiring Python 3.12 or newer. Install it with uv:
git clone https://github.com/Firefox2100/overleaf-mcp.git
cd overleaf-mcp
uv syncFrom a Container Image
A prebuilt image is published to GitHub Container Registry on every push to main:
docker pull ghcr.io/firefox2100/overleaf-mcp:latestOr with Compose, using the provided compose.yaml (defaults to streamable HTTP on port 8000):
cp example.env .env
docker compose up -dSet the environment variables in the .env file before starting. See Configuration below.
Related MCP server: Google Calendar MCP OAuth Proxy
Configuration
Settings are read from the enviornment, in this order of precedence:
environment variables in the shell
an
.envfile (or the file named byOMCP_ENV_FILE)Docker secrets under
/run/secrets
Setting | Env var | Docker secret file | Required | Default |
Overleaf account email |
|
| yes | — |
Overleaf account password |
|
| yes | — |
Overleaf base URL |
|
| no |
|
Example .env:
OMCP_OVERLEAF_BASE_URL=https://overleaf.example.com
OMCP_OVERLEAF_EMAIL=service@example.com
OMCP_OVERLEAF_PASSWORD=...The account used should have its own credentials and only the access it needs — this bridge logs in as that account and acts with its permissions. Giving it a personal account with full access to all projects, or admin access, is not recommended as the MCP client would be able to perform much more destructive actions than perhaps intended.
Running
stdio
uv run overleaf-mcpEquivalently, as a module: uv run python -m overleaf_mcp.
By default, this speaks MCP over stdio, so it's meant to be launched by an MCP client (not run standalone). On startup, it logs in to Overleaf immediately and fails fast if that doesn't work — nothing is served on a broken session. After a successful login, the environment variables for email and password are not needed, and can be removed for the next run. The bridge will keep using the same session when possible.
To wire it into an MCP client, point the client at the overleaf-mcp command with the environment variables set, e.g. for a client that reads a JSON config with a mcpServers map:
{
"mcpServers": {
"overleaf": {
"command": "overleaf-mcp",
"env": {
"OMCP_OVERLEAF_BASE_URL": "https://overleaf.example.com",
"OMCP_OVERLEAF_EMAIL": "service@example.com",
"OMCP_OVERLEAF_PASSWORD": "..."
}
}
}
}If overleaf-mcp isn't on the client's PATH, point command at uv --directory /path/to/overleaf-mcp run overleaf-mcp instead.
Streamable HTTP
Pass --http to serve over streamable HTTP instead of stdio — useful when running the bridge as a standalone service (e.g. in a container) or with other proxy clients like LiteLLM rather than spawning it per-client:
uv run overleaf-mcp --http --host 0.0.0.0 --port 8000--host and --port are ignored for the default stdio transport. Point an HTTP-capable MCP client at http://<host>:<port>/mcp.
Tools
Tools are grouped into namespaces, each mounted as its own set of <namespace>_<tool> MCP tools. A namespace with CEP-specific tools is only mounted when the connected server is probed at startup and found to actually support that feature — a plain Overleaf CE server never exposes it, so clients don't need to know or care which kind of server they're talking to.
Namespace | Always mounted | Purpose |
| yes | Replace an expired or invalid session by clearing it and signing in again, attempting remote logout first. |
| yes | List, fetch, create, delete, and clone projects; download a project as a zip; list collaborators. |
| yes | Read, list, create, rename, move, overwrite, patch, and delete files; create/refresh linked files (e.g. imported from a URL, or Zotero-linked |
| yes | Trigger a compile (draft or full), fetch compile logs/errors, download an output file, and get a word count. |
| yes | Search across a project or within a file (plain or regex), outline a file's structure, and read a specific line range. |
| yes | Read/update project config: compiler, root document, main bibliography, spell-check language, and (on CEP) the sandboxed-compile TeX Live image. |
| yes | List |
| yes | List project history, diff a file between versions, restore a file to a prior version, and manage history labels. |
| only if the server supports review mode (CEP) | Track changes (enable/disable, tracked edits, accept/reject) and comment threads (create, reply, resolve, reopen, delete). |
| only if | Read GitHub sync state and trigger a sync. Linking/unlinking a repository stays a web-UI action, out of scope here. |
| only if | Export a whole project to |
Every project operation uses the current authenticated session. If it expires, auth_refresh_authentication replaces it using the server's configured credentials without exposing credentials, cookies, or CSRF tokens to the client.
Each tool's docstring documents its own parameters and behavior in detail. For the concepts that span multiple tools — the project_id/path conventions, read-before-write safety, and typical multi-step workflows (editing, compiling, citations, review, history) — see skill/SKILL.md. It's written as a portable Claude skill: drop the skill folder into an MCP client's skills directory (e.g. .claude/skills/overleaf-mcp for Claude Code) to give it that context automatically.
This server cannot be deployed
Maintenance
Related MCP Connectors
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Hosted OAuth MCP at https://www.taskade.com/mcp, or local @taskade/mcp-server.
Connect AI agents to Filepad workspaces through OAuth MCP.
Related MCP Servers
FlicenseNot gradedqualityCmaintenanceEnables external MCP clients to execute Mittwald CLI commands on behalf of users via stateless OAuth authentication.3-- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to authenticate with Google OAuth and securely access Google Calendar's official MCP server without exposing the Google client secret.MIT
- FlicenseNot gradedqualityBmaintenanceEnables an MCP server with OAuth authentication, protecting tools like user CRUD operations behind session tokens obtained through a browser-based authentication flow.-
- AlicenseNot gradedqualityBmaintenanceEnables remote MCP connections with Google OAuth authentication, allowing secure access to MCP tools and resources.1MIT