web-latex-mcp
v0.4.0
Published
MCP server to read, edit, compile, and commit LaTeX in a git-hosted project (Overleaf, GitHub, any git remote).
Maintainers
Readme
WebLatexMCP
Read, edit, compile, and commit LaTeX in any git-hosted project — straight from Claude.
[!WARNING] Public beta — very early development. WebLatexMCP is now public, but it's in its early stages and under active development. Expect bugs, rough edges, and incomplete features. Editing and git operations touch real projects, so review diffs before you push. Please report anything you run into — bug reports and feedback are hugely welcome.
An MCP server that lets Claude read, edit, compile, and commit LaTeX in a git-hosted project —
Overleaf, GitHub, or any git remote. It keeps a local clone, compiles locally (TeX Live +
latexmk, or tectonic) so you see errors and PDFs without round-tripping, and sends changes back through an explicit
commit → push you review first. Works with Claude Desktop and Claude Code over stdio, on
macOS, Linux, and Windows.
Highlights
- 🗂️ Multi-project — Overleaf, GitHub, or any git remote, side by side, each with its own credentials.
- ✏️ Surgical edits — atomic, exact-match string replacements; read with optional line ranges.
- 🧪 Local compiles —
latexmk(ortectonic) runs on your machine and returns structured errors/warnings + the PDF. - 👀 Live PDF viewer + review comments — a local viewer that hot-reloads on every compile (a browser window, or a VS Code tab); select text in the PDF to leave notes, and Claude applies them at the right source line via SyncTeX.
- 🔍 Reviewable pushes —
commitandpushare separate; nothing leaves your machine implicitly. - 👥 Parallel sessions — run a session per section on one clone; each commits only its own edits, so nobody sweeps up anyone else's half-written paragraph.
- 🔐 Tokens stay in memory — never written to
.git/config, and scrubbed from all output. - 🧩 Bundled Claude Code skills — project cleanup, DBLP citation audits, bibliography normalization.
Install
Pick your client below. Either way, editing, git, and the PDF viewer work without TeX — only compile
needs latexmk (default) or tectonic on your PATH.
Claude Code (CLI or the VS Code extension)
Install the plugin — it registers the server and the skills in every session, from any directory:
# In Claude Code:
/plugin marketplace add elias-ramzi/WebLatexMCP
/plugin install web-latex-mcp@web-latex-toolsPrefer just the server? Register the npm package in one line (skills still come through as prompts):
claude mcp add web-latex-mcp --scope user -- npx -y web-latex-mcp💡 Launch Claude Code from your paper's own repo so the LaTeX clone lands right beside your code. The step-by-step VS Code quickstart is the most-tested path.
Claude Desktop — one-click extension
Download web-latex-mcp.mcpb from the
latest release and drag it onto the Claude
Desktop window (or Settings → Extensions → Install Extension). No cloning, building, or JSON editing —
Desktop shows a short, all-optional form (tokens, clone folder). See the
Desktop Extension guide.
Add your token and your project — from the chat
However you installed, the server needs a token for your git host — for Overleaf, a Git authentication token from Account Settings → Git integration. The private way to hand it over, which never puts the token in the chat: ask Claude to open the credential portal.
👽 Open the credential portal for my Overleaf token.
credential_portal opens a local 127.0.0.1 page where you type the token; it goes straight into your
OS keychain, never through the conversation. (Happy to paste it once instead? set_credential stores
it in the keychain in a single step.)
Then add your project by just giving Claude the git URL — it registers it with register_project, and it
persists across restarts and sessions:
👽 Add my Overleaf project https://git.overleaf.com/… and call it "thesis".
Other clients & full configuration
Prefer env vars (WEB_LATEX_MCP_PROJECTS, per-host tokens, workspace, compiler), or using Gemini /
GitHub Copilot? It's all in the docs: Configuration · per-OS guides for
macOS / Linux / Windows ·
Gemini · Copilot.
What you can do
Once connected, ask Claude to work on your project — it drives these tools:
- Add a project from the chat — paste a git URL and Claude registers it (
register_project), persisted across restarts and sessions — no env config needed (details). - Sync & browse — clone/pull a project, list and read files.
- Edit — create, overwrite, or make surgical string-replacement edits to
.texfiles. - Compile — run
latexmk(ortectonic) locally and get back structured errors, warnings, and a clickablefile://link to the PDF. For TikZ externalization, opt in per compile withrestrictedShellEscape(preferred) orshellEscape— both default off and never auto-enabled, since-shell-escapelets a.texrun arbitrary commands (details). - Cite — search DBLP and add verified BibTeX entries (
.bibfiles are protected from hand-edits — see Citations). - Review & push — inspect
status/diff, commit, then push safely (rebase, never force; conflicts come back to you with both sides, and you resolve them by pushing the merged content back — or rewind the clone to the current remote withreset_to_remoteand redo your edits cleanly).
See the full tool reference.
Skills
Task-specific skills that drive the tools — each stops at the diff, so nothing is committed or pushed unless you ask:
/format-latex-project— split the main file into per-section\inputs, move each figure/table into its own\inputfile, and reflow to one sentence per line./arxiv-clean-project— run arxiv-latex-cleaner to strip comments and draft macros (\todo, notes) for arXiv, as a separate submission copy or applied in place./verify-citations— audit every.bibentry against DBLP, flag discrepancies, and write a local git-excluded audit report (read-only for the.bib)./format-bibliography— deduplicate, normalize cite keys, harmonize venues, propagate renames into\cites./summarize-paper— write/update a small local summary of the paper (git-excluded) so future sessions start fast.
How you get them depends on the client:
- Claude Code — install the plugin (or launch Claude Code from a clone of this repo). Claude picks a skill up on its own when your request matches it.
- Any MCP client — nothing to install. Every skill is also registered as an MCP prompt, so it
ships with the server; pick it from the client's prompt menu (in Claude Desktop, the
+in the composer) instead of typing/. - Claude Desktop / claude.ai, for the same automatic behavior Claude Code gets — upload the skills to
your account: zip each folder under
.claude/skills/, then upload them under Customize → Skills → + → Create skill. Needs a paid plan with code execution enabled, and an uploaded copy is a snapshot, so re-upload when a skill changes.
See the skills guide for what each skill does, step-by-step installation, and the two ways a skill runs.
Documentation
- Configuration — environment variables, per-host token resolution, in-context guides, cross-platform notes.
- Tools — full tool reference, the DBLP citation flow, and how safe pushes work.
- Skills — what each bundled skill does, how to install it per client, and the two ways one runs.
- Concurrency — how the server pushes without clobbering edits made elsewhere, and how parallel sessions share one clone.
- Writing guide — the LaTeX style conventions surfaced to the client.
- Contributing — how to build, test, and open a pull request.
Contributing
This repo accepts pull requests — bug reports, feature ideas, docs fixes, and code changes are all welcome. See CONTRIBUTING.md for how to get set up, run the local gate, and open a PR.
A note on maturity: this project is largely vibe-coded, so treat it as best-effort rather than battle-tested. Robustness isn't guaranteed — expect rough edges, and please report them. It has been mostly tested on these setups: VS Code + Claude Code extension, the Claude Code CLI, and Claude Desktop for macOS.
License
MIT
