Skip to main content

overleaf-connect

An MCP server to have agents use Overleaf for free.

Once it's connected, an agent can:

  • create or duplicate projects
  • list, read, write, and edit .tex files
  • compile a project and pull the PDF back locally

Installation

If you dont have uv installed, install it.

It needs your Overleaf session cookie to do anything, so grab that first:

  1. Sign in at overleaf.com.
  2. Open DevTools -> Network, reload the project list, click any overleaf.com request, and copy the full Cookie request header.

Copy over this for the OVERLEAF_SESSION environment variable in the MCP server.

Claude Code

claude mcp add overleaf -e OVERLEAF_SESSION="overleaf_session2=s%3A...; GCLB=..." -- uvx overleaf-connect

Claude Desktop

Open Settings -> Developer -> Edit Config and add an overleaf entry under mcpServers (keep any servers you already have):

{
  "mcpServers": {
    "overleaf": {
      "command": "uvx",
      "args": ["overleaf-connect"],
      "env": {
        "OVERLEAF_SESSION": "overleaf_session2=s%3A...; GCLB=..."
      }
    }
  }
}

Afterwards, restart Claude Desktop to reload the MCP servers and get Overleaf connected.

Authentication

Overleaf issues a fresh cookie on every request. After the first success the server saves the rotating value to:

  • Windows: %LOCALAPPDATA%\overleaf-connect\session.json
  • macOS / Linux: ~/.overleaf-connect/session.json

The OVERLEAF_SESSION environment variable is treated as a seed - the server will automatically refresh the session whenever requests are done to Overleaf, and store it. You only need to change it in the future if the cookie has expired from not using it.

Optional environment variables

OVERLEAF_HOME_DIR=...      # directory that holds session.json
OVERLEAF_SESSION_FILE=...  # exact session.json path
OVERLEAF_CACHE_DIR=...     # compiled-PDF cache
OVERLEAF_OUTPUT_DIR=...    # allowed download_pdf destination root (default ./output)

Tools

Tool What it does
status check if session cookie works
list_projects id, name, last updated
create_project blank project
duplicate_project clone an existing project
list_files paths in a project
read_file text contents of a file (full=true for files over 100k chars)
write_file whole-file create/replace
edit_file exact old/new string replace in a file
compile_project Overleaf compile -> cached output.pdf + parsed errors
download_pdf compile and copy the PDF under OVERLEAF_OUTPUT_DIR
trash_project move a project to Overleaf trash

Writes replace the whole file, so write_file refuses to write back a file that was only read in part - read it again with full=true, or use edit_file. Don't edit a file while someone is typing in it in the browser.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overleaf_connect-0.1.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

overleaf_connect-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file overleaf_connect-0.1.0.tar.gz.

File metadata

  • Download URL: overleaf_connect-0.1.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for overleaf_connect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 549b6c25fa5b94602c87e47cce4018d3e0b5e13d9e55605e63a3d5ac1a6081e7
MD5 439478ed08bdd0a572fdca15f07e5bd9
BLAKE2b-256 bf24c6bb7f9c697f9489bab77baa53ee03125765c2161844c1cc1200e0b5d6d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_connect-0.1.0.tar.gz:

Publisher: release.yml on flafkus/overleaf-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file overleaf_connect-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for overleaf_connect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a766c8f50f4f268e6358ffbac969210f557bf2ec835d153bd9adbe12aaefd9a
MD5 d5808d860bf02ac10032cb9ad33c277b
BLAKE2b-256 ea4da2bc9e68d89d010b07a0bcdc695d476c8e5e4e2441565f35f7cc693f4b2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_connect-0.1.0-py3-none-any.whl:

Publisher: release.yml on flafkus/overleaf-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page