
Overleaf Mcp Server
io.github.YounesBensafiav0.1.0更新于 Oct 11, 2026
MCP server for managing Overleaf projects through Git synchronization.
概览
让助手通过 Git 同步列出、读取、写入和编辑 Overleaf LaTeX 项目中的文件。
- 功能
- 通过 Git 将 MCP 客户端连接到 Overleaf 项目,并在本地保留项目镜像。工具包括 list_files、read_file(可用 offset 和 limit 分块读取大文档)、write_file、edit_file 和 sync_project。写入操作会在本地提交并推送回 Overleaf,因此助手的修改会出现在项目中。
- 适用场景
- 适合希望助手直接读取或修改 Overleaf 项目 LaTeX 源文件、而不必手动复制粘贴的场景,例如起草章节、修改文字或审阅论文。前提是项目已启用 Git,且你接受助手提交并推送更改。
- 运行要求
- 以 stdio 方式在本地运行;需要 Python 3.13+ 和 uv 包管理器。需要支持 Git 集成的 Overleaf 套餐、项目 ID,以及通过 OVERLEAF_TOKEN 和 PROJECT_ID 提供的 Git 集成令牌(project_id 也可在每次调用时传入)。需要访问 Overleaf 的 Git 远程仓库。
安装
在 SourceWeft 中
- 打开 控制台中的 Overleaf Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Overleaf MCP Server
An MCP server for managing Overleaf projects through Git synchronization.
What This Server Does
- Connects MCP-compatible clients to your Overleaf project through Git sync.
- Exposes file-level tools to list, read, write, and sync project content.
- Keeps workflow simple: pull latest files, edit, then push back to Overleaf.
Architecture
Tool Workflow
Requirements
- Python 3.13+
uvpackage manager- An Overleaf plan with Git integration (individual, group, or institution license). Check if your institution provides free access at Overleaf for Institutions - use your institutional email. If your institution is not listed, upgrade your plan.
Git Setup
- Enable Git - open your project on Overleaf → Menu → enable Git under Integrations.
- Copy project ID - from the browser URL (e.g.
https://www.overleaf.com/project/69a4f7cc4eaf13bd56de5b04→69a4f7cc4eaf13bd56de5b04). - Generate a Git token - Account Settings → Git integration authentication tokens → Generate new token.
- Configure
.env- copy.env.exampleto.envand fill in:
project_idcan also be passed per tool call, butPROJECT_IDis still required by the server configuration.
The Overleaf Git token is account-wide credential material. Store it only in
the MCP client's environment or a protected .env file, and rotate it if it
is exposed.
Safety Notes
Files in an Overleaf project are untrusted input. A .tex file or project
configuration can contain instructions aimed at the model; treat file contents
as data, not as commands. Keep OVERLEAF_ALLOWED_PROJECTS restricted to the
projects the server should be able to access:
The default allowlist contains only PROJECT_ID.
Quick Start
Without a checkout, run the Git version directly with:
Plain uvx overleaf-mcp is appropriate only after the project is published to
PyPI.
The server listens on stdio - connect your MCP client (Claude Desktop, etc.) to it.
For a large project, call sync_project first. The initial Git clone can take
longer than an MCP client's individual tool request timeout.
Available Tools
read_file accepts optional zero-based offset and bounded limit line
parameters for reading large documents in chunks.
Claude Desktop Setup
Add to ~/.config/Claude/claude_desktop_config.json:
Troubleshooting
- 403 Forbidden on git operations:
- Your plan doesn't include Git integration - follow the Git Setup section.
- Or the Git token is wrong - regenerate it at Account Settings → Git integration authentication tokens.
- Wrong project content:
- Set the correct
PROJECT_IDin.env. - Or pass
project_idexplicitly in tool calls.
- Set the correct
- Sync conflicts:
- Run
sync_projectbeforewrite_fileif the remote changed.
- Run
- Server not starting:
- Ensure dependencies are installed with
uv sync. - Verify Python 3.13+ is available.
- Ensure dependencies are installed with
License
MIT - See LICENSE
来源:README.md,提交 6235b52
工具
0版本历史
1- v0.1.0最新Oct 11, 2026


