interleaf
Syncs the paper with git repositories: clones, pulls, pushes, history; commits record agent/author/mode; merges adjacent edits; no force push.
Syncs the paper with GitHub repositories via git; uses normal git login; pull/push/history.
Syncs the paper with GitLab repositories via git; uses normal git login; pull/push/history.
Verifies citations against NASA ADS; checks missing references, wrong DOI/year, preprints since published.
Syncs with Overleaf projects via Git or native editor services; provides tools for projects, files, edits, comments, track changes, compilation, history, and suggestions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
interleaf
People and agents writing one LaTeX paper together. interleaf is an MCP server: Claude Code, Codex, Cursor or any other MCP client gets tools to sync the paper, propose edits that a co-author accepts or rejects, and check what an agent wrote before anyone reads it. The paper lives on Overleaf (cloud or self-hosted) or in any git repository, such as GitHub or GitLab. One binary, nothing to configure.
Suggestion mode (default). Edits reach the shared copy as
\sgadd{new},\sgdel{old},\sgrep{new}{old}, tagged with the author's initials and coloured in the PDF. Changed equations, figures and headings keep the old version as comments and get an[XY edit]tag. Co-authors accept or reject suggestions by hand or withresolve. Works with AASTeX, AGU and plain article classes.Sync with people editing at the same time. Edits on adjacent lines merge. A real clash changes nothing and shows both versions. Push never forces.
Checks for agent-written text.
cite_checkverifies every cited reference against NASA ADS (missing, wrong DOI, wrong year, preprint since published).checkflags unsupported claims and machine-like phrasing, besides refs, labels, graphics and journal limits (AAS, AGU, PNAS, Nature, Science).Numbers and figures with their source.
number_setwrites a value from a JSON result file intonumbers.tex, andnumbersreports values that no longer match.add_figure/figuresdo the same for figures.Review pack.
reviewproduces a latexdiff PDF of everything that changed since a date or commit, with the commits and words per section.
Setup
The Git workflow below needs git and TeX Live (latexmk, latexdiff) for compile and review.
Overleaf Git projects need Overleaf's Git integration. For editor services without Git, see
native Overleaf collaboration.
Install:
cargo install interleaf.Register it with your client:
claude mcp add interleaf -s user -- interleafFor Codex, add to
~/.codex/config.toml:[mcp_servers.interleaf] command = "interleaf"Tokens, in the environment or the system keychain:
OVERLEAF_GIT_TOKEN: Overleaf, Account Settings → Git Integration → Generate token. Not needed for GitHub or GitLab, which use your normal git login.ADS_TOKEN(forcite_checkandcite_add): https://ui.adsabs.harvard.edu → Account → Settings → API Token.
security add-generic-password -U -a "$USER" -s overleaf-git-token -w # macOS security add-generic-password -U -a "$USER" -s ads-api-token -w secret-tool store --label=overleaf-git-token service overleaf-git-token # Linux secret-tool store --label=ads-api-token service ads-api-token
Then give the agent the paper: an Overleaf link, or a git URL. The first call clones it into the
working folder. Inside a clone of an Overleaf project, or of a repository with an interleaf.toml,
no link is needed. Suggestions carry the initials of your git user.name.
Related MCP server: texchronicle
Personal settings (optional)
~/.config/interleaf/config.toml names projects and overrides settings:
name = "Your Name"
initials = "YN" # tag on your suggestions
default = "paper"
[projects.paper] # an Overleaf project
id = "<id from the Overleaf URL>"
dir = "~/papers/paper" # local clone, made on first use
results = "~/research/paper" # where number_set looks for result files
[projects.notes] # any other git remote
git_url = "git@github.com:you/notes.git"
dir = "~/papers/notes"
mode = "direct" # your own drafts: edits go in unmarkedFor a self-hosted Overleaf, give both id and its git_url. Without results, number_set reads
result files relative to the working folder.
Project rules (shared)
An interleaf.toml file in the paper's repository applies to everyone who works on it:
journal = "apjl" # apj apjl agu grl pnas nature science
mode = "suggest" # or "direct"
protected = ["abstract.tex"] # agents may not push changes to these
[lint]
ignore = ['\bclearly\b']
extra = ['\bvery unique\b']A mode in your personal settings overrides the project's. The built-in wording rules and journal
limits are in src/rules.toml.
Tools
tool | |
| sync; |
| document map with word counts; one section's source |
| consistency, wording, journal limits, pending suggestions; local build with errors at file:line |
| ADS verification; add a reference by DOI, arXiv id, bibcode or ADS query |
| values from result files, and which have gone stale |
| figures from local files, and which have been regenerated |
| list pending suggestions; accept or reject them by author, file or line range |
| latexdiff PDF since a date or commit |
Notes
Every commit says which agent made it, for whom, and in which mode (
Agent: claude-code for Your Name). In Overleaf's own history it appears under the token owner.Overleaf comments and Track Changes are not carried by Git. Suggestion mode uses LaTeX markup; the native backend is described below.
Before submission, accept or reject all suggestions.
checkreports any that are left. Then delete the suggestion block from the preamble.interleaf keeps its build output, review PDFs and figure sources in the clone's
.git/interleaf/.Tests:
cargo test. The end-to-end test runs against a local bare repository that stands in for the remote, with a second clone acting as the co-author.
Native Overleaf collaboration
The Rust backend provides 33 canonical native tools and two
compatibility helpers. It uses Overleaf's editor services directly, without
overleaf-mcp-native, Node, npm, a Python adapter or a worker browser. The Git
workflow above remains separate.
Login and scope
With Fridica, the owner signs in once:
fridica overleaf-auth login --expected-email owner@example.com
# For a self-hosted Overleaf / Community Edition installation:
fridica overleaf-auth login --base-url https://overleaf.example.org --expected-email owner@example.comPasswords and MFA stay in the owner's isolated Chrome/Chromium window. Later logins reuse the verified session in the OS credential store. The configured origin is explicit; a stored session is never silently retargeted to another host. Native server operations themselves run in Rust.
Existing sessions keep their seven previously authorized operations. The owner can opt into the expanded tool capabilities without logging in again:
fridica overleaf-auth grant --allThis changes tool capabilities only. It cannot widen the saved account, project, channel, recipient or expiry restrictions. Normal task admission, approvals and workspace confinement still apply.
A task may discover projects, search and read while unbound, within its saved
scope. Every project call names an explicit project_id. Before a project
mutation, Fridica must confirm that project for the requesting thread; changing
a tool argument does not bind a different paper. Account-level project creation
requires an unbound task with unrestricted account/project scope.
Native tools
The names below include the native_ prefix used by the Rust MCP server.
Capability | Canonical tools | Behavior |
Connection and projects (3) |
| Check the connection, discover accessible papers and inspect project metadata |
Find and read (3) |
| Navigate the tree, search text, read text/version or binary content |
Create and organize (7) |
| Create projects and manage project entities; upload paths remain confined |
Edit text (2) |
| Minimal full-file diffs or exact replacements; tracking |
Comments (9) |
| Read/filter review threads and manage exact comments/messages |
Track Changes (4) |
| Filter pending records, change only your own switch, review precise selections |
Cloud build (3) |
| Request an Overleaf cloud build, inspect its log and locate labels |
Native history (2) |
| Inspect Overleaf history and file differences |
The two additional helpers are native_suggest_edit, the pending-only exact
replacement alias, and native_compile_local, a local TeX build from a verified
live-text snapshot and exported assets. native_compile uses Overleaf's cloud
compiler; it is not the local snapshot helper. Local compilation needs TeX Live
and latexmk, and local fonts/packages can differ from the server. Snapshot
assets are not certified as one atomic Overleaf export.
Safe editing and review
Read the current file first:
{"project_id":"0123456789abcdef01234567","path":"main.tex"}Pass the returned version to native_find_and_replace, for example:
{
"project_id":"0123456789abcdef01234567",
"path":"main.tex",
"old_string":"the old approximation",
"new_string":"the revised approximation",
"expected_version":95,
"track":"on",
"operation_id":"dcd3d917-b8bc-4c47-83b5-5bfd02567b8c"
}native_edit_file accepts complete new_content; replace_all is available for
exact replacements. Version checks remain strict. Existing pending suggestions
must survive unchanged apart from predicted position shifts; edits that touch
them are refused. A server-side tracking switch can override track:"off";
the result reports effective tracking instead of silently changing that switch.
Legacy native_suggest_edit always requests pending tracked changes.
Accept/reject requires precise change IDs or explicit filters/all, with exact
versions for every selected document. Message edits/deletes check the original
body or its SHA256. Edits are limited to your own messages; deleting another
author's message requires an explicit project-owner request. Thread deletion
checks every original message body.
Every mutation requires a stable operation_id UUID. Keep that ID and its
arguments when checking the receipt. The backend records intent before writing;
a repeated call reads the receipt instead of resubmitting. Lost acknowledgements,
concurrent edits and incomplete readback remain state:"uncertain" and an MCP
error. Reconcile by reading the file, pending records or thread. Partial results
are retained; there is no automatic replay or destructive rollback. Preserve
receipt state when moving execution hosts.
Embedding and validation
Rust hosts use login, an in-memory NativeSession bound to the verified
identity, and serve_native with a per-call authorization callback.
serve_with_native additionally exposes the separate Git tools. Explicit HTTPS
origins support cloud and self-hosted deployments; loopback HTTP is for local
development/test setups. Credentials are never forwarded across origins.
mcp-name: io.github.happysky19/interleaf
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Create and revise structured scientific papers in real LaTeX. Compatible with Overleaf.
Overleaf alternative online LaTeX editor. AI agents edit, comment, and chat. Keep or revert edits.
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Collaborative LaTeX editor: edit, compile and share PDFs, with full version history.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to edit LaTeX documents with a live PDF preview, source editor, and PDF-anchored comments that become edit instructions. Requires no local TeX install, using a WASM TeX engine.798 npm5AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables agents to compile LaTeX documents, manage anchored comments as actionable review tasks, inspect section-level history, and view diff images in a live workspace.AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants such as Gemini, Claude, and ChatGPT to read, search, edit, compile, and review LaTeX files in your actual Overleaf projects, with versioned and atomic multi-file changes. Edits are published straight to Overleaf, so changes appear in the browser within seconds.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read and precisely edit LaTeX projects, review diffs, sync with Overleaf and GitHub, and compile locally or online with returned PDFs and diagnostics.3MIT