/ Directory / Playground / OverleafMCP
● Community mjyoo2 🔑 Needs your key

OverleafMCP

by mjyoo2 · mjyoo2/OverleafMCP

Read and edit Overleaf LaTeX projects from Claude — section-level edits pushed via the Git bridge, no web UI required.

OverleafMCP connects Claude to Overleaf via Overleaf's Git integration. Claude can list project files, parse LaTeX structure (sections, citations, figures), and push surgical edits back. Designed for academics and technical writers who'd rather iterate from their editor than fight Overleaf's web textarea.

Why use it

Key features

Live Demo

What it looks like in practice

overleaf-mcp.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "overleaf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mjyoo2/overleaf-mcp"
      ],
      "env": {
        "OVERLEAF_PROJECT_URL": "https://www.overleaf.com/project/<id>",
        "OVERLEAF_GIT_TOKEN": "your_overleaf_git_token"
      }
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "overleaf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mjyoo2/overleaf-mcp"
      ],
      "env": {
        "OVERLEAF_PROJECT_URL": "https://www.overleaf.com/project/<id>",
        "OVERLEAF_GIT_TOKEN": "your_overleaf_git_token"
      }
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "overleaf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mjyoo2/overleaf-mcp"
      ],
      "env": {
        "OVERLEAF_PROJECT_URL": "https://www.overleaf.com/project/<id>",
        "OVERLEAF_GIT_TOKEN": "your_overleaf_git_token"
      }
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "overleaf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mjyoo2/overleaf-mcp"
      ],
      "env": {
        "OVERLEAF_PROJECT_URL": "https://www.overleaf.com/project/<id>",
        "OVERLEAF_GIT_TOKEN": "your_overleaf_git_token"
      }
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "overleaf-mcp",
      "command": "npx",
      "args": [
        "-y",
        "@mjyoo2/overleaf-mcp"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "overleaf-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@mjyoo2/overleaf-mcp"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add overleaf-mcp -- npx -y @mjyoo2/overleaf-mcp

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use OverleafMCP

Tighten a paper section without leaving Claude

👤 Researchers, technical writers ⏱ ~20 min intermediate

When to use: Reviewer 2 said section 3 is verbose — you have 30 minutes to fix it.

Prerequisites
  • Overleaf paid tier with Git access — Account → Account Settings → Git authentication
Flow
  1. Locate
    Use Overleaf MCP. Find section 3 in main.tex. Show me current text.✓ Copied
    → Section text returned with line range
  2. Rewrite
    Tighten this 30%. Keep technical terms intact. Don't drop citations.✓ Copied
    → Shorter rewrite preserving cites
  3. Push
    Replace section 3 with the rewrite. Commit with message 'Tighten §3 per reviewer 2'.✓ Copied
    → Git push succeeded; project re-renders in Overleaf

Outcome: Edits land in Overleaf; you didn't touch the web UI.

Pitfalls
  • Concurrent edits from co-author cause merge — Pull before push; resolve conflicts in Claude with diff context
Combine with: filesystem

Audit citations in a paper

👤 Authors finalizing a manuscript ⏱ ~15 min beginner

When to use: Pre-submission — you want to be sure every \cite has a matching .bib entry.

Flow
  1. Inventory
    List every \cite{} key in main.tex. Cross-check against refs.bib.✓ Copied
    → Match table; orphans flagged
  2. Fix
    For each orphan key, suggest the closest match from .bib or mark as missing.✓ Copied
    → Per-orphan recommendation

Outcome: Zero broken citations before you click Submit.

Pitfalls
  • Citations inside comments still match — Strip LaTeX comments before regex

Move sections around with confidence

👤 Authors restructuring chapters ⏱ ~30 min advanced

When to use: Section flow is off; you want to swap sections 2 and 4.

Flow
  1. Map
    Show me the section tree of main.tex with line ranges.✓ Copied
    → Hierarchical tree
  2. Reorder
    Swap section 2 with section 4. Update internal references (\ref) accordingly.✓ Copied
    → Swap done; refs verified

Outcome: Restructured paper compiles clean.

Pitfalls
  • Forward references break — Compile after reorder; Claude can read errors and fix

Combinations

Pair with other MCPs for X10 leverage

overleaf-mcp + filesystem

Local backup of paper before structural edits

Snapshot the project to /papers/backup/ before any structural changes.✓ Copied
overleaf-mcp + github

Mirror to GitHub for issue-tracked review

Push the same commits to my GitHub mirror so co-authors can leave PR comments.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
list_files (none) Discover project layout free
read_file path Pull a .tex / .bib for inspection free
parse_structure path Outline before editing free
edit_section path, section_id, new_text Surgical replacement free
git_push message Persist edits to Overleaf free

Cost & Limits

What this costs to run

API quota
Overleaf Git is rate-limited (be reasonable)
Tokens per call
500–10000 depending on file size
Monetary
Free MCP; Overleaf paid tier required for Git
Tip
Read sections, not whole files, when iterating

Security

Permissions, secrets, blast radius

Minimum scopes: Overleaf Git token — repo-level read/write
Credential storage: OVERLEAF_GIT_TOKEN env var
Data egress: git.overleaf.com
Never grant: Token access to other people's projects

Troubleshooting

Common errors and fixes

Authentication failed during git_push

Token may be expired; regenerate in Overleaf settings

Verify: git ls-remote with the same URL+token
Tree-sitter LaTeX errors on parse

Some macros confuse the parser; fall back to read_file + manual scope

Push rejected (non-fast-forward)

Co-author pushed; pull first, resolve, push again

Alternatives

OverleafMCP vs others

AlternativeWhen to use it insteadTradeoff
VimTeX / TeXShop locallyYou don't need cloud sync at allNo Overleaf collab
Overleaf web editorLight edits onlyNo agent access; manual

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills