varennes-ecofin/MCP-latex-server
If you are the rightful owner of MCP-latex-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP LaTeX Server is a Python-based server designed for users of TeX Live and MikTeX who want to integrate AI into their LaTeX workflow, specifically on Windows systems.
MCP LaTeX Server - Windows Installation
This MCP LaTeX server, coded in Python, is intended for TeX Live and MikTeX users wishing for a deeper AI integration in their use of LaTeX. The installation is documented for Windows with Claude Desktop as an example, but it also works on Mac with other AIs.
📍 Locations on your system
- MCP Server:
C:\Users\username\Documents\MCP\latex-server\ - LaTeX Projects:
C:\Users\username\Documents\LaTeX\ - Claude Config:
C:\Users\username\AppData\Roaming\Claude\claude_desktop_config.json
⚡ Manual Installation
-
Create the directories:
mkdir C:\Users\username\Documents\MCP\latex-server mkdir C:\Users\username\Documents\LaTeX -
Install dependencies:
cd C:\Users\username\Documents\MCP\latex-server pip install mcp aiofiles -
Copy the server:
- Place
mcp_latex_server.pyinC:\Users\username\Documents\MCP\latex-server\
- Place
-
Configure Claude Desktop:
- Edit
C:\Users\username\AppData\Roaming\Claude\claude_desktop_config.json - Add:
{ "mcpServers": { "latex-server": { "command": "python", "args": [ "C:\\Users\\username\\Documents\\MCP\\latex-server\\mcp_latex_server.py", "--workspace", "C:\\Users\\username\\Documents\\LaTeX" ] } } }
- Edit
-
Restart Claude Desktop
✅ Verification
Quick test in Claude Desktop
Type into Claude:
"Create a test.tex file with an article template"
If it works, Claude will create C:\Users\username\Documents\LaTeX\test.tex
Command line test
cd C:\Users\username\Documents\MCP\latex-server
python mcp_latex_server.py --workspace C:\Users\username\Documents\LaTeX
📂 Final Structure
C:\Users\username\
├── Documents\
│ ├── MCP\
│ │ └── latex-server\
│ │ ├── mcp_latex_server.py # Main server
│ │ └── README.md # This file
│ │
│ └── LaTeX\ # Your projects
│ ├── Articles\
│ ├── Presentations\
│ └── (your .tex files)
│
└── AppData\
└── Roaming\
└── Claude\
└── claude_desktop_config.json # Configuration
🎯 Daily Usage
Essential commands in Claude
| Action | Command in Claude |
|---|---|
| Create a document | "Create article.tex with article template" |
| Read a file | "Read my thesis.tex file" |
| Compile | "Compile main.tex with pdflatex" |
| Validate | "Check the syntax of document.tex" |
| Organize | "Organize my LaTeX files" |
| Clean up | "Clean up auxiliary files" |
| Change directory | "Change the working directory to ..." |
Recommended Workflows
New article:
"Create an article on AI with mathematical support""Compile the article"
Existing project:
- Copy your project into
C:\Users\username\Documents\LaTeX\my-project\ "List the files in my-project""Compile my-project/main.tex"
🔧 Troubleshooting
The server does not load
- Verify that Claude Desktop has been properly closed and restarted
- Check the JSON config file (be careful with commas and quotes)
"python not recognized" error
- Add Python to the system PATH
- Or use the full path:
"command": "C:\\Python312\\python.exe" - If the error persists, opt for a virtual environment and add the PATH to the JSON config
LaTeX compilation error
- Check that MiKTeX or TeX Live is installed
- Test
pdflatex --versionin cmd
📞 Support
- Logs: In Claude Desktop, Ctrl+Shift+I → Console
- Test:
mcp_latex_server.pyin the server folder - Debug: Add
"--log-level", "DEBUG"in the args of the JSON config
MCP LaTeX Server v1.0.0 Server path: C:\Users\username\Documents\MCP\latex-server LaTeX Workspace: C:\Users\username\Documents\LaTeX