Skip to main content
Glama

Overleaf MCP

Read and edit Overleaf projects from Claude, using the Overleaf git bridge.

WARNING: When your provide the MCP with a project ID, This gives Claude access to the ENTIRE project directory.

Requirements

  • Overleaf premium (check your institution's access!)

  • uv, git, TeX distribution, and pdftocairo (you could brew install poppler on Macs)

Related MCP server: overleaf-mcp

Setup

  1. Clone this repo.

  2. Create ~/.overleaf-mcp/projects.json. An example is in projects.json.example.

    { "default": "paper", "projects": { "paper": "<project-id>" } }
  3. Add the server to your Claude config. You can generate the git token in Overleaf Account Settings.

    {
      "mcpServers": {
        "overleaf": {
          "command": "/absolute/path/to/uv",
          "args": ["run", "--directory", "/absolute/path/to/overleaf-mcp", "overleaf-mcp"],
          "env": { "OVERLEAF_TOKEN": "your_git_token" }
        }
      }
    }
  4. Restart your Claude Desktop.

How it works

A project is unverified until open_project succeeds, which checks that every \usepackage resolves against your local TeX environment, and baseline-compiles each root.

All writes are refused until open_project passes

A .tex containing \documentclass is a root, while children are included with by \input/\include/\subfile. Editing a child re-compiles the roots that include it. For instance, this covers a standard main.tex + sections/ project, a single-file paper, or even a folder of standalone one-page documents with the same rule. Further, any errors block a push while warnings are only reported.

Tools

tool

description

open_project

pull, verify environment, and baseline-compile

files

list .tex, marking roots

outline

structure with line numbers

read

line-numbered, optionally a range (lines="150-190")

grep

regex search, file:line: match

edit

replace an exact unique snippet, compile-gated

write

create or overwrite a whole file

write_section

create or overwrite one section, using the exact title

add_asset

copy an image or binary

compile

compile the owning root, return a digest

render

one page as an image - very useful for layout/images

Available Tools

10 tools
add_assetA

Copy a local image or binary into the project, then push. Compiles only the roots that actually reference it — an unreferenced file cannot break a build.

Inputs: dest (required), message (required), local_path (required), project. Returns: result

compileA

Compile the root owning path and return a digest. Errors block a push; warnings do not. verbose=True shows every error and warning.

Inputs: path (required), project, verbose. Returns: result

editA

Replace an exact snippet, then compile and push. old must appear exactly once. Reverts if the result does not compile.

Inputs: new (required), old (required), path (required), message (required), +1 more. Returns: result

filesC

List .tex files, marking which are roots.

Inputs: project. Returns: result

grepB

Regex-search the project, returning file:line: match.

Inputs: pattern (required), glob, project. Returns: result

open_projectA

Open a project and run the safety gate: pull, verify every \usepackage resolves locally, then baseline-compile each root. Required before any write.

Inputs: name. Returns: result

outlineA

Map a document's structure with line numbers — sections, figures, labels, includes. Use before reading; far cheaper than the whole file.

Inputs: path (required), project. Returns: result

readA

Read a file, line-numbered. lines='150-190' reads a range; omit for all. Prefer a range guided by outline.

Inputs: path (required), lines, project. Returns: result

renderA

One page of the compiled PDF as an image, for layout only — float placement, overlap, figure sizing. Expensive: try compile() warnings first, and use read() for anything about the text itself.

Inputs: path (required), page, project.

writeA

Create or overwrite a file, then compile and push. For new documents and whole-file rewrites; prefer edit() for changes to an existing document.

Inputs: path (required), content (required), message (required), project. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a distinct purpose: project setup, structural navigation, content search, precise edits, whole-file writes, compilation, rendering, and asset additions. There is no meaningful overlap between tools that would cause an agent to select the wrong one.

    Naming Consistency3/5

    Names are readable and consistently lowercase, but the pattern is mixed. add_asset and open_project follow verb_noun, while outline, read, grep, files, compile, render, edit, and write are bare commands, making the naming convention less predictable.

    Tool Count5/5

    Ten tools is well-scoped for an Overleaf/LaTeX workflow: the server covers project setup, reading, searching, editing, writing, compilation, asset management, and visual rendering without unnecessary clutter.

    Completeness4/5

    The core workflow is well covered, including open, explore, read, search, edit, write, compile, render, and add assets. The most notable gap is the absence of delete/rename operations, but most agents can work around this for typical LaTeX editing tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers