Mathpix MCP server for AI agents

Live

API KEY

DOCUMENT OCR

Files & Documents

Mathpix gives your agent document OCR for math and science: read equations, tables, and handwriting from images, convert PDF and Word files to Mathpix Markdown, and export to DOCX, LaTeX, and more.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Mathpix
agent · Acme Q3
Run
Is the thesis PDF done processing?
S
mathpix_get_pdf_status
82ms
Research agent
Yes. All 86 pages are completed, and the Markdown output is ready to download.
Sources: 1 document, 86 pages
mathpix
86 pages
18:29
Message Claude...

Tools your research agent reaches for on Mathpix, scoped per user.

CALL ANY TOOL
15 tools for document OCR with Mathpix: read math, text, tables, and handwriting from images and ink strokes, process PDF and Word files, convert Mathpix Markdown to DOCX, LaTeX, and HTML, and check usage.
mathpix_convert_markdown
Convert markdown
Convert a Mathpix Markdown document into DOCX, Markdown, HTML, PDF, LaTeX, PowerPoint or Excel. Returns conversion_id, the handle for status checks and downloads. Use this for Markdown you already have. Use the conversion_formats input of mathpix_submit_pdf to convert a document while it is processed. Poll mathpix_get_conversion_status until each format is completed, then read text formats with mathpix_get_conversion_result.
Parameters
Name
Type
Required
Description
formats
array
Required
Output formats to produce. md and html are text and can be read with mathpix_get_conversion_result; docx, xlsx (tables only), pptx, pdf, latex.pdf and the zip formats are binary files. Example: ["docx", "tex.zip"]
mmd
string
Required
The Mathpix Markdown (MMD) document to convert, as one string. MMD is Markdown with LaTeX math in \( \) and \[ \] delimiters, as returned by mathpix_process_image or mathpix_get_pdf_result. The request body can be up to 10 MB. Example: # Notes\n\nThe area is \( \pi r^2 \).
conversion_options
object
Optional
Settings for specific formats, keyed by format name. For example docx takes font, fontSize (half-points), orientation and margins; md takes math delimiters and escape flags; pdf takes fontSize, margin and custom_css; html takes math_output_format (svg, mathml or latex). Example: {"docx": {"font": "Arial", "fontSize": 24}}
improve_mathpix
boolean
Optional
Set to false to stop Mathpix from keeping this request's image and result to improve its models (sent as metadata.improve_mathpix). Results sent with false do not appear in mathpix_list_ocr_results.
mathpix_delete_conversion
Delete conversion
mathpix_delete_pdf
Delete pdf
mathpix_get_conversion_result
Get conversion result
mathpix_get_conversion_status
Get conversion status
mathpix_get_ocr_usage
Get ocr usage
mathpix_get_pdf_lines
Get pdf lines
mathpix_get_pdf_result
Get pdf result
mathpix_get_pdf_status
Get pdf status
mathpix_list_ocr_results
List ocr results
mathpix_list_pdf_results
List pdf results
mathpix_process_equation
Process equation
mathpix_process_image
Process image
mathpix_process_strokes
Process strokes
mathpix_submit_pdf
Submit pdf
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Mathpix tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mathpix"], toolNames: [
    "mathpix_process_image",
    "mathpix_submit_pdf",
    "mathpix_get_pdf_result"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Convert this lecture notes PDF to Markdown" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mathpix"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Convert this lecture notes PDF to Markdown" }],
  tools,
});

// Execute the tool call with the user's vaulted Mathpix API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mathpix"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Convert this lecture notes PDF to Markdown" }],
  tools,
});

// Tool call runs with the user's vaulted Mathpix API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mathpix"] }, pageSize: 100,
});

const agent = new Agent({
  name: "research_agent",
  model: "gemini-2.5-pro",
  instruction: "Mathpix tools scoped to this user",
  tools,
});

await agent.run("Convert this lecture notes PDF to Markdown");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Mathpix tool. Click to copy, paste into your agent, done.
Images
Copy the prompt
Copied
Read the equation in this image and return LaTeX.
Copy the prompt
Copied
Extract the table from this photo of a lab notebook.
Copy the prompt
Copied
Recognize this handwritten math from its stroke data.
Documents
Copy the prompt
Copied
Process this textbook chapter PDF from its public URL.
Copy the prompt
Copied
Is the thesis PDF done processing?
Copy the prompt
Copied
Download the Markdown for the thesis PDF.
Conversion and usage
Copy the prompt
Copied
Convert this Mathpix Markdown to a DOCX file.
Copy the prompt
Copied
List the documents we submitted this month.
Copy the prompt
Copied
How many OCR requests did we make last week?
SEE HOW AUTH WORKS
Each user connects their own Mathpix API key once, and Scalekit sends it with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Mathpix
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Mathpix
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Mathpix
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Mathpix
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other documents and AI connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other documents and AI connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Mathpix API key looks fine in a demo. In production every OCR request looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Mathpix today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Mathpix as the user or through a shared API key?
As the user. Each user connects their own Mathpix API key once, and Scalekit sends it with every call. Every OCR request and conversion the agent runs is attributed to that user in your audit trail, not a shared service account.
Where is the Mathpix API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Mathpix?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example OCR and read tools without mathpix_delete_pdf and mathpix_delete_conversion, which permanently delete outputs. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Mathpix access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
What can the agent send to Mathpix?
Images of printed or handwritten math, text, tables, and chemistry diagrams through mathpix_process_image, and PDF, Word, PowerPoint, or ebook files from a public URL through mathpix_submit_pdf. mathpix_convert_markdown turns Mathpix Markdown into DOCX, Markdown, HTML, PDF, LaTeX, PowerPoint, or Excel.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""mathpix"": {
""url"": ""https://mcp.scalekit.com/mathpix"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.mathpix]
url = ""https://mcp.scalekit.com/mathpix""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""mathpix"": {
""url"": ""https://mcp.scalekit.com/mathpix"",
""type"": ""http""
}
}
}