Mathpix MCP by usefulapi

v1.1.0
io.usefulapi/mathpix Checked 1 day ago Published 8 days ago

Run 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.

ParameterTypeDescription
from_datestringStart (included): ISO 8601 date or date-time.
group_bystringWhat to group the counts by (default usage_type).
timespanstringAggregation period, a lowercase word such as month (default), week or day. Mathpix rejects values it does not know.
to_datestringEnd (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.

ParameterTypeDescription
contains_chemistrybooleantrue: results containing chemistry diagrams.
contains_diagrambooleantrue: results containing diagrams.
contains_tablebooleantrue: results containing a table.
from_datestringOnly results at or after this ISO 8601 date or date-time.
is_handwrittenbooleantrue: results containing handwritten text/math.
is_printedbooleantrue: results containing printed text/math.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
tagsarrayOnly results carrying these tags (as set on the OCR request).
textstringOnly results whose recognized text contains this string.
to_datestringOnly 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.

ParameterTypeDescription
from_datestringOnly documents at or after this ISO 8601 date or date-time.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
to_datestringOnly 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}.

ParameterTypeDescription
pdf_id *stringThe 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}.

ParameterTypeDescription
id *stringA 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}.

ParameterTypeDescription
format *stringOutput format: mmd, md, html, latex, lines.json.
id *stringThe pdf_id of a completed document.
max_charsintegerCharacters to return, up to 45000 (default 40000); fewer come back when the text needs heavy escaping, so always continue from next_offset.
offsetintegerCharacter 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}.

ParameterTypeDescription
format *stringOutput format: md, html, latex.
id *stringThe conversion_id returned by mathpix_convert_markdown.
max_charsintegerCharacters to return, up to 45000 (default 40000); fewer come back when the text needs heavy escaping, so always continue from next_offset.
offsetintegerCharacter 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.

ParameterTypeDescription
src *stringImage 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_layoutbooleantrue for a full page (lists, multi-line layout); default is snippet mode.
formatsarrayOutput formats (default: text = Mathpix Markdown). data = extracted asciimath/mathml/latex/svg/tsv; latex_styled = single-equation LaTeX.
improve_mathpixbooleanSet 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_databooleantrue to also return line-by-line data with positions (larger reply).
include_smilesbooleantrue to read chemistry diagrams as <smiles> notation.
tagsarrayTags 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.

ParameterTypeDescription
url *stringPUBLIC http(s) URL where Mathpix can download the document (PDF, DOCX, PPTX, EPUB, ... up to 1 GB). This server cannot read local files.
improve_mathpixbooleanSet 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_smilesbooleanRead chemistry diagrams as <smiles> notation (default true at Mathpix).
page_rangesstringPages 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.

ParameterTypeDescription
formats *arrayOutput formats to produce: md, html and/or latex.
mmd *stringThe Mathpix Markdown text to convert (up to 500000 characters).
improve_mathpixbooleanSet 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}.

ParameterTypeDescription
pdf_id *stringThe 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}.

ParameterTypeDescription
conversion_id *stringThe conversion_id of the conversion to delete.