
overleaf-git-mcp
by Junfei-Z
Overleaf Git MCP
<p align="center"> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=node.js&logoColor=white" alt="Node.js >= 18"></a> <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-Compatible-0A84FF" alt="MCP compatible"></a> <a href="https://developers.openai.com/codex/mcp"><img src="https://img.shields.io/badge/Codex-CLI%20%7C%20IDE-111111?logo=openai&logoColor=white" alt="Codex CLI and IDE"></a> <a href="https://claude.ai/"><img src="https://img.shields.io/badge/Claude-Code%20%7C%20Desktop-D97706?logo=anthropic&logoColor=white" alt="Claude Code and Desktop"></a> <a href="https://www.overleaf.com/"><img src="https://img.shields.io/badge/Overleaf-Git%20Bridge-47A141?logo=overleaf&logoColor=white" alt="Overleaf Git Bridge"></a> <a href="https://github.com/Junfei-Z/overleaf-git-mcp/releases"><img src="https://img.shields.io/badge/version-1.1.0-blueviolet" alt="Version 1.1.0"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License"></a> <a href="https://github.com/Junfei-Z/overleaf-git-mcp/stargazers"><img src="https://img.shields.io/github/stars/Junfei-Z/overleaf-git-mcp?style=social" alt="GitHub stars"></a> </p>A model-agnostic MCP server for token-efficient reading, editing, and synchronization of Overleaf LaTeX projects through Git.
Overleaf Git MCP connects Codex, Claude Code, Claude Desktop, and other MCP clients that support local STDIO servers to your Overleaf projects.
It is designed for real research-writing workflows in which LaTeX projects are large, edits are usually local, and repeatedly transferring an entire file wastes context and tokens. The server provides targeted patching, sparse checkout, diff-based re-reading, section-aware access, and explicit Git push operations.
Key capabilities
- Read project files and inspect LaTeX section structure.
- Apply targeted edits without rewriting complete files.
- Commit and push changes back to Overleaf through its Git bridge.
- Skip figures and other binary assets during synchronization.
- Return only changed content on repeated reads when smart diff mode is enabled.
- Manage multiple Overleaf projects from one local MCP server.
- Keep write operations local until an explicit
push_changescall.
Why use this MCP server?
A thesis or long paper can contain an 80–100 KB main.tex file, which may correspond to roughly 35K tokens. A naive agent workflow may repeatedly read or rewrite that entire file even when only one sentence changes.
The examples below illustrate the intended efficiency gains:
| Scenario | Naive workflow | Overleaf Git MCP | Expected effect |
|---|---|---|---|
| Read a 35K-token file twice | 70K tokens | First read + subsequent diff | About 50% less repeated content |
| Replace a 50-word sentence | Rewrite the full file | About 100–200 tokens with patch_file | More than 99% less generated text |
| Clone a figure-heavy project | Download all assets | Download supported text files only | Lower bandwidth and faster setup |
| Revisit the same file in one session | Return the full file each time | Return only detected changes | Stable context usage |
These figures are illustrative and depend on the project structure, client behavior, and requested edit.
What is new in v1.1.0?
Sparse checkout
Only supported text files are synchronized:
.tex.bib.bst.cls.sty.bbl.cfg
Images, PDFs, and other binary assets are skipped. This keeps clone and pull operations lightweight for projects with many figures.
Read/write separation
- Read operations pull the latest state from Overleaf.
- Write operations modify the local working copy without automatically pulling.
push_changespulls before committing and pushing, reducing the risk of overwriting remote work.
Smart diff mode
After the first read_file call, subsequent reads
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access