
robertodure/mcp-latex-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
大規模なランゲージモデルとAIアシスタント用の高度なLaTeXファイル作成、編集、管理機能を提供する包括的なモデルコンテキストプロトコル(MCP)サーバー.
概要
LaTeXファイル作成、編集、検証、コンパイル用のモデルコンテキストプロトコル(MCP)サーバー。 型安全、構造化された出力のためのFastMCPおよびPydanticと造られる。 - パラメータまたはバンドルされたテンプレート(粒子、ビーム、レポート)からLaTeX文書 - 置換、インサート、およびプレペンド操作のファイル - および安全なベースディレクトリ内の.texファイル - 構文 - 括弧、環境、参照、要求された宣言 - pdflatex、xelatex、またはlualatexでPDFへ - - Rapidx://経由でバンドルされたテンプレートをブラウズして取得する ログイン - - (コンパイル用): - Windows: MiKTeX または TeX ライブ - macOS: MacTeX (brew install --cask mactex) - Linux: sudo apt install texlive-full (Debian/Ubuntu) または sudo dnf install texlive-scheme-full (Fedora) これは、Pythonのバージョンを確認し、依存関係をインストールし、サーバーのインポートを正しく確認し、オプションでClaude Desktopを設定します。 サーバは単一の環境変数を使用します。 ツールに渡されるすべてのファイルパスは、このベースディレクトリに相対的に解決されます.
概要(AI 翻訳)
LaTeXファイル作成、編集、検証、コンパイル用のモデルコンテキストプロトコル(MCP)サーバー。 型安全、構造化された出力のためのFastMCPおよびPydanticと造られる。
##特徴
-**LaTeX ドキュメントをパラメーターやバンドルされたテンプレートから作成する(粒子、ビーム、レポート)
- Edit ファイルを置換、インサート、追加、およびプリペンド操作
-Readとlist [
.tex]安全なベースディレクトリ内のファイル - Validate 構文 — 括弧、環境、参照、必須宣言
pdflatex, [xelatex], [lualatex]でPDFにコンパイル**- Resources — [[
latex://]]を介してバンドルされたテンプレートを閲覧および取得する ログイン
前提条件
- Python 3.11.9+
- LaTeXの配分 (コンパイルのために):
- Windows: MiKTeX か TeX の生きている
- macOS: MacTeX (
brew install --cask mactex) - Linux:
sudo apt install texlive-full(Debian/Ubuntu) または [[[T7] (Fedora)
インストール
uv の使用 (推奨)
##pip の使用
###クイックセットアップ(Windows)
これは、Pythonのバージョンを確認し、依存関係をインストールし、サーバーのインポートを正しく確認し、オプションでClaude Desktopを設定します。
設定
サーバは単一の環境変数を使用します
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
MCP LaTeX Server
A Model Context Protocol (MCP) server for LaTeX authoring: create and edit documents, analyze multi-file projects, validate structure and references, run quality checks, inspect PDFs, and compile to PDF. Built with FastMCP/MCPServer and Pydantic for structured tool output.
Highlights
- Author article, report, book, letter, beamer, and minimal documents.
- Transact multiple edits atomically, snapshot and restore files, and edit named sections.
- Build custom templates with YAML metadata and double-brace variables.
- Analyze multi-file projects: includes, labels, references, bibliographies, and duplicate labels.
- Compile single files or whole projects with bibtex/biber sequencing, conditional reruns, timeouts, and optional latexmk.
- Check braces, environments, references, word counts, TODOs, chktex, latexindent, and spelling.
- Inspect PDF metadata, page counts, text, and optional page renders.
- Support MCP Python SDK 1.x and 2.x.
Requirements
- Python 3.11.9+
- MCP Python SDK 1.x or 2.x: mcp[cli]>=1.9.4
- LaTeX distribution for compilation only:
- Windows: MiKTeX or TeX Live
- macOS: MacTeX
- Linux: texlive-full or texlive-scheme-full
- Optional external tools, detected at runtime:
- chktex, latexindent, hunspell or aspell
- latexmk, bibtex, biber
- poppler utilities (pdftoppm) for PDF page rendering
- Python dependencies: pydantic, pyyaml, pypdf.
Editing, reading, listing, validation, project analysis, word counts, and PDF reading do not require LaTeX to be installed. Tools that need an external binary report available=false or a clear install hint instead of failing the server.
Installation
Using uv
git clone https://github.com/RobertoDure/mcp-latex-server
cd mcp-latex-server
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
Using pip
git clone https://github.com/RobertoDure/mcp-latex-server
cd mcp-latex-server
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -e ".[dev]"
Quick setup
python scripts/quick_setup.py
The setup script checks Python, installs dependencies, verifies the server, and optionally writes a Claude Desktop configuration. Existing configs are backed up and malformed JSON is left untouched.
Entry points
After installation, launch the server with any of:
mcp-latex-server
python -m mcp_latex_server
python latex_server.py # compatibility shim
The canonical packaged entry point is mcp-latex-server. The root latex_server.py stays as a compatibility shim for existing MCP client configurations.
Docker
A container image is included for the server runtime. It does not include a TeX distribution; extend the image or mount a TeX installation if you need compilation inside the container.
docker build -t mcp-latex-server .
docker run --rm -i \
インストール
docker run --rm -i \設定
{
"mcpServers": {
"latex-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-latex-server",
"run",
"mcp-latex-server"
],
"env": {
"LATEX_SERVER_BASE_PATH": "/path/to/your/latex/files"
}
}
}
}