# overleaf-mcp-server

Connects coding agents to Overleaf projects through Git synchronization. It lets you inspect, update, and commit LaTeX files right from your chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 64
- Author: YounesBensafia
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/YounesBensafia/overleaf-mcp-server
- Updated: 2026-10-11
- HTML: https://affpapa.org/en/nevibecode/mcp/overleaf-mcp-server

## What it does

The server maintains a local Git mirror of the specified Overleaf workspace. When an agent calls a tool, the server synchronizes the clone, reads contents, and pushes edits back with a fresh commit. Line pagination helps examine lengthy documents in slices.

Running this server requires Python 3.13+ alongside the `uv` tool. Your Overleaf tier must also include Git integration. Without Git access enabled in your Overleaf account settings, operations fail with a 403 error. Credentials are supplied via `OVERLEAF_TOKEN` and `PROJECT_ID` environment variables.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add overleaf-mcp-server -- uvx overleaf-mcp-integration
```
uvx runs the command named after the package; if the README names another one, use uvx --from overleaf-mcp-integration <command>

### Codex

**Platform CLI**
```bash
codex mcp add overleaf-mcp-server -- uvx overleaf-mcp-integration
```
uvx runs the command named after the package; if the README names another one, use uvx --from overleaf-mcp-integration <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "overleaf-mcp-server": {
            "command": "uvx",
            "args": [
                "overleaf-mcp-integration"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from overleaf-mcp-integration <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "overleaf-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "overleaf-mcp-integration"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from overleaf-mcp-integration <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add overleaf-mcp-server uvx overleaf-mcp-integration
```
uvx runs the command named after the package; if the README names another one, use uvx --from overleaf-mcp-integration <command>

## When to use it
- read and edit Overleaf LaTeX documents directly from an AI agent
- push targeted text replacements to remote papers automatically
- retrieve project directory trees without manual file downloads
- read massive scientific drafts in chunked line ranges

## Example prompts
- List all files in my current Overleaf paper
- Read lines 1 to 80 of `main.tex` and summarize the methodology
- Update the bibliography entry in `references.bib` and push to Overleaf

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5548
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3231
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2417
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1716
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 583
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
