Skip to main content
Glama

πŸƒ Overleaf MCP Helper

Let AI assistants read, edit, and manage your Overleaf LaTeX projects β€” safely.

License: MIT MCP

Overleaf MCP Helper is a Model Context Protocol (MCP) server paired with a VSCode extension that bridges AI assistants (Claude, ChatGPT, Copilot, etc.) to your Overleaf projects. Write, refactor, and manage LaTeX papers with AI β€” without ever leaving Overleaf.

✨ Features

  • πŸ“– Read any file in your Overleaf project

  • ✏️ Edit files with safe, exact-match substring replacement (no full-file overwrites!)

  • πŸ“„ Create new files (with overwrite protection)

  • πŸ—‘οΈ Delete files (directory deletion blocked for safety)

  • πŸ“ Rename / Move files within the project

  • πŸ” Search across all project files with regex

  • πŸ“Š Parse LaTeX logs β€” extract errors, warnings, and bad boxes from compile output

  • 🌳 Tree view of the project structure

  • πŸ”„ Auto-retry with connection recovery on network failures

Related MCP server: overleaf-mcp

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   AI Assistant                          β”‚
β”‚            (Claude / ChatGPT / Copilot)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ MCP (stdio)
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              MCP Server (Node.js)                       β”‚
β”‚                                                         β”‚
β”‚  Tools: edit_file Β· create_file Β· delete_file           β”‚
β”‚         rename_file Β· read_file Β· search_in_project     β”‚
β”‚         get_compile_log Β· tree Β· list_files             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ HTTP (localhost:23119)
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          VSCode Extension (HTTP Bridge)                  β”‚
β”‚                                                         β”‚
β”‚  Exposes vscode.workspace.fs via REST API               β”‚
β”‚  Endpoints: /ws/read Β· /ws/write Β· /ws/delete           β”‚
β”‚             /ws/rename Β· /ws/ls Β· /ws/stat Β· /ws/tree   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ VSCode VFS API
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Overleaf                              β”‚
β”‚          (overleaf-workshop:// protocol)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Installation

Prerequisites

Step 1: Install the VSCode Extension

Option A: Use the pre-built .vsix (recommended)

A pre-built extension is available in the dist/ directory:

  1. Download dist/overleaf-mcp-helper-extension-1.0.0.vsix

  2. In VSCode: Extensions β†’ Β·Β·Β· β†’ Install from VSIX... β†’ select the downloaded file

Option B: Build from source

cd extension
npm install
npm run compile
npm run package

This will generate a .vsix file in the extension/ directory (e.g. extension/overleaf-mcp-helper-extension-1.0.0.vsix).

Install it in VSCode: Extensions β†’ Β·Β·Β· β†’ Install from VSIX... β†’ select the generated .vsix file.

Step 2: Configure the MCP Server

First, install MCP server dependencies:

cd mcp-server
npm install

Then add to your MCP configuration file (e.g. Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "overleaf": {
      "command": "node",
      "args": ["/path/to/overleaf-mcp-helper/mcp-server/index.mjs"]
    }
  }
}

Step 3: Open an Overleaf Project

  1. Open an Overleaf project in VSCode via the Overleaf Workshop extension

  2. The bridge extension auto-starts an HTTP server on localhost:23119

  3. The MCP server auto-discovers the bridge and connects

That's it! Your AI assistant can now interact with your Overleaf project. πŸŽ‰

πŸ› οΈ Available Tools

File Operations

Tool

Description

Safety

read_file

Read a single file by path

βœ… Read-only

read_multiple_files

Read multiple files at once

βœ… Read-only

edit_file

Replace an exact substring (must match uniquely)

βœ… Safe β€” rejects ambiguous matches

create_file

Create a new file (rejects if exists)

βœ… Safe β€” no overwrite

delete_file

Delete a file (rejects directories)

⚠️ Destructive β€” files only

rename_file

Rename or move a file (rejects if dest exists)

⚠️ Destructive β€” no overwrite

Search & Navigation

Tool

Description

list_projects

List all open workspaces/projects

list_files

Recursively list all files

tree

Visual directory tree (configurable depth)

search_in_project

Regex search across text files

LaTeX-Specific

Tool

Description

get_compile_log

Parse .log file β€” extract errors, warnings, bad boxes

βš™οΈ Configuration

Environment Variables (MCP Server)

Variable

Default

Description

VFS_BRIDGE_PORT

23119

Base port for bridge discovery

VFS_BRIDGE_TIMEOUT

10000

HTTP request timeout (ms)

VFS_BRIDGE_WRITE_TIMEOUT

15000

Write request timeout (ms)

VFS_BRIDGE_RETRIES

2

Max retries on connection failure

Extension Settings (VSCode)

Setting

Default

Description

overleafMcpHelper.port

23119

HTTP server port

overleafMcpHelper.autoStart

true

Auto-start when VFS workspace detected

πŸ”’ Safety Design

This project prioritizes safety to protect your precious LaTeX manuscripts:

  1. No full-file overwrite β€” We deliberately removed the write_file tool. All edits go through edit_file which requires an exact, unique match.

  2. Overwrite protection β€” create_file rejects if the file exists. rename_file rejects if the destination exists.

  3. Directory protection β€” delete_file only works on files, not directories.

  4. Automatic retry β€” Network failures trigger port re-discovery and retry, not data corruption.

  5. Overleaf version history β€” Even if something goes wrong, Overleaf keeps full version history for recovery.

πŸ“„ License

MIT β€” use it however you like.


Made with ❀️ for the academic community.

If this tool helps you write papers faster, consider giving it a ⭐!

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers