overleaf-multi-mcp
Provides tools for managing Overleaf projects, including project discovery, file reading/writing, section editing, local workspace setup, syncing, diffing, pushing changes, viewing version history, and rolling back to previous versions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@overleaf-multi-mcpSet up local workspace for project VCaiLuong and show me the diff"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
overleaf-multi-mcp
A Model Context Protocol (MCP) server that spans every project on your Overleaf account. It auto-discovers your project list, then reads and edits files across any of them from Claude Code — with a review-before-push local-workspace flow.
Design rationale, trade-offs, and the ToS discussion live in
OVERLEAF_MCP_ARCHITECTURE.md. This README is
just setup + usage.
How it works (two auth paths)
Concern | Mechanism | Where |
Content I/O (read/commit/push/history) |
|
|
Discovery (listing your projects) |
|
|
The token does all file work. The cookie is used only to list projects — never for content. See the architecture doc's §6 for the ToS caveat around the cookie call.
Related MCP server: Overleaf MCP Server
Prerequisites
Node.js ≥ 18 (uses global
fetch)The
gitbinary onPATH
Install
cd /Users/longngo/IdeaProjects/overleaf-mcp
npm installConfigure auth
All state lives in ~/.config/overleaf-mcp/ (override with OVERLEAF_CONFIG_DIR).
1. Git token (required — content)
Overleaf → Account Settings → Git Integration → generate a token (olp_…).
The same token works for every project you own.
mkdir -p ~/.config/overleaf-mcp
printf '%s' 'olp_your_token_here' > ~/.config/overleaf-mcp/token.txt
chmod 600 ~/.config/overleaf-mcp/token.txt(Or set OVERLEAF_TOKEN in the environment.)
2. Session cookie (optional — discovery only)
Only needed for sync_projects / list_projects. In a logged-in browser:
DevTools → Application → Cookies → https://www.overleaf.com → copy the
overleaf_session2 value.
printf '%s' 'overleaf_session2=s:...' > ~/.config/overleaf-mcp/session.txt
chmod 600 ~/.config/overleaf-mcp/session.txtThe file may hold either the full overleaf_session2=s:… string or just the value.
Cookies expire (~30 days) — when sync_projects reports an expiry, refresh this file.
(Or set OVERLEAF_SESSION.) Without a cookie the server still works for any project
you reference by ID or set up as a workspace; you just can't auto-list.
Register with Claude Code
Add to your .mcp.json (kept alongside the old single-project entry during
transition, per the architecture doc):
{
"mcpServers": {
"overleaf-multi": {
"command": "node",
"args": ["/Users/longngo/IdeaProjects/overleaf-mcp/src/server.js"],
"env": {
"OVERLEAF_WORKSPACE_ROOT": "/Users/longngo/IdeaProjects/Overleaf"
}
}
}
}Then restart Claude Code. On start the server auto-syncs the project list if a cookie is present (non-fatal if not).
Environment variables
Var | Default | Purpose |
| (reads | Git token for content I/O |
| (reads | Session cookie for discovery |
|
| Where |
| — | Name/ID used when |
|
| State directory |
|
| Dashboard host (self-hosted CE) |
|
| Git host (self-hosted CE) |
|
| Commit identity |
Tools (17)
Discovery — sync_projects, find_project, session_status, list_projects
Workspace — setup_local, pull_local, diff_local, push_local,
list_version_history, rollback_to_version
Content (workspace-aware) — list_files, read_file, get_sections,
get_section_content, status_summary, write_file, write_section
The core flow: review before push
sync_projects→find_project "VCaiLuong"setup_local "VCaiLuong"→ clones to<workspace-root>/VCaiLuong/write_section main.tex "Abstract" "…"→ writes only, no pushdiff_local "VCaiLuong"(or your IDE Source Control) to reviewpush_local "VCaiLuong" "Rewrite abstract"→ commits + pushes
Projects without a workspace fall back to legacy behavior: write_file /
write_section clone to a temp dir and commit + push immediately (a commitMessage
is required in that mode).
Rollback
list_version_history "VCaiLuong" limit:10
rollback_to_version "VCaiLuong" commitSha:"def5678" paths:["main.tex"] mode:"restore"
# → uncommitted changes; review with diff_local, then push_localrestore = git checkout <sha> -- <paths>; revert = undo commits since <sha>.
Both leave changes uncommitted (nothing is force-pushed). Rollback refuses if the
workspace is dirty unless force:true.
Security notes
The git token is never placed in argv, in a workspace's
.git/config, or in error output. Remotes are stored clean; credentials are supplied per-command via an inline credential helper reading the token from the child process env.Keep
token.txtandsession.txtatchmod 600.
Layout
src/
├── server.js MCP entry: stdio transport, tool schemas, dispatch, content routing
├── config.js paths, auth, cache.json, workspaces.json, name/ID resolution
├── git.js child_process git wrappers with token masking
├── overleaf.js session-cookie discovery (the only network-JSON module)
└── latex.js \section{…} parsing + section splicingMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides access to Overleaf projects via Git integration, allowing Claude and other MCP clients to read LaTeX files, analyze document structure, and extract content.Last updated6127215MIT
- Alicense-qualityDmaintenanceEnables access to Overleaf LaTeX projects through Git integration, allowing users to read files, analyze document structure, extract sections, and manage multiple projects through natural language commands.Last updated337MIT
- Alicense-qualityCmaintenanceEnables editing Overleaf projects from Claude, with tools to list, read, edit, and sync files via Git.Last updatedMIT
- Alicense-qualityCmaintenanceEnables Claude and AI agents to read and edit Overleaf documents in real time, with support for project listing, document manipulation, LaTeX compilation, and live collaboration.Last updated1397MIT
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Read, edit, publish, and preview your pepita websites from Claude.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NVCLong/Overleaf-Connector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server