Overleaf MCP server logo

Overleaf MCP server

Community
tamirSida

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

PublishertamirSida
Repositoryoverleaf_MCP
LanguagePython
Forks
7
Stars
17
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Overleaf MCP server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    17 stars and 7 forks from the linked repository.

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

Installation

Prerequisites

  • Python 3.10+
  • Git
  • Overleaf account with Git integration (requires paid plan)

Install with pip

bash
# 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)

bash
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

  1. Open your Overleaf project in the browser

  2. Get Project ID from the URL:

    https://www.overleaf.com/project/YOUR_PROJECT_ID
                                     ^^^^^^^^^^^^^^^^
  3. Get Git Token:

    • Click Menu (top-left)
    • Click Git under "Sync"
    • Click Generate token (if not already generated)
    • Copy the URL: https://git:YOUR_TOKEN@git.overleaf.com/...
    • Extract the token (the part between git: and @)

Step 2: Create Configuration File

Create overleaf_config.json in the project directory:

json
{
  "projects": {
    "my-thesis": {
      "name": "My PhD Thesis",
      "projectId": "abc123def456",
      "gitToken": "olp_xxxxxxxxxxxxxxxxxxxx"
    },
    "paper": {
      "name": "Research Paper",
      "projectId": "xyz789ghi012",
      "gitToken": "olp_yyyyyyyyyyyyyyyyyyyy"
    }
  },
  "defaultProject": "my-thesis"
}

Alternative: Environment Variables

For single-project setups:

bash
export OVERLEAF_PROJECT_ID="your_project_id"
export OVERLEAF_GIT_TOKEN="your_git_token"

Client Configuration

Claude Desktop

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

json
{
  "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"
      }
    }
  }
}

Example (macOS):

json
{
  "mcpServers": {
    "overleaf": {
      "command": "/Users/username/dev/overleaf-mcp/.venv/bin/python",
      "args": ["-m", "overleaf_mcp.server"],
      "cwd": "/Users/username/dev/overleaf-mcp",
      "env": {
        "OVERLEAF_CONFIG_FILE": "/Users/username/dev/overleaf-mcp/overleaf_config.json",
        "OVERLEAF_TEMP_DIR": "/Users/username/dev/overleaf-mcp/overleaf_cache"
      }
    }
  }
}

After saving, restart Claude Desktop (Cmd+Q / Ctrl+Q, then reopen).


Claude Code (CLI)

Add to your Claude Code MCP settings (~/.claude/settings.json):

json
{
  "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"
      }
    }
  }
}

Or add per-project in .claude/settings.json in your project directory.


VS Code (with Claude Extension)

Add to your VS Code settings (settings.json):

json
{
  "claude.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"
      }
    }
  }
}

Or add to workspace settings (.vscode/settings.json) for project-specific config.


Usage Examples

Once configured, you can ask the AI assistant:

Reading Files

"List all .tex files in my thesis"
"Read the content of main.tex"
"What sections are in chapter1.tex?"

Editing Content

"Edit main.tex and replace 'teh' with 'the'"
"Rewrite the abstract.tex file with this new content: ..."
"Update the 'Introduction' section with this new content: ..."

Creating Files

"Create a new file called appendix.tex with a section for supplementary materials"
"Add a new bibliography file references.bib"

Project Management

"Show me the last 10 commits"
"What changed since yesterday?"
"Sync the project to get latest changes"

Section-Based Operations

"Get the content of the 'Methods' section"
"Update the 'Results' section with these findings: ..."
"What subsections are in chapter 2?"

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

┌─────────────────┐     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

Troubleshooting

"No projects configured"

  • Ensure overleaf_config.json exists and has valid JSON
  • Check OVERLEAF_CONFIG_FILE points to the correct path

"Permission denied" or "Read-only filesystem"

  • Set OVERLEAF_TEMP_DIR to an absolute writable path
  • Ensure the cache directory exists and is writable

"Authentication failed"

  • Verify your git token is correct
  • Check if the token has expired (regenerate in Overleaf)
  • Ensure you have Git integration enabled (requires paid Overleaf plan)

"Server not appearing in Claude"

  • Restart Claude Desktop completely (Cmd+Q / Ctrl+Q)
  • Check the config JSON is valid (no trailing commas)
  • Verify Python path is correct (use absolute path to venv)

Contributing

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


License

MIT License - see LICENSE for details.


Acknowledgments

Use Overleaf MCP server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Overleaf MCP server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Overleaf MCP server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Overleaf MCP server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "tamirsida-overleaf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Overleaf MCP server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Overleaf MCP server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Overleaf MCP server to help me with this task?
Overleaf MCP server
Sure. I read it.
Here is what I found using Overleaf MCP server.

Frequently asked questions

What is the Overleaf MCP server MCP server used for?

Overleaf MCP server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Overleaf MCP server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Overleaf MCP server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Overleaf MCP server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Overleaf MCP server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Overleaf MCP server MCP to TypingMind?

Overleaf MCP server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Overleaf MCP server MCP provide in TypingMind?

Overleaf MCP server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Overleaf MCP server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Overleaf MCP server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇