mcpField
O
Overleaf for AI agents (olmcp)

Overleaf for AI agents (olmcp)

Local
github.com/nipdepProductivity0Updated 2d ago

About Overleaf for AI agents (olmcp)

olmcp connects AI agents to Overleaf so they can handle review comments using the user's session. It proposes edits as tracked changes by default, leaving acceptance and thread resolution to the human reviewer.

Key features

  1. 01Read comments, threads, selected text, and project files
  2. 02Propose edits as tracked changes
  3. 03Reply in comment threads
  4. 04Revise pending suggestions
  5. 05Create new text files and folders
  6. 06Compile projects and save PDFs locally

Use cases

  1. 01Draft responses to comments on an Overleaf paper
  2. 02Request another version of a proposed edit
  3. 03Add a new section or bibliography file
  4. 04Compile an Overleaf project and save its PDF

MCP support

Runs locally as an MCP server and uses the user's Overleaf session. Its tools read project content, propose edits, and reply to review threads, while leaving acceptance and thread management to the user.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"nipdep-agent-overleaf-connector": {
"command": "npx",
"args": [
"-y",
"olmcp"
],
"env": {
"OVERLEAF_SESSION": "<OVERLEAF_SESSION>",
"OVERLEAF_BASE_URL": "<OVERLEAF_BASE_URL>"
}
}
}
}
Run commandnpx -y olmcp
Environment variables to set
OVERLEAF_SESSIONSecretYour Overleaf session cookie (overleaf_session2). Optional: `olmcp auth` stores it in ~/.config/olmcp instead.
OVERLEAF_BASE_URLOnly for a self-hosted Overleaf, e.g. https://overleaf.example.edu. Defaults to https://www.overleaf.com.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmolmcp1.0.0-alpha.3

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Agent standing over a leaf

Agent–Overleaf Connector (olmcp)

tests

olmcp lets an AI agent respond to review comments in an Overleaf project.

You comment in Overleaf. The agent reads the comment and the selected text, proposes an edit as an Overleaf tracked change, and replies in the same thread. You remain the reviewer: you accept or reject the edit and close the thread.

olmcp has no hosted backend: the connector runs on your computer and uses your Overleaf session. Your chosen AI client may still send MCP results to its model provider under that client's own privacy terms.

The workflow

1. You select text and leave a comment in Overleaf.
2. The agent reads the comment and the live project.
3. The agent proposes a tracked change and replies in the thread.
4. You accept, reject, request another version, or resolve the thread.

By default, an edit is a proposal, not a silent replacement. Overleaf shows the original text as a tracked deletion and the proposed text as a tracked insertion.

Project status: 1.0.0-alpha.3. The core review flow has been used on real Overleaf projects; newer features such as pending-suggestion revision and file creation still need real-service testing. Start with a disposable project.

What the MCP can and cannot do

It canIt deliberately cannot
Read comments, threads, selected text, and text files in the projectAccept or reject a tracked change for you
Propose tracked edits in review modeResolve, reopen, close, or delete a comment thread
Apply a plain edit when you explicitly use #directOverwrite or delete an existing file
Reply in a comment threadEdit documents that use Overleaf's unsupported newer history format
Revise its own pending suggestion when you ask for another versionCreate images, PDFs, or other binary project files
Create a new text file and missing foldersWork continuously in the background or watch for new comments
Compile the project on Overleaf and save the PDF locallyGive the agent a separate Overleaf identity; changes use your account

The tool surface enforces these limits. However, an agent with unrestricted shell access could read the stored session cookie and contact Overleaf outside the MCP. See Security and trust.

Quick start

You need Node.js 20 or newer, an Overleaf account, and an MCP-capable agent such as Claude Code or Codex. You do not need Python, TeX, or Overleaf's paid Git integration. The current GitHub-based installation may also need the git command; normal use does not.

1. Install olmcp
npm install -g github:nipdep/agent-overleaf-connector
olmcp --version
2. Sign in to Overleaf

Copy the overleaf_session2 cookie from your browser's developer tools, then run:

olmcp auth --cookie "<cookie value>"

Treat this cookie like a password. Never paste it into an agent chat, issue, or commit. The setup guide shows where to find it and what to do when it expires.

3. Register the MCP server

Choose your agent, then restart it:

# Claude Code
claude mcp add --scope user olmcp -- "$(which olmcp)" mcp

# Codex
codex mcp add olmcp -- "$(which olmcp)" mcp

Windows PowerShell commands and other MCP clients are covered in Connect an AI agent.

4. Give the agent your project URL

No project folder or clone is required. After connecting the MCP, paste the Overleaf project URL into the request:

Address the comments in https://www.overleaf.com/project/&lt;project-id>.

If you prefer not to paste the URL each time, you can save the project ID in a working folder with olmcp init. See Choosing a project.

5. Address a comment

In Overleaf, select a sentence and comment “make this clearer.” Then tell your agent:

Address the comments in https://www.overleaf.com/project/&lt;project-id>.

Back in Overleaf, review the tracked edit. Accept or reject it, reply with another request, or resolve the thread yourself.

Everyday controls

When you want to…Do this in Overleaf
Propose a normal reviewable editLeave an ordinary comment; review is the default
Apply an edit without tracked changesAdd #direct to the comment
Keep the agent away from a threadAdd #no-agent
Focus the agent on particular threadsAdd #agent to those comments
Ask for another version of a pending suggestionReply in the same thread, for example “shorter please,” then run the agent again
Add a new section or bibliography fileAsk in a comment; the new file appears immediately, while the \input or bibliography edit is proposed separately
Finish a discussionResolve the thread yourself

Read Using olmcp for examples, modes, tags, file creation, and the complete MCP tool list.

Important safety details

  • Tracked changes are attributed to your Overleaf account because the connector uses your session.
  • A newly created file cannot be a tracked change. It appears immediately; the connector never overwrites or deletes files.
  • #direct changes are immediate. Use Overleaf History if you need to undo one.
  • The interface is unofficial and may break when Overleaf changes it.
  • The session cookie usually expires after a few days. Run olmcp auth again when olmcp doctor reports an expired session.

Documentation

Release changes are in the changelog. The retired Python workflow—Git sync, source markers, redline.tex, and GitHub Actions—remains on the python-legacy branch.

Logo files: PNG · SVG

License and credit

Apache 2.0. See LICENSE. The Overleaf protocol handling follows the approach used by olcli by Alexander Loth (MIT); see THIRD_PARTY_NOTICES.md.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.