Labsco
tamirSida logo

Overleaf MCP server

β˜… 14

from tamirSida

allow Tools like copilot, claude desktop, claude code etc. perform CRUD operations on overleaf projects via git int

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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

CategoryToolDescription
Createcreate_projectCreate new Overleaf projects from LaTeX content or ZIP files
create_fileAdd new files to existing projects
Readlist_projectsView all configured projects
list_filesList files with optional extension filter
read_fileRead file contents
get_sectionsParse LaTeX structure (chapters, sections, subsections)
get_section_contentGet full content of a specific section
list_historyView git commit history
get_diffCompare changes between versions
Updateedit_fileSurgical edit - replace specific text (old_string β†’ new_string)
rewrite_fileReplace entire file contents
update_sectionUpdate a specific LaTeX section by title
sync_projectPull latest changes from Overleaf
Deletedelete_fileRemove 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

Environment Variables

VariableDefaultDescription
OVERLEAF_CONFIG_FILEoverleaf_config.jsonPath to configuration file
OVERLEAF_TEMP_DIR./overleaf_cacheLocal cache directory for git repos
OVERLEAF_PROJECT_ID-Default project ID (single-project mode)
OVERLEAF_GIT_TOKEN-Default git token (single-project mode)
OVERLEAF_GIT_AUTHOR_NAMEOverleaf MCPGit commit author name
OVERLEAF_GIT_AUTHOR_EMAILmcp@overleaf.localGit commit author email

How It Works

Copy & paste β€” that's it
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     MCP Protocol     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Assistant   │◄───────────────────►│  Overleaf MCP   β”‚
β”‚ (Claude, etc.)  β”‚                      β”‚     Server      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                  β”‚
                                                  β”‚ Git (HTTPS)
                                                  β–Ό
                                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                         β”‚    Overleaf     β”‚
                                         β”‚   Git Server    β”‚
                                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Clone/Pull: Server clones or pulls the latest from Overleaf's Git endpoint
  2. Local Operations: Read/write operations happen on local cache
  3. Commit/Push: Changes are committed and pushed back to Overleaf
  4. Real-time Sync: Overleaf reflects changes immediately in the web editor

Security Notes

  • Tokens are sensitive: Git tokens provide full read/write access
  • Never commit secrets: overleaf_config.json is gitignored by default
  • Use environment variables: For CI/CD or shared environments
  • Token rotation: Regenerate tokens periodically in Overleaf settings

Contributing

Contributions are welcome! Please open an issue or submit a pull request.


License

MIT License - see LICENSE for details.


Acknowledgments