
A Model Context Protocol (MCP) server that provides full CRUD operations for Overleaf LaTeX projects. Enables AI assistants to read, edit, create, and delete files in your Overleaf projects.
概览
A Model Context Protocol (MCP) server that provides full CRUD operations for Overleaf LaTeX projects. Enables AI assistants to read, edit, create, and delete files in your Overleaf projects. - : Uses Overleaf's Git integration for reliable sync - : Configure and switch between multiple projects - : Understands document structure for section-based operations - : All write operations commit and push to Overleaf immediately - : Fast access with local repository cache - Python 3.10+ - Git - Overleaf account with Git integration (requires paid plan) 3. : - Click (top-left) - Click under "Sync" - Click (if not already generated) - Copy the URL: https://git:[email protected]/... - Extract the token (the part between git: and @) Create overleaf_config.json in the project directory: - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Windows: %APPDATA%\Claude\claude_desktop_config.json - Linux: ~/.config/Claude/claude_desktop_config.
README
以下为原文 README 节选,完整内容请查看原文。
Overleaf MCP Server
A Model Context Protocol (MCP) server that provides full CRUD operations for Overleaf LaTeX projects. Enables AI assistants to read, edit, create, and delete files in your Overleaf projects.
Features
14 Tools for Complete Project Management
| Category | Tool | Description |
|---|---|---|
| Create | create_project |
Create new Overleaf projects from LaTeX content or ZIP files |
create_file |
Add new files to existing projects | |
| Read | list_projects |
View all configured projects |
list_files |
List files with optional extension filter | |
read_file |
Read file contents | |
get_sections |
Parse LaTeX structure (chapters, sections, subsections) | |
get_section_content |
Get full content of a specific section | |
list_history |
View git commit history | |
get_diff |
Compare changes between versions | |
| Update | edit_file |
Surgical edit - replace specific text (old_string → new_string) |
rewrite_file |
Replace entire file contents | |
update_section |
Update a specific LaTeX section by title | |
sync_project |
Pull latest changes from Overleaf | |
| Delete | delete_file |
Remove files from projects |
Key Capabilities
- Git Integration: Uses Overleaf’s Git integration for reliable sync
- Multi-Project Support: Configure and switch between multiple projects
- LaTeX-Aware: Understands document structure for section-based operations
- Auto-Push: All write operations commit and push to Overleaf immediately
- Local Caching: Fast access with local repository cache
Installation
Prerequisites
- Python 3.10+
- Git
- Overleaf account with Git integration (requires paid plan)
Install with pip
# Clone the repository
git clone https://github.com/YOUR_USERNAME/overleaf-mcp.git
cd overleaf-mcp
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install
pip install -e .
Install with uv (faster)
git clone https://github.com/YOUR_USERNAME/overleaf-mcp.git
cd overleaf-mcp
uv venv
source .venv/bin/activate
uv pip install -e .
Configuration
Step 1: Get Your Overleaf Credentials
-
Open your Overleaf project in the browser
-
Get Project ID from the URL:
https://www.overleaf.com/project/YOUR_PROJECT_ID ^^^^^^^^^^^^^^^^ -
Get Git Token:
- Click Menu (top-left)
- Click Git under “Sync”
- Click Generate token (if not already generated)
- Copy the URL:
https://git:[email protected]/... - Extract the token (the part between
git:and@)
Step 2: Create Configuration File
Create overleaf_config.json in the project directory:
{
"projects": {
"my-thesis": {
"name": "My PhD Thesis",
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"overleaf": {
"command": "/path/to/overleaf-mcp/.venv/bin/python",
"args": ["-m", "overleaf_mcp.server"],
"cwd": "/path/to/overleaf-mcp",
"env": {
"OVERLEAF_CONFIG_FILE": "/path/to/overleaf-mcp/overleaf_config.json",
"OVERLEAF_TEMP_DIR": "/path/to/overleaf-mcp/overleaf_cache"
}
}
}
}