Skip to main content
Glama

overleaf-paper-mcp

MCP server for managing academic LaTeX projects in Overleaf: create projects, transfer files, compile documents, inspect compiler output, and download PDFs.

Install

Requirements: Node.js 20+ and Playwright Chromium.

npm install
npx playwright install chromium
npm run build

Run the published package with:

OVERLEAF_EMAIL="your@email.com" \
OVERLEAF_PASSWORD="yourpassword" \
npx -y @youzhijc/overleaf-paper-mcp

Related MCP server: Overleaf MCP Server

Configuration

Provide credentials as runtime environment variables; do not commit a .env file.

Variable

Purpose

OVERLEAF_EMAIL

Overleaf login email.

OVERLEAF_PASSWORD

Overleaf login password.

OVERLEAF_DATA_DIR

Recommended absolute root for all MCP-managed local resources. Downloads are kept in workspace/; browser login state is kept in browser-data/.

OVERLEAF_WORKSPACE_DIR

Legacy alternative for the workspace only. Use OVERLEAF_DATA_DIR for new configurations.

Use absolute paths for local_path and zip_path when possible. Relative paths are accepted only inside OVERLEAF_DATA_DIR/workspace (or the legacy OVERLEAF_WORKSPACE_DIR). With OVERLEAF_DATA_DIR, all local state is kept below one directory:

OVERLEAF_DATA_DIR/
├── workspace/      # downloaded project files and PDFs
└── browser-data/   # Overleaf login session and browser cache

Do not upload or share browser-data/: it can contain your Overleaf login session. Delete workspace/ to clear downloads, browser-data/ to sign out, or the full data directory to reset the MCP.

Workflow

overleaf_list_files (optional)
→ overleaf_download_file
→ edit the local file
→ overleaf_upload_file (overwrite: true when replacing a file)
→ overleaf_compile
→ overleaf_download_pdf

overleaf_compile always inspects output.log: a rendered PDF does not prove that LaTeX completed without errors. If the log contains an error, it clears cached files and retries once; persistent errors return parsed diagnostics plus the compiler log. Successful results may still contain warnings.

overleaf_upload_file currently writes to the project root. To import a full project archive, use overleaf_create_project_from_zip.

Tools

Tool

Purpose

ping

Check server availability.

overleaf_login / overleaf_logout

Start or close the browser session.

overleaf_list_projects / overleaf_open_project

Find or open a project.

overleaf_create_project

Create an empty project.

overleaf_create_project_from_zip

Create a project from a local ZIP archive.

overleaf_list_files

List project files and paths.

overleaf_download_file / overleaf_upload_file

Transfer one project file.

overleaf_create_folder / overleaf_create_file

Create empty root-level items.

overleaf_rename_file / overleaf_delete_file

Rename or delete a file.

overleaf_compile

Compile and, after a failed retry, return LaTeX diagnostics and output.log.

overleaf_download_pdf

Download the compiled PDF.

Codex configuration

[mcp_servers.overleaf-paper-mcp]
command = "npx"
args = ["-y", "@youzhijc/overleaf-paper-mcp"]
env = {
  OVERLEAF_EMAIL = "your@email.com",
  OVERLEAF_PASSWORD = "yourpassword",
  OVERLEAF_DATA_DIR = "/absolute/path/to/your/overleaf-paper-mcp-data"
}
startup_timeout_sec = 120
tool_timeout_sec = 120

License

MIT

Available Tools

16 tools
overleaf_compileA

Compile an Overleaf project after uploading source or resource changes. This tool always inspects output.log because a PDF can render despite LaTeX errors. If any error is found, it clears cached files and retries once; a persistent error returns parsed diagnostics and output.log. Successful results can include warnings. This is the only compilation-diagnostics tool.

Inputs: project_id (required).

overleaf_create_fileA

Create one empty root-level file. Usually unnecessary because overleaf_upload_file creates a new root-level file when no same-named file exists; use only when an empty file is specifically needed.

Inputs: file_name (required), project_id (required).

overleaf_create_folderA

Create one folder in the project root. Use only for an empty folder; nested paths are not supported yet and uploads currently target the project root.

Inputs: project_id (required), folder_name (required).

overleaf_create_projectA

Create a new empty Overleaf project. Use when starting a paper from scratch; then upload locally prepared source files with overleaf_upload_file.

Inputs: project_name (required).

overleaf_create_project_from_zipA

Create a new Overleaf project from a local ZIP archive. Use for importing a complete existing paper; this creates a separate project and never overwrites one.

Inputs: zip_path (required), project_name.

overleaf_delete_fileA

Delete exactly one project file. First call with confirm omitted/false to inspect it; call again with confirm: true only after the user explicitly approves that exact path.

Inputs: file_path (required), project_id (required), confirm.

overleaf_download_fileA

Primary file-reading tool: download exactly one Overleaf file under OVERLEAF_DATA_DIR/workspace/files/<project_id>/ and return its path. To modify a paper, download it, edit the returned local file, then call overleaf_upload_file with overwrite: true.

Inputs: file_path (required), project_id (required).

overleaf_download_pdfA

Download the latest compiled PDF. Call overleaf_compile first and download only after a successful compilation; saves under OVERLEAF_DATA_DIR/workspace/pdfs/<project_id>/.

Inputs: project_id (required), filename.

overleaf_list_filesA

List every project file, including nested files and sizes, by downloading and inspecting the project ZIP. Use when a complete, path-accurate inventory is needed; it is slower than single-file download.

Inputs: project_id (required).

overleaf_list_projectsA

List the logged-in user's Overleaf projects and their IDs. Use this first when the project ID is unknown.

Inputs: no named parameters.

overleaf_loginA

Open Overleaf and establish a reusable authenticated browser session using runtime environment variables. Call this before other Overleaf actions if no session exists.

Inputs: no named parameters.

overleaf_logoutA

Close the reusable Overleaf browser session and release its browser resources. Call once at the end of a bounded Overleaf task only when the user has indicated that no further Overleaf work is needed; do not close it between ordinary tool calls.

Inputs: no named parameters.

overleaf_open_projectA

Open a project in the browser by its project ID. File tools open projects automatically, so use this mainly to inspect or recover the visible Overleaf UI.

Inputs: project_id (required).

overleaf_rename_fileA

Rename an existing project file without changing folders. List files first to obtain the exact old_path; this cannot move a file between folders.

Inputs: new_name (required), old_path (required), project_id (required).

overleaf_upload_fileA

Primary file-writing tool: upload one local file to the project root. Use after editing a file obtained with overleaf_download_file, or to add images, .bib, .cls, and .tex files. A same-named file is preserved unless overwrite: true is intentionally supplied; ZIP import uses overleaf_create_project_from_zip instead.

Inputs: local_path (required), project_id (required), overwrite.

pingA

Check that the MCP server is alive and reachable

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools are clearly distinct by action and resource (auth, project, file, compile/PDF), and descriptions explicitly disambiguate edge cases such as create_project vs create_project_from_zip. There is slight overlap between create_file and upload_file for creating new files, and open_project serves a niche 'inspect UI' purpose, but both are hedged clearly enough to avoid significant misselection.

    Naming Consistency4/5

    The dominant pattern overleaf_verb_noun is used consistently across all file and project operations. The exceptions are ping (missing the overleaf_ prefix) and login/logout/compile (verb-only), which are minor and conventional deviations.

    Tool Count3/5

    With 16 tools, the set sits just above the ideal 3-15 range. Ping, open_project, and create_file add marginal value and make it feel slightly heavy, though no tool is truly out of place in the Overleaf workflow.

    Completeness4/5

    The tool surface covers the core lifecycle well: auth, project creation (empty/zip), project listing, file CRUD (download/upload/rename/delete), compilation, and PDF download. Gaps include project deletion, folder deletion/rename/move, and nested-folder or nested upload support, but these are workable limitations rather than blocking dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers