A minimal, auditable MCP server for editing Overleaf projects via Git
Project description
Overleaf MCP Server
A minimal, auditable MCP server for editing Overleaf projects from Claude.
What it is
A local Model Context Protocol server that gives Claude five tools for working with an Overleaf project: list_projects, list_files, read_file, edit_file, sync. Every change goes through Overleaf's per-project Git remote, so the round-trip is Claude → MCP server → git push → Overleaf web UI.
What it is not
- Not a replacement for Overleaf
- Not a hosted multi-user service — single researcher, single Claude session, stdio transport
- Not a LaTeX compiler — Overleaf still does the rendering
- No branch / merge / diff tooling — use git directly for that
- No real-time collaboration with humans editing in the Overleaf web UI at the same moment (use Overleaf's native real-time collab for that; the MCP server pulls before every write to stay honest, but doesn't subscribe to live updates)
If those constraints feel restrictive, that's deliberate — see the project notes for the design rationale.
Requirements
- Python 3.11 or newer
- A paid Overleaf account (Git integration is a paid feature)
- An Overleaf Git authentication token: Overleaf web UI → Account Settings → Git Integration → New token
giton yourPATHgit config user.nameandgit config user.emailset globally (the server signs commits with this identity)
Install
pipx install overleaf-mcp-server
or with uv:
uv tool install overleaf-mcp-server
Either gives you the overleaf-mcp command.
Quick start
# 1. Configure a project alias
overleaf-mcp init
# Project alias (short nickname): my-paper
# Overleaf project ID: 5f4a... # from the project URL on overleaf.com
# Display name (optional): My Paper
# 2. Store your Overleaf token in the OS keychain
overleaf-mcp auth add --project my-paper
# Overleaf token: **** # paste, hidden input
# 3. Clone the project locally (one-time)
git clone https://git.overleaf.com/<project_id> ~/.cache/overleaf-mcp/my-paper
# 4. Verify
overleaf-mcp doctor
doctor prints a clean pass/fail report. If everything is green you're ready to wire up Claude Desktop.
Claude Desktop configuration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:
{
"mcpServers": {
"overleaf": {
"command": "overleaf-mcp",
"args": ["serve"]
}
}
}
Fully quit and relaunch Claude Desktop (cmd-Q on macOS — closing the window isn't enough). In a new conversation, ask Claude something like "use overleaf list_projects" to verify.
Tools
| Tool | What it does |
|---|---|
list_projects |
Lists configured Overleaf project aliases |
list_files |
Lists files tracked in the project's git clone (optional extension filter) |
read_file |
Reads a file from the project |
edit_file |
Pulls latest, overwrites a file, commits, pushes to Overleaf |
sync |
Pulls latest from Overleaf into the local clone |
GitHub mirror (optional)
The MCP server only knows about your Overleaf remote. If you want a GitHub backup of a project, add it as a second remote on the local clone:
cd ~/.cache/overleaf-mcp/my-paper
git remote add github git@github.com:you/my-paper-mirror.git
git push github main
Then git push github main whenever you want to update the mirror, or wire up a cron / launchd job. The MCP server intentionally doesn't manage GitHub — that boundary keeps the server's surface small and the mirror under your control.
Security
- Tokens are stored in the OS keychain (
keyringlibrary — macOS Keychain, Windows Credential Manager, libsecret on Linux). Never on disk. - The config file (
~/.config/overleaf-mcp/config.toml) contains aliases and project IDs only — no secrets. Safe to put under version control if you really want to. - Subprocess git invocations pass tokens via env vars consumed by a transient
GIT_ASKPASSscript. Tokens never appear on the subprocess command line, so they don't show inps. - The server only talks to
git.overleaf.comand the local filesystem. No telemetry, no analytics, no other network traffic.
Limitations
- Regex section parser. Handles
\section,\subsection,\subsubsection(and starred variants) at the start of a line. Doesn't follow\input{}/\include{}across files, doesn't expand custom section macros, and doesn't parse titles with nested{}groups. Swap-in of apylatexenc-backed parser is staged behind the abstract base class for a future minor release. - Single-user assumption. No locks, no concurrent-edit detection beyond
git pull --ff-only(which fails fast if the local clone has diverged). Real-time collaboration with humans editing in the Overleaf web UI works because the server pulls before every write, but it's not a streaming sync. - stdio transport only in v0.1. HTTP/SSE for remote / multi-client setups is staged for v0.2.
- No clone orchestration.
doctorreports if the local clone is missing and prints thegit clonecommand; the MCP server itself doesn't create or refresh the cache. Plain git is the right tool there.
Contributing
Bug reports and PRs welcome. See CLAUDE.md for project-local design notes if you're working on the server itself.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file overleaf_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: overleaf_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 82.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aa2a04cf86f0f93453bb0ff4b0c563aae58fdd8b8a4aa385fedcb19a84a5dc5
|
|
| MD5 |
4d1248451360db2abb29a00fb86cf302
|
|
| BLAKE2b-256 |
15171f46afc6755dbfd18d3bb0ef05b5c6a359957ad3fe5628c3c0dba09a84f4
|
Provenance
The following attestation bundles were made for overleaf_mcp_server-0.1.0.tar.gz:
Publisher:
release.yml on amcheste/overleaf-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overleaf_mcp_server-0.1.0.tar.gz -
Subject digest:
4aa2a04cf86f0f93453bb0ff4b0c563aae58fdd8b8a4aa385fedcb19a84a5dc5 - Sigstore transparency entry: 1383859467
- Sigstore integration time:
-
Permalink:
amcheste/overleaf-mcp@d0e1cbc13b61d2287f9a955a9ea43e79b4be2234 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/amcheste
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0e1cbc13b61d2287f9a955a9ea43e79b4be2234 -
Trigger Event:
push
-
Statement type:
File details
Details for the file overleaf_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: overleaf_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69445e2fcdcded76e1d93b7039522058c0afab47fa311034f8d536f4a08e1be3
|
|
| MD5 |
9a63c43e44eb277753b6a98d60882a4b
|
|
| BLAKE2b-256 |
abe969ead4c32f4dfafe0d8cc2a52e7a3e011515231b631d407bdc8ff4c00b5d
|
Provenance
The following attestation bundles were made for overleaf_mcp_server-0.1.0-py3-none-any.whl:
Publisher:
release.yml on amcheste/overleaf-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overleaf_mcp_server-0.1.0-py3-none-any.whl -
Subject digest:
69445e2fcdcded76e1d93b7039522058c0afab47fa311034f8d536f4a08e1be3 - Sigstore transparency entry: 1383859508
- Sigstore integration time:
-
Permalink:
amcheste/overleaf-mcp@d0e1cbc13b61d2287f9a955a9ea43e79b4be2234 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/amcheste
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0e1cbc13b61d2287f9a955a9ea43e79b4be2234 -
Trigger Event:
push
-
Statement type: