官方说明LaTeX MCP Server An **MCP (Model Context Protocol) server** that can supercharge your VSCode + LaTex Workshop writing workflow Currently houses MCP tools, and new tools can be easily added in either Python and TypeScript.
配置模板(请按你的客户端调整)
claude mcp add latex-mcp-server -- npx -y latex-mcp-server
An **MCP (Model Context Protocol) server** that can supercharge your VSCode + LaTex Workshop writing workflow Currently houses MCP tools, and new tools can be easily added in either Python and TypeScript. The Python process is the MCP server; selected tools are delegated to a small Node/TypeScript module via a bridge. LaTex MCP Server + Copilot/Claude/Cursor, what can you do? - Read your cited papers, verify / add onto your claims - Access your python scripts to generate new figures / latex tables based on your experiment data, and **place them into latex autonomously** - Can verify every step and ensure your pdf compiles - Functionally it can autonomously take your outline + experimental results and turn it into a paper (may looks like slop though) Your browser does not support the video tag. --- Python Tools - **list_tex_files** Lists all .tex files under your LaTeX workspace (relative paths). Useful for LLMs or agents to discover available chapters and sections. - **read_file** Reads a text or binary-safe slice of a file given a relative path inside the workspace. Supports specifying a maximum number of bytes to return. - **extract_bibliography** Parses a BibTeX file and returns structured entry metadata, including download URLs (DOI, arXiv). Helps agents or scripts work with citation data programmatically. - **download_bibliography** Downloads PDFs for bibliography entries listed in resources/cited_papers/index.json. Can force re-downloads and limit the number of new downloads. - **compile_latex** Runs LaTeX compilation (pdflatex/xelatex via latexmk) on the main document and returns success plus a log snippet. Supports specifying the entry .tex file and number of passes. - **read_pdf** Extracts text and metadata from a PDF filepath using pypdf, with page and character limits. Stores a JSON artifact for downstream use. - **read_pdf_from_citation** Resolves a citation key via resources/cited_papers/index.json to its PDF and extracts text (auto-downloads if needed). Returns extracted text, metadata, and the citation key. --- TypeScript Bridge Tools - **summarize_text** Produces a concise natural language summary of provided LaTeX or text content. Accepts a maximum sentence count for the summary. - **suggest_bib_key** Suggests a stable BibTeX key based on authors, year, and title metadata. Useful for generating consistent citation keys. --- Install (with uv) From the repository root: or This will make the console script latex-mcp-server available on your PATH. > If you prefer a one-off run without installing as a tool: > > MCP Configuration Snippet Add to your mcp.json (VS Code / Claude Desktop user settings): If you omit --workspace, the server will infer the current working directory. Windows example On Windows (PowerShell / Bash), if your paper_1 root is at C:\Users\User\projects\paper_1, use: Forward slashes are fine; they avoid the need to escape backslashes. Be sure to replace the placeholder ABSOLUTE_PATH_TO_YOUR_PAPER_1_ROOT — leaving a placeholder like WORKSPACE_FOLDER_PATH will cause the runtime error: Alternative: Install once, then call directly After running: You can simplify the config to: Troubleshooting | Symptom | Cause | Fix | |---------|-------|-----| | No solution found when resolving tool dependencies | The tool name latex-mcp-server isn’t published on PyPI and uv tried to resolve it as a dependency (often happens if you used a config field like requires or didn’t install locally) | Run uv tool install -e ./latex-mcp-server from repo root, then update your mcp.json to invoke the installed script directly |