Overleaf MCP server

Integrates with Overleaf LaTeX projects through Git access to read, analyze, and navigate academic papers and documents with file listing, content retrieval, document structure parsing, and multi-project support for academic writing workflows and research paper analysis.
Back to servers
Setup instructions
Provider
mjyoo2
Release date
Jul 02, 2025
Stats
13 stars

Overleaf MCP Server provides access to Overleaf projects via Git integration, allowing Claude and other MCP clients to read LaTeX files, analyze document structure, and extract content. It bridges the gap between AI assistants and your LaTeX documents stored in Overleaf.

Installation

Basic Setup

  1. Clone the repository:
git clone https://github.com/username/OverleafMCP.git
cd OverleafMCP
  1. Install dependencies:
npm install
  1. Create your projects configuration:
cp projects.example.json projects.json
  1. Edit projects.json with your Overleaf credentials:
{
  "projects": {
    "default": {
      "name": "My Paper",
      "projectId": "YOUR_OVERLEAF_PROJECT_ID",
      "gitToken": "YOUR_OVERLEAF_GIT_TOKEN"
    }
  }
}

Getting Overleaf Credentials

Git Token:

  • Go to Overleaf Account Settings → Git Integration
  • Click "Create Token"

Project ID:

Claude Desktop Integration

Add to your Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/claude/claude_desktop_config.json
{
  "mcpServers": {
    "overleaf": {
      "command": "node",
      "args": [
        "/path/to/OverleafMCP/overleaf-mcp-server.js"
      ]
    }
  }
}

Restart Claude Desktop after configuration.

Available Tools

list_projects

Lists all configured projects.

list_files

Lists files in a project (default: .tex files).

Parameters:

  • extension: File extension filter (optional)
  • projectName: Project identifier (optional, defaults to "default")

read_file

Reads a specific file from the project.

Parameters:

  • filePath: Path to the file (required)
  • projectName: Project identifier (optional)

get_sections

Gets all sections from a LaTeX file.

Parameters:

  • filePath: Path to the LaTeX file (required)
  • projectName: Project identifier (optional)

get_section_content

Gets content of a specific section.

Parameters:

  • filePath: Path to the LaTeX file (required)
  • sectionTitle: Title of the section (required)
  • projectName: Project identifier (optional)

status_summary

Gets a comprehensive project status summary.

Parameters:

  • projectName: Project identifier (optional)

Usage Examples

Basic Operations

To list all projects:

Use the list_projects tool

To get a project overview:

Use status_summary tool

To read the main.tex file:

Use read_file with filePath: "main.tex"

To get the Introduction section:

Use get_section_content with filePath: "main.tex" and sectionTitle: "Introduction"

To list all sections in a file:

Use get_sections with filePath: "main.tex"

Multi-Project Usage

To work with multiple projects, add them to projects.json:

{
  "projects": {
    "default": {
      "name": "Main Paper",
      "projectId": "project-id-1",
      "gitToken": "token-1"
    },
    "paper2": {
      "name": "Second Paper", 
      "projectId": "project-id-2",
      "gitToken": "token-2"
    }
  }
}

Then specify the project in tool calls:

Use get_section_content with projectName: "paper2", filePath: "main.tex", sectionTitle: "Methods"

Security Notes

  • projects.json is gitignored to protect your credentials
  • Never commit real project IDs or Git tokens
  • Use the provided projects.example.json as a template

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "overleaf" '{"command":"node","args":["/path/to/OverleafMCP/overleaf-mcp-server.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "overleaf": {
            "command": "node",
            "args": [
                "/path/to/OverleafMCP/overleaf-mcp-server.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "overleaf": {
            "command": "node",
            "args": [
                "/path/to/OverleafMCP/overleaf-mcp-server.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later