Skip to main content
Glama

cstcloud-latex-mcp

MCP Server for editing LaTeX projects on latex.cstcloud.cn from any IDE.

A Model Context Protocol (MCP) server and VS Code / Antigravity extension that lets you manage, edit, compile, and bidirectionally sync your CSTCloud LaTeX projects directly from VS Code, Cursor, Antigravity, and any other MCP-compatible editor.

VS Code Extension

Search CSTCloud LaTeX (or nowhere.cstcloud-latex) in the VS Code Extensions Marketplace (or Open VSX), or install directly from:

Related MCP server: overleaf-bridge

Features

  • 📋 List Projects — Browse all your LaTeX projects

  • 📁 File Tree — View the full file/folder structure of any project

  • 📖 Read Files — Read .tex, .bib, .cls, and other source files

  • ✏️ Write Files — Edit and save file content back to the cloud

  • 🔨 Compile — Trigger remote LaTeX compilation (pdflatex, xelatex, lualatex)

  • 📊 Compile Logs — Get structured error/warning reports from build logs

Quick Start

  1. Visit latex.cstcloud.cn and log in

  2. Open DevTools (F12) → Application → Cookies

  3. Copy the value of the overleaf.sid cookie

2. Configure Your IDE

VS Code / Cursor

Add to your MCP settings (.vscode/mcp.json or user settings):

{
  "mcpServers": {
    "cstcloud-latex": {
      "command": "npx",
      "args": ["cstcloud-latex-mcp"],
      "env": {
        "CSTCLOUD_COOKIE": "your-overleaf.sid-cookie-value"
      }
    }
  }
}

Antigravity

Add to your MCP configuration:

{
  "mcpServers": {
    "cstcloud-latex": {
      "command": "npx",
      "args": ["cstcloud-latex-mcp"],
      "env": {
        "CSTCLOUD_COOKIE": "your-overleaf.sid-cookie-value"
      }
    }
  }
}

3. Start Using

Once configured, your AI assistant can use these tools:

Tool

Description

list_projects

List all your LaTeX projects

get_project_files

Get the file tree of a project

read_file

Read a document's content

write_file

Update a document's content

compile_project

Trigger remote LaTeX compilation

get_compile_log

Get compilation errors and warnings

start_sync

Start real-time bidirectional sync to a local folder

stop_sync

Stop an active bidirectional sync session

sync_status

Inspect active sync sessions and logs

4. Bidirectional Sync (Open in IDE)

Sync any CSTCloud project to a local folder and open it directly in your IDE:

# Continuous bidirectional sync
CSTCLOUD_COOKIE="your-cookie" node dist/index.js sync <projectId> ./my-paper

# One-shot reconciliation
CSTCLOUD_COOKIE="your-cookie" node dist/index.js sync <projectId> ./my-paper --once

Or ask your AI assistant to call start_sync with project_id and local_dir. Sync metadata is stored in ~/.cstcloud-sync/, and IDE/LaTeX temporary files are ignored by default (customizable via .cstcloudignore).

Example conversation:

You: "Show me my LaTeX projects on CSTCloud"

AI: (calls list_projects) "You have 3 projects: ..."

You: "Open the main.tex file in my thesis project and fix the bibliography errors"

AI: (calls get_project_files → read_file → write_file → compile_project → get_compile_log)

Environment Variables

Variable

Required

Description

CSTCLOUD_COOKIE

✅

Your overleaf.sid session cookie

CSTCLOUD_BASE_URL

❌

Custom server URL (default: https://latex.cstcloud.cn)

Development

# Clone the repo
git clone https://github.com/YOUR_USERNAME/cstcloud-latex-mcp.git
cd cstcloud-latex-mcp

# Install dependencies
npm install

# Build
npm run build

# Run locally
CSTCLOUD_COOKIE="your-cookie" node dist/index.js

Roadmap

  • Project listing and file tree

  • Document read/write

  • Remote compilation and log parsing

  • Bidirectional file sync (local ↔ cloud)

  • PDF download/preview

  • Multi-server support

License

MIT

Available Tools

10 tools
compile_projectA

Trigger a remote LaTeX compilation for a CSTCloud project. Returns the compilation status (success/failure) and a list of output files. After compiling, use get_compile_log to see detailed error messages.

Inputs: project_id (required), compiler.

configure_authA

Save and verify your CSTCloud LaTeX session cookie (overleaf.sid) to ~/.cstcloud-sync/config.json so all CSTCloud tools and bidirectional sync work without editing mcp_config.json.

Inputs: cookie (required), base_url.

get_compile_logA

Get the compilation log from the most recent LaTeX build of a CSTCloud project. Returns both the raw log text and parsed error/warning entries with file and line information. Call compile_project first to trigger a compilation.

Inputs: project_id (required), raw.

get_project_filesA

Get the file tree (all files and folders) of a CSTCloud LaTeX project. Returns a flat list of files with their IDs, names, types (doc/file), and full paths. You need the file ID from this list to read or write specific files.

Inputs: project_id (required).

list_projectsA

List all LaTeX projects on your CSTCloud (latex.cstcloud.cn) account. Returns project names, IDs, last-updated timestamps, and owner info. Use this to discover available projects before reading or editing files.

Inputs: no named parameters.

read_fileA

Read the content of a document (.tex, .bib, .cls, .sty, etc.) in a CSTCloud LaTeX project. Returns the full text content of the file. Use get_project_files first to find the file ID.

Inputs: file_id (required), project_id (required).

start_syncA

Start real-time bidirectional sync between a CSTCloud LaTeX project and a local folder, so you can open and edit the project directly in your IDE. Performs an initial sync immediately and keeps syncing in the background.

Inputs: local_dir (required), project_id (required), setup_ide_task.

stop_syncB

Stop an active bidirectional sync session for a CSTCloud LaTeX project.

Inputs: project_id (required).

sync_statusA

Get the status, statistics, and recent sync logs for active CSTCloud bidirectional sync sessions.

Inputs: project_id.

write_fileA

Write (replace) the content of a document in a CSTCloud LaTeX project. This replaces the entire file content with the provided text. WARNING: If another user is editing the same file simultaneously, changes may conflict. Use read_file first to get the current content, then modify and write back.

Inputs: content (required), file_id (required), project_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource or lifecycle stage: listing projects, inspecting a file tree, reading/writing a single file, compiling, fetching logs, and the start/stop/status of sync sessions. The hierarchy (list_projects -> get_project_files -> read_file) is explained in descriptions, so an agent can pick the right tool without confusion.

    Naming Consistency4/5

    Nearly all tools follow a snake_case verb_noun pattern (list_projects, get_project_files, read_file, write_file, compile_project, get_compile_log, start_sync, stop_sync, configure_auth). The only deviation is sync_status, which is noun-only rather than verb_noun, a minor inconsistency within an otherwise predictable set.

    Tool Count5/5

    Ten tools is well within the ideal range and each earns its place, covering project discovery, file operations, compilation, diagnostics, auth, and sync. There is no obvious redundancy or padding in the set.

    Completeness3/5

    The surface covers reading and replacing file content plus compilation and sync, but there is no way to create a new project, create a new file, or delete/rename files, so write_file only fully serves existing documents. These are notable gaps that would cause dead ends for common project-setup and cleanup workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers