From 6aea514b38a8b36882d39aec30fd12e997f82611 Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 15 Mar 2026 04:02:40 -0500 Subject: Add MCP compile debugging tools: get_compile_errors, get_compile_warnings, get_compile_log New MCP tools for agents to debug LaTeX compilation: - get_compile_errors: parsed errors with file paths and line numbers - get_compile_warnings: parsed warnings with locations - get_compile_log: full raw log with optional tail parameter - compile_latex: improved to fetch log via CDN URL, return error summary Log parsing uses the same Overleaf-style parser as the PdfViewer component. Updated CLAUDE.md template with compile-debug workflow documentation. Co-Authored-By: Claude Opus 4.6 --- src/main/index.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/main/index.ts') diff --git a/src/main/index.ts b/src/main/index.ts index 0956774..2be5ab8 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -670,13 +670,26 @@ You have MCP tools to interact with Overleaf. Use them proactively. ### Project - **list_project_files**: List all files with sizes. -- **compile_latex**: Trigger LaTeX compilation. Pass \`main_file\` if needed. -### Comment Workflow +### Compilation +- **compile_latex**: Trigger LaTeX compilation on Overleaf server. Returns status + error summary. +- **get_compile_errors**: Get parsed errors from last compile (file, line, message). +- **get_compile_warnings**: Get parsed warnings from last compile. +- **get_compile_log**: Get full raw log. Pass \`tail: N\` for last N lines only. + +### Workflows + +#### Comment Workflow 1. Use \`get_comments\` to see what reviewers have flagged 2. Edit the .tex files to address the feedback 3. Use \`reply_to_comment\` to explain what you changed 4. Use \`resolve_comment\` to mark it as done + +#### Compile-Debug Workflow +1. Edit .tex files +2. Use \`compile_latex\` to compile +3. If errors: use \`get_compile_errors\` for details, fix them, recompile +4. If warnings: use \`get_compile_warnings\` to review `).catch(() => {}) // Write .claude/settings.json to auto-allow MCP tools mkdirAsync(join(tmpDir, '.claude'), { recursive: true }).then(() => @@ -691,7 +704,10 @@ You have MCP tools to interact with Overleaf. Use them proactively. 'mcp__lattex__get_chat_messages', 'mcp__lattex__send_chat_message', 'mcp__lattex__list_project_files', - 'mcp__lattex__compile_latex' + 'mcp__lattex__compile_latex', + 'mcp__lattex__get_compile_errors', + 'mcp__lattex__get_compile_warnings', + 'mcp__lattex__get_compile_log' ] } }, null, 2)) -- cgit v1.2.3