Overview
Sarmate exposes an MCP server (Model Context Protocol) that gives external AI clients access to your LaTeX drive.
- URL :
https://mcp.sarmate.net/mcp - Transport : Streamable HTTP / SSE
- Auth : Bearer token (
Authorization: Bearer smt_xxx) - Plan : All plans (free included), within the compilation quota — unlimited compilation via MCP: Pro / Etab
- Rate limit : 60 req/min/IP
- Token limit : 10 active tokens per account
Per-client setup
smt_VOTRE_TOKEN — replace it manually with your real token. Never type your token into a form on a public page (phishing risk, including via fake clones of this page). Create an account to generate a token.
Step-by-step — choose your AI and follow the matching instructions.
Or jump directly to per-client tabs
Claude Desktop (Mac / Windows / Linux)
Claude Desktop does not speak HTTP natively. You need the mcp-remote bridge (requires Node.js) which converts stdio transport to HTTP.
File to edit:
- macOS :
~/Library/Application Support/Claude/claude_desktop_config.json - Windows :
%APPDATA%\Claude\claude_desktop_config.json - Linux :
~/.config/Claude/claude_desktop_config.json
Content (merge with other existing MCP servers if any):
Claude.ai (Web / iOS / Android) Coming soon
Claude.ai (Web/iOS/Android) is not supported yet.
Unlike Claude Desktop and Claude Code, Claude.ai requires full OAuth 2.1 authentication, which the Sarmate MCP server has not implemented yet (Bearer token auth only for now). OAuth is on our roadmap.
In the meantime, Claude Desktop or Claude Code give you exactly the same MCP capabilities, with the same Anthropic AI behind.
Claude Code (CLI) — full step-by-step
-
Get your token from the Sarmate file manager
In file_manager.php, click the MCP icon top-right → New token. Optionally restrict access to a subfolder or set read-only. Copy the token (starts withsmt_) — it's shown only once. -
Open Claude Code and ask it to configure the server
In a terminal:claudeOnce the session is open, paste this prompt with the JSON config and press Enter — Claude Code handles the rest:Please add this MCP server to my Claude Code config: { "mcpServers": { "sarmate": { "httpUrl": "https://mcp.sarmate.net/mcp", "headers": { "Authorization": "Bearer smt_VOTRE_TOKEN" } } } }Claude Code will run the appropriateclaude mcp addcommand or edit its config file directly. For advanced users who want to skip the conversational step, the equivalent direct command:claude mcp add --transport http sarmate https://mcp.sarmate.net/mcp --header "Authorization: Bearer smt_VOTRE_TOKEN". -
Reload the session so the server is loaded
Inside the Claude Code session (still open) — type:/exitBack in the shell terminal — restart with:claude --continueResumes the previous session AND reloads the MCP config. Without a reload, Claude Code won't see the new server — tool lists are fetched only on startup. -
Check the connection
claude mcp listYou should seesarmate ✓ Connectedin the list. -
Test the tool
In the session, ask Claude Code to interact with your drive — it now has access:> List my .tex files, open main.tex, fix the errors and compile it.Claude Code will chainlist_files→read_file→write_file→compile→get_compile_logautonomously, until the build is clean. You see each call in real time in the side panel.
Cursor
Cursor speaks HTTP natively (no bridge needed). Edit:
~/.cursor/mcp.json(global).cursor/mcp.json(per project)
Also possible via Cursor Settings → MCP → Add Server.
Cline (VS Code)
In VS Code: Cline sidebar → MCP Servers → Configure MCP Servers, then paste:
Continue (VS Code)
Add this block to your ~/.continue/config.yaml:
ChatGPT (Developer Mode, beta)
Beta feature. Plus / Pro = read-only; write tools restricted to Business / Enterprise / Edu accounts.
- Settings → Apps → Advanced settings → Developer mode
- Create app
- URL :
https://mcp.sarmate.net/mcp - Transport : Streamable HTTP
- Auth : Custom header →
Authorization: Bearer smt_VOTRE_TOKEN
Gemini CLI
Quick method (CLI already installed):
Manually, in ~/.gemini/settings.json:
Le Chat (Mistral) — 🇫🇷 EU
Le Chat (Mistral's LLM, EU-hosted) supports custom MCP connectors directly from the web UI — no config file to edit.
- Open chat.mistral.ai — the left-hand sidebar is visible by default.
- Intelligence → Connectors → + Add Connector.
- Select the Custom MCP Connector tab, then fill in:
- Connector name (large title at top — required) :
Sarmate - Connector server :
https://mcp.sarmate.net/mcp - Description (optional) :
Sarmate.net - Authentication method: API token authentication
- Header name :
Authorization· Header type :Bearer - Header value :
smt_VOTRE_TOKEN(token only — no "Bearer" prefix)
- Connector name (large title at top — required) :
- Create — the connector is usable immediately, no restart needed.
Available on all Le Chat plans (Free / Pro / Student). Sarmate × Le Chat = fully European stack (Mistral France + Sarmate O2Switch / Ionos France), ideal for universities and researchers with GDPR / sovereignty requirements.
Mistral docs: docs.mistral.ai/le-chat/.../mcp-connectors
Other MCP client
Generic configuration for any MCP client supporting streamable HTTP + Bearer:
- URL :
https://mcp.sarmate.net/mcp - Transport : Streamable HTTP / SSE
- Auth header :
Authorization: Bearer smt_VOTRE_TOKEN
For stdio-only clients (no HTTP), use mcp-remote as a bridge:
Available tools
11 tools available. Tags: Read safe, always allowed — Write creates a snapshot before edit — Compile consumes your compile quota (except Pro/Etab).
Markdown workflow
An AI can now compile Markdown without a local Pandoc install AND analyse its own PDF. Typical call sequence:
// 1. Compile a .md to PDF compile({ "path": "draft.md" }) // → { status: "success", mode: "markdown", pdf_path: "draft.pdf", // pdf_url: "https://user-content.sarmate.net/.../draft.pdf", // compilation_time_ms: 4231 } // 2. Read the resulting PDF text for analysis read_pdf({ "path": "draft.pdf" }) // → { text: "...", text_bytes: 23874, extract_ms: 412 } // 3. If the .md compile fails, the response includes log_excerpt + hint // so the AI can fix the .md and retry.
Caveat: in the YAML headers of your .md, avoid \usepackage{bm} or \boldsymbol{} — they conflict with unicode-math (auto-loaded by Pandoc + xelatex). Use \symbf{x} or \mathbf{x} instead.
Full page on the Markdown workflow: /markdown-to-latex.php
delete_file — intentionally disabled. File deletions go through your Sarmate file manager (safety measure against AI hallucinations).
Security
- Bcrypt storage: tokens hashed, never plaintext.
- Pre-edit snapshots: 30-day retention. Restore via restore_version.
- Path traversal blocked: sanitize_rel + realpath check, read/write outside the user drive impossible.
- Forbidden extensions: .php, .htaccess, .exe, .sh… (write_file/create_file lehnt ab).
- Granular scope: token can be limited to a folder and/or read-only.
- Audit log: every call logged (token_id, tool, params, status, IP, timestamp).
- Instant revocation: AI client is disconnected on next call.
- Rate limit: 60 req/min/IP (nginx).
FAQ
How many tokens can I have?
What is the compile quota per plan?
What happens if I create a new token with the same label?
Do I need an LLM provider API key?
Does it work with OAuth? And why not with Claude.ai (web/mobile)?
However, Claude.ai (web/iOS/Android) requires full OAuth 2.1 authentication with
/authorize and /token endpoints. If you try to connect, you'll get the error {"error":"not_found","path":"/authorize"}. OAuth is on our roadmap (no date). In the meantime, Claude Desktop and Claude Code give you exactly the same MCP capabilities with the same Anthropic AI.Are my files sent to the AI?
Can I self-host the MCP server?
How do I debug a connection error?
curl (see section below). If it returns 200, the problem is client-side (config not reloaded, missing bridge for Claude Desktop, wrong URL…). If it returns 401, the token is invalid or revoked — create a new one.Raw curl examples (debug)
Useful to validate that the server and your token work, independently of the client.
tools/list
tools/call (read_file)
Ready to try it?
Create a token in 30 seconds and copy the snippet that fits your client.
Create an account Back to overview