AI Assistant Guide

Connect AI Terminals (MCP)

Hand your LaTeX Agent projects to Claude Code, Cursor, and other AI terminals.

What this is

LaTeX Agent ships an MCP (Model Context Protocol) tool server: Claude Code, Cursor, and other AI terminals can read and write your project files, trigger cloud compiles and fetch the PDF, search literature, read your paper library, and process review comments — say "compile my paper" in the terminal and the loop completes end to end.

File read/writeCloud compile → PDFSyncTeX jumpsLiterature searchPaper libraryReview commentsIn-place feedback

Prerequisite: API tokens are available to paid subscribers only (free/trial tiers cannot mint one).

Step 1: Mint an API token

Create a token under Profile → API Token (it looks like lxa_... and the plaintext is shown exactly once), ticking scopes per this table:

ScopeGrantsNotes
project:writeProject file read/write (edit, overwrite, append)Recommended default; the write foundation besides compile
compile:runTrigger cloud compiles and fetch the PDFTick it separately for compiles (least-privilege recommendation)
papers:readRead the paper library (listing and page-by-page text)Not implied by project:write
review:read / review:writeReview comments read-only / reply and resolveTick when working through advisor comments; review:read to read, review:write to act

Tokens can be revoked at any time; revocation takes effect immediately.

Step 2: Connect your client

Pick one of the three mainstream setups (the domain below is generated from the site you are on — after copying, replace lxa_YOUR_TOKEN with your token):

Claude Code (CLI)
claude mcp add --transport http latex-agent https://your-site/mcp --header "X-API-Key: lxa_YOUR_TOKEN"
Cursor (~/.cursor/mcp.json)
{
  "mcpServers": {
    "latex-agent": {
      "url": "https://your-site/mcp",
      "headers": {
        "X-API-Key": "lxa_YOUR_TOKEN"
      }
    }
  }
}
Generic Streamable HTTP (JSON)
{
  "transport": "streamable-http",
  "url": "https://your-site/mcp",
  "headers": {
    "X-API-Key": "lxa_YOUR_TOKEN"
  }
}

Authentication always goes through the X-API-Key header; do not use the web session's Bearer token.

Step 3: Use it

Most tools need a project_id — it is the value of the ?project= parameter in the project URL in your browser (a short id); paste it to the AI. Then try saying:

Example prompt
Safety and limits

An API key is write access to the project's main branch — save a version on the web first before major changes, or have the AI snapshot a version before each big edit.

If a token leaks, revoke it from your profile immediately — it takes effect at once.

Compiles are long-running; some clients impose timeouts — just retry on timeout.

Team and shared projects are supported: tools follow your project role (viewer/commenter/editor/owner) and report clearly when a role is not enough; your API key's scopes still apply separately.