MCP Server
July 2, 2026 · View on GitHub
@aloth/olcli ships an MCP (Model Context Protocol) server so AI assistants like Claude Desktop, Cursor, and Windsurf can interact with your Overleaf projects directly.
MCP Tools
| Tool | Description |
|---|---|
list_projects | List all Overleaf projects |
get_project_info | Get file tree and metadata for a project |
pull_project | Download and extract a project to a local directory |
push_file | Upload a local file to a project |
compile | Compile a project and get the PDF URL |
download_pdf | Compile a project and save the PDF locally |
list_comments | List review comments (filter: all / open / resolved) |
get_entities | Get a flat list of all files in a project |
download_file | Download a specific file by its remote path |
add_comment | Add a review comment to a document |
reply_to_comment | Reply to an existing comment thread |
resolve_comment | Mark a comment thread as resolved |
delete_entity | Delete a file or document by path |
rename_entity | Rename a file or document |
compile_with_outputs | Compile and return all output files (PDF, BBL, logs…) |
Authentication
The MCP server reads credentials in this order:
OVERLEAF_SESSIONenvironment variable — set in your MCP config (recommended)OVERLEAF_EMAIL+OVERLEAF_PASSWORDenvironment variables — for password login (self-hosted).olauthfile in cwd — written byolcli auth- Stored config — written by
olcli auth(including saved password credentials)
When a session cookie expires and password credentials are available, the MCP server automatically re-authenticates.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"overleaf": {
"command": "npx",
"args": ["-y", "@aloth/olcli-mcp"],
"env": {
"OVERLEAF_SESSION": "<your-overleaf-session-cookie>"
}
}
}
}
Or if you have olcli installed globally (npm install -g @aloth/olcli):
{
"mcpServers": {
"overleaf": {
"command": "olcli-mcp",
"env": {
"OVERLEAF_SESSION": "<your-overleaf-session-cookie>"
}
}
}
}
Cursor
Add to your Cursor MCP settings (~/.cursor/mcp.json or project .cursor/mcp.json):
{
"mcpServers": {
"overleaf": {
"command": "npx",
"args": ["-y", "@aloth/olcli-mcp"],
"env": {
"OVERLEAF_SESSION": "<your-overleaf-session-cookie>"
}
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"overleaf": {
"command": "npx",
"args": ["-y", "@aloth/olcli-mcp"],
"env": {
"OVERLEAF_SESSION": "<your-overleaf-session-cookie>"
}
}
}
}
Getting Your Session Cookie
- Open Overleaf in your browser and log in
- Open DevTools → Application (Chrome) or Storage (Firefox) → Cookies
- Find
overleaf_session2(orsharelatex.sidfor self-hosted) - Copy the value — that's your
OVERLEAF_SESSION
Or run olcli auth and then the MCP server will pick it up automatically.
Self-hosted Overleaf
Set OVERLEAF_BASE_URL in your MCP env:
"env": {
"OVERLEAF_SESSION": "<cookie>",
"OVERLEAF_BASE_URL": "https://overleaf.yourcompany.com"
}