Overleaf MCP

August 24, 2026 · View on GitHub

Use AI coding agents and MCP clients to read, understand, and edit Overleaf projects through Git.

npmNode.jsLicense: MITMCP

English | 中文

Demo

Overleaf MCP demo

What It Can Do

  • Work with one or multiple Overleaf projects.
  • Browse project files and preview the structure and line ranges of LaTeX documents.
  • Search project text and read complete files or selected line ranges.
  • Make targeted text and section edits, or write a complete file when needed.
  • Commit and push changes back to Overleaf through Git.
  • Keep credentials outside model-visible tool output and restrict file access to the project repository.

Quick Start

Requirements

You need:

1. Configure

Create ~/.config/overleaf-mcp/projects.json on macOS/Linux or %APPDATA%\overleaf-mcp\projects.json on Windows:

{
  "projects": {
    "paper": {
      "name": "Paper",
      "projectId": "your-project-id",
      "gitToken": "your-git-token"
    }
  }
}

2. Run

npx -y @fly233338/overleaf-mcp

overleaf-mcp automatically loads the user configuration and communicates with MCP clients over stdio.

Available MCP Tools

overleaf-mcp currently exposes the following MCP tools:

ToolDescription
list_projectsList configured Overleaf projects
list_filesList files in an Overleaf project
preview_filePreview the structure and line ranges of a LaTeX file
search_textSearch text across project files
read_fileRead a complete file or selected line range
replace_textReplace targeted text and push the change
write_fileWrite a complete file and push the change
write_sectionReplace a LaTeX section and push the change

How It Works

AI client / coding agent

          │ MCP stdio

     overleaf-mcp

          │ Overleaf Git integration

     Overleaf project

overleaf-mcp is a standalone MCP server. It exposes project and LaTeX source operations to the MCP client, while synchronization and writes are handled through Overleaf's Git integration.

Security and Limitations

  • Overleaf access is handled through Git integration rather than browser automation.
  • Credentials are kept outside model-visible tool output.
  • File access is restricted to the configured project repository.
  • Write operations are committed and pushed back to Overleaf through Git.
  • An Overleaf project with Git integration is required.

Development

npm install
npm run check

npm run check runs type checking, tests, and the production build.

License

MIT