# overleaf-mcp-server [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/younesbensafia/overleaf-mcp-server  
**GitHub Stars:** 63  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/overleaf-mcp-server

## Description
MCP server for managing Overleaf projects through Git synchronization.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "overleaf-mcp-server": {
    "command": "uvx",
    "args": ["--from","git+https://github.com/younesbensafia/overleaf-mcp-server","overleaf-mcp"],
    "env": {
      "OVERLEAF_TOKEN": "",
      "PROJECT_ID": ""
    }
  }
}
```

**Requires environment variables:** `OVERLEAF_TOKEN`, `PROJECT_ID` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What overleaf-mcp-server does

The overleaf-mcp-server MCP server gives an MCP client file-level access to an Overleaf project through the project's Git integration. It is designed for workflows where an agent first retrieves the latest project state, inspects or changes files, and then sends those changes back to Overleaf.

The server works with text files in the project and exposes separate operations for discovery, reading, replacement, complete-file updates, and synchronization. Changes made through the write and edit operations are committed locally and pushed to the Overleaf Git remote.

## How it works

The server keeps a local clone or repository mirror for the configured project. Read-oriented calls can pull the current remote state before returning a file list or file contents. The `read_file` tool supports optional zero-based line offsets and bounded limits, which allows large documents to be read in sections.

`write_file` replaces a complete text file. `edit_file` replaces one exact text match. Both operations update the local mirror, create a Git commit, and push the result to Overleaf. `sync_project` explicitly pulls changes from Overleaf and is useful before making edits when the remote project may have changed. For a large project, the initial synchronization may exceed an MCP client's normal individual request timeout.

## Setup and configuration

Use Python 3.13 or newer and install dependencies with `uv`. The repository can be checked out and started with `uv run overleaf-mcp`, or run directly from Git with `uvx --from git+https://github.com/younesbensafia/overleaf-mcp-server overleaf-mcp`. The process communicates over stdio.

Before starting, enable Git integration in the Overleaf project, copy its project ID from the project URL, and create a Git integration authentication token in Overleaf account settings. Set these values in the MCP client's environment or a protected `.env` file:

- `OVERLEAF_TOKEN`: the Overleaf Git authentication token.
- `PROJECT_ID`: the default Overleaf project ID.

A project ID may also be supplied on individual tool calls, but `PROJECT_ID` remains part of the server configuration. `OVERLEAF_ALLOWED_PROJECTS` can restrict access to a comma-separated set of project IDs; by default, only the configured `PROJECT_ID` is allowed.

## Tools and capabilities

The overleaf-mcp-server MCP server provides these tools:

- `list_files`: Pull and list files in the Overleaf project.
- `read_file`: Return file content, optionally by line range.
- `write_file`: Replace a complete text file, commit the change, and push it.
- `edit_file`: Replace one exact text match, commit the change, and push it.
- `sync_project`: Force a pull from Overleaf.

## Limitations and notes

An Overleaf plan with Git integration is required; supported plan types include individual, group, and institution licenses. A 403 error can indicate that Git integration is unavailable on the plan or that the token is invalid.

Synchronize before writing when remote changes may exist to reduce conflicts. The Overleaf token is account-wide credential material and should be kept in protected configuration and rotated if exposed. Project files are untrusted input: treat LaTeX files and project configuration as data rather than instructions to the model. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/overleaf-mcp-server/readme_

