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: ~/Downloads/overleaf-connect, or
                          #  ~/Documents/overleaf-connect, else ~/overleaf-connect)

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.1.tar.gz (23.2 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.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: overleaf_connect-0.1.1.tar.gz
  • Upload date:
  • Size: 23.2 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.1.tar.gz
Algorithm Hash digest
SHA256 bc80798b077ee1509402e3d8f8649c5f6a70ab25a95c95d971ee641aabfd3d1a
MD5 799102807aca7ffdb1afa9f76516c2e8
BLAKE2b-256 fbe3675ce8a670672d04369f3489b95200917898116ff137b2660581b9ee54a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_connect-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for overleaf_connect-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f25fdc979ec47394f981e2338c17c0e64fa492ae5ef1e188dbd2b0716607706
MD5 fe8fd2cc6d5b91d010907dece6586b10
BLAKE2b-256 95a98a89641c77dfb541a211600c6e0d382a5995d87a29165cbf5bfb13d9d22f

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_connect-0.1.1-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

This release

0.1.1 This release

2 files

0.1.0

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