OverleafMCP

mcp
Guvenlik Denetimi
Basarisiz
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 114 GitHub stars
Code Basarisiz
  • child_process — Shell command execution capability in overleaf-git-client.js
  • exec() — Shell command execution in overleaf-git-client.js
  • process.env — Environment variable access in overleaf-git-client.js
  • fs module — File system access in overleaf-git-client.js
  • exec() — Shell command execution in overleaf-mcp-server.js
  • process.env — Environment variable access in overleaf-mcp-server.js
Permissions Gecti
  • Permissions — No dangerous permissions requested
Purpose: This server provides a bridge for AI assistants to read, analyze, and write to Overleaf LaTeX projects via Git integration.

Security Assessment: Overall risk is High. The server is inherently designed to execute shell commands, failing automated checks for using `child_process` and `exec()` in both its Git client and main server files. It also accesses environment variables and the file system to clone and manage local repositories. While there are no hardcoded secrets, users must manually configure sensitive Overleaf Git tokens in a `projects.json` file, which could be accidentally committed. Additionally, because it provides an AI with a `write_file` tool that automatically pushes changes via Git, a prompt injection or hallucinated AI command could easily overwrite or destroy project data.

Quality Assessment: The project is active and reliable, with a recent push recorded today and over 100 GitHub stars, indicating solid community trust. However, it currently lacks an open-source license, which means strict legal rights to use, modify, or distribute the code are undefined.

Verdict: Use with caution. While functional and actively maintained, it requires high trust in your AI client and demands careful handling of your Overleaf Git tokens due to its aggressive file-write and shell execution capabilities.
SUMMARY

Model Context Protocol (MCP) server that lets AI assistants read Overleaf projects, parse LaTeX document structure, and push section-level edits back via Git. Compatible with Claude Desktop, Cursor, Windsurf, and any MCP client.

README.md

Overleaf MCP Server

An MCP (Model Context Protocol) server that provides access to Overleaf projects via Git integration. This allows Claude and other MCP clients to read LaTeX files, analyze document structure, extract content, and write files from and to Overleaf projects.

Features

  • 📄 File Management: List, read, and write files from and to Overleaf projects
  • 📋 Document Structure: Parse LaTeX sections and subsections
  • 🔍 Content Extraction: Extract specific sections by title
  • 📊 Project Summary: Get overview of project status and structure
  • 🏗️ Multi-Project Support: Manage multiple Overleaf projects

Installation

  1. Clone this repository

  2. Install dependencies:

    npm install
    
  3. Set up your projects configuration:

    cp projects.example.json projects.json
    
  4. 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

  1. Git Token:

    • Go to Overleaf Account Settings → Git Integration
    • Click "Create Token"
  2. Project ID:

    • Open your Overleaf project
    • Find it in the URL: https://www.overleaf.com/project/[PROJECT_ID]

Claude Desktop Setup

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

List all configured projects.

list_files

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

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

read_file

Read a specific file from the project.

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

get_sections

Get all sections from a LaTeX file.

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

get_section_content

Get content of a specific section.

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

status_summary

Get a comprehensive project status summary.

  • projectName: Project identifier (optional)

write_file

Write the full content of a file to the project.

  • filePath: Path to the file (required)
  • content: Content to write to the file (required)
  • commitMessage: Commit message (required)
  • projectName: Project identifier (optional)

write_section

Write the content of a specific section to the project.

  • filePath: Path to the file (required)
  • sectionTitle: Title of the section (required)
  • newContent: Replacement content for the section, including the section heading (required)
  • commitMessage: Commit message (required)
  • projectName: Project identifier (optional)

Usage Examples

# List all projects
Use the list_projects tool

# Get project overview
Use status_summary tool

# Read main.tex file
Use read_file with filePath: "main.tex"

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

# List all sections in a file
Use get_sections with filePath: "main.tex"

# Write the full content of a file to the project
Use write_file with filePath: "main.tex", content: "...", commitMessage: "..."

# Write the content of a specific section to the project
Use write_section with filePath: "main.tex", sectionTitle: "Introduction", newContent: "\\section{Introduction}\n...", commitMessage: "..."

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"

File Structure

OverleafMCP/
├── overleaf-mcp-server.js    # Main MCP server
├── overleaf-git-client.js    # Git client library
├── projects.json             # Your project configuration (gitignored)
├── projects.example.json     # Example configuration
├── package.json              # Dependencies
└── README.md                 # This file

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

License

MIT License

Yorumlar (0)

Sonuc bulunamadi