Mathpix MCP by usefulapi
v1.1.0Run OCR billed by Mathpix on images and PDFs, read results and usage, delete outputs in Mathpix.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
mathpix_get_usage Get API usage
API usage counts for this Mathpix account over a date range, grouped by usage type (image, image-async, pdf ...), request arguments or app id and aggregated by a timespan. Use it to reconcile billing and watch consumption. Free to call. GET /v3/ocr-usage.
| Parameter | Type | Description |
|---|---|---|
from_date | string | Start (included): ISO 8601 date or date-time. |
group_by | string | What to group the counts by (default usage_type). |
timespan | string | Aggregation period, a lowercase word such as month (default), week or day. Mathpix rejects values it does not know. |
to_date | string | End (excluded): ISO 8601 date or date-time. |
mathpix_list_image_results List image OCR results
Search and list stored results of earlier image/strokes OCR requests (/v3/text etc.), newest first: the recognized text, confidence, detected content types and the request options. Requests made with improve_mathpix=false are not stored. Free to call. GET /v3/ocr-results.
| Parameter | Type | Description |
|---|---|---|
contains_chemistry | boolean | true: results containing chemistry diagrams. |
contains_diagram | boolean | true: results containing diagrams. |
contains_table | boolean | true: results containing a table. |
from_date | string | Only results at or after this ISO 8601 date or date-time. |
is_handwritten | boolean | true: results containing handwritten text/math. |
is_printed | boolean | true: results containing printed text/math. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
per_page | integer | Results per page, 1-100 (default 25). |
tags | array | Only results carrying these tags (as set on the OCR request). |
text | string | Only results whose recognized text contains this string. |
to_date | string | Only results before this ISO 8601 date or date-time. |
mathpix_list_documents List processed documents
List documents previously submitted for async processing (/v3/pdf), newest first: pdf_id, input file or URL, status (received, loaded, split, completed, error), page counts and timestamps. Use the pdf_id with the get/output tools. Free to call. GET /v3/pdf-results.
| Parameter | Type | Description |
|---|---|---|
from_date | string | Only documents at or after this ISO 8601 date or date-time. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
per_page | integer | Results per page, 1-100 (default 25). |
to_date | string | Only documents before this ISO 8601 date or date-time. |
mathpix_get_document_status Get document status
Processing status of a submitted document: status (received, loaded, split, completed, error), pages done, and the status of each requested conversion. Poll this until status is completed before reading the output (percent_done reaches 100 before the output files exist). Free to call. GET /v3/pdf/{pdf_id}.
| Parameter | Type | Description |
|---|---|---|
pdf_id * | string | The pdf_id returned by mathpix_submit_document or listed by mathpix_list_documents. |
mathpix_get_conversion_status Get conversion status
Status of the output-format conversions of a document (the pdf_id) or of a Markdown conversion (the conversion_id): one entry per requested format with status processing, completed or error. Free to call. GET /v3/converter/{id}.
| Parameter | Type | Description |
|---|---|---|
id * | string | A pdf_id, or the conversion_id returned by mathpix_convert_markdown. |
mathpix_get_document_output Get document output
Read the TEXT result of a processed document: mmd (Mathpix Markdown, the primary output), md (plain Markdown), html, latex (single .tex) or lines.json (line-by-line data with geometry). Long outputs come back in slices (offset / next_offset). Binary formats (docx, pdf, zip, images) cannot be fetched through this server. Only call once mathpix_get_document_status says completed. Free to call. GET /v3/pdf/{pdf_id}.{ext}.
| Parameter | Type | Description |
|---|---|---|
format * | string | Output format: mmd, md, html, latex, lines.json. |
id * | string | The pdf_id of a completed document. |
max_chars | integer | Characters to return, up to 45000 (default 40000); fewer come back when the text needs heavy escaping, so always continue from next_offset. |
offset | integer | Character offset to start from (default 0). Pass the previous reply's next_offset to read on. |
mathpix_get_conversion_output Get Markdown conversion output
Read the TEXT result of a Markdown conversion started with mathpix_convert_markdown: md, html or latex. Long outputs come back in slices (offset / next_offset). Binary formats cannot be fetched through this server. Free to call. GET /v3/converter/{conversion_id}.{ext}.
| Parameter | Type | Description |
|---|---|---|
format * | string | Output format: md, html, latex. |
id * | string | The conversion_id returned by mathpix_convert_markdown. |
max_chars | integer | Characters to return, up to 45000 (default 40000); fewer come back when the text needs heavy escaping, so always continue from next_offset. |
offset | integer | Character offset to start from (default 0). Pass the previous reply's next_offset to read on. |
mathpix_ocr_image OCR an image (billed)
BILLED BY MATHPIX (pay as you go, per image; see mathpix.com/pricing/api): recognize math, text, tables and chemistry in ONE image and return Mathpix Markdown (LaTeX math inside \( \) / \[ \]), and optionally HTML, styled LaTeX or structured data. The image must be a public URL (or a small data URI); local files are not reachable. Each call is a new billed request. POST /v3/text.
| Parameter | Type | Description |
|---|---|---|
src * | string | Image to read: a PUBLIC http(s) URL that Mathpix can download (up to 10 MB), or a data:image/png|jpeg|gif|webp|bmp|tiff;base64,... string (up to 1000000 characters; prefer a URL). This server cannot r… |
enable_document_layout | boolean | true for a full page (lists, multi-line layout); default is snippet mode. |
formats | array | Output formats (default: text = Mathpix Markdown). data = extracted asciimath/mathml/latex/svg/tsv; latex_styled = single-equation LaTeX. |
improve_mathpix | boolean | Set false to opt this request out of Mathpix using the image/document to improve its models (it then also will not appear in the results-query tools). Omit to use the account default. |
include_line_data | boolean | true to also return line-by-line data with positions (larger reply). |
include_smiles | boolean | true to read chemistry diagrams as <smiles> notation. |
tags | array | Tags stored with the result, searchable with mathpix_list_image_results. |
mathpix_submit_document Submit a document (billed)
BILLED BY MATHPIX (pay as you go, per page processed; see mathpix.com/pricing/api): start async conversion of a PDF, DOCX, PPTX, EPUB or similar document at a PUBLIC URL into Mathpix Markdown. Returns a pdf_id immediately; poll mathpix_get_document_status until completed, then read it with mathpix_get_document_output. Use page_ranges to limit the pages billed. Each call is a new billed job. POST /v3/pdf.
| Parameter | Type | Description |
|---|---|---|
url * | string | PUBLIC http(s) URL where Mathpix can download the document (PDF, DOCX, PPTX, EPUB, ... up to 1 GB). This server cannot read local files. |
improve_mathpix | boolean | Set false to opt this request out of Mathpix using the image/document to improve its models (it then also will not appear in the results-query tools). Omit to use the account default. |
include_smiles | boolean | Read chemistry diagrams as <smiles> notation (default true at Mathpix). |
page_ranges | string | Pages to process (and be billed for), e.g. "2,4-6"; "2 - -2" = page 2 to the next-to-last. Default: all pages. |
mathpix_convert_markdown Convert Markdown
Convert Mathpix Markdown (MMD) text into plain Markdown, HTML or LaTeX. Returns a conversion_id; read the result with mathpix_get_conversion_output (check mathpix_get_conversion_status first). Conversions may be billed by Mathpix under your plan; see mathpix.com/pricing/api. Each call creates a new conversion. POST /v3/converter.
| Parameter | Type | Description |
|---|---|---|
formats * | array | Output formats to produce: md, html and/or latex. |
mmd * | string | The Mathpix Markdown text to convert (up to 500000 characters). |
improve_mathpix | boolean | Set false to opt this request out of Mathpix using the image/document to improve its models (it then also will not appear in the results-query tools). Omit to use the account default. |
mathpix_delete_document Delete a document
PERMANENTLY delete a processed document's output at Mathpix (Markdown, JSON lines, images, all converted formats) and the uploaded source copy. Cannot be undone; read what you need first. Only billing metadata is kept. DELETE /v3/pdf/{pdf_id}.
| Parameter | Type | Description |
|---|---|---|
pdf_id * | string | The pdf_id of the document to delete. |
mathpix_delete_conversion Delete a Markdown conversion
PERMANENTLY delete the output files of a Markdown conversion at Mathpix. Cannot be undone; read what you need first. DELETE /v3/converter/{conversion_id}.
| Parameter | Type | Description |
|---|---|---|
conversion_id * | string | The conversion_id of the conversion to delete. |