mistral-mcp

v1.0.0
io.github.Swih/mistral-mcp Checked 22 hours ago Published 2 months ago

Mistral MCP server: extract invoices and documents from text, Markdown or OCR into typed JSON.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

mistral_chat Mistral chat completion

Generate a chat completion using a Mistral model. When to use: - Drafting French (or any European-language) content where Mistral shines. - Codestral for code-specific generation/review. - Ministral for cheap / low-latency classification. Returns structured content with the assistant text and token usage. Does NOT stream — use mistral_chat_stream for long outputs with progress updates.

ParameterTypeDescription
messages *arrayChat messages in role/content form.
max_tokensintegerMaximum number of tokens to generate. Input tokens plus this limit must fit within the model's context length.
modelstringChat model. Default: mistral-medium-latest (override with MISTRAL_DEFAULT_MODEL).
reasoning_effortstringReasoning effort; supported values depend on the selected model.
response_formatForce a structured output: `{type:"json_object"}` for JSON mode, `{type:"json_schema", json_schema:{...}}` for strict schema mode.
seedintegerRandom seed for deterministic sampling. Maps to Mistral's `random_seed`.
temperaturenumberSampling temperature: higher values make output more random; lower values make it more focused. Prefer adjusting this or top_p, not both.
top_pnumberNucleus sampling probability mass: 0.1 considers tokens in the top 10% of probability mass. Prefer adjusting this or temperature, not both.

codestral_fim Codestral fill-in-the-middle completion

Fill-in-the-middle code completion with Codestral. Given `prompt` (code preceding the cursor) and `suffix` (code after the cursor), Codestral writes the middle. Use for editor autocomplete scenarios, code-patching agents, or structured refactors where you know the target boundaries. Default stop tokens: [] — let the model decide. Override with `stop` if needed.

ParameterTypeDescription
prompt *stringCode preceding the cursor.
suffix *stringCode after the cursor. Can be empty string.
max_tokensintegerMaximum number of tokens to generate. Input tokens plus this limit must fit within the model's context length.
modelstringFIM (fill-in-the-middle) model identifier. Any identifier your endpoint serves is accepted — read mistral://models for the live catalog. Known Mistral aliases: codestral-latest.
seedintegerRandom seed for deterministic sampling. Maps to Mistral's `random_seed`.
stoparrayStop generation when any of these text sequences is encountered.
temperaturenumberSampling temperature: higher values make output more random; lower values make it more focused. Prefer adjusting this or top_p, not both.
top_pnumberNucleus sampling probability mass: 0.1 considers tokens in the top 10% of probability mass. Prefer adjusting this or temperature, not both.

mistral_vision Mistral multimodal chat (vision)

Chat completion with multimodal input: text + image_url parts. Requires a vision-capable model. Accepted: - pixtral-large-latest - pixtral-12b-latest - mistral-large-latest - mistral-medium-latest - mistral-small-latest Each message's `content` is either a plain string (pure text) or an array of parts `{ type: 'text', text }` / `{ type: 'image_url', imageUrl }`. The image URL can be an https URL or a data: URI base64 payload. Returns the assistant text + token usage. For non-visual requests, prefer `mistral_chat`.

ParameterTypeDescription
messages *arrayChat messages. Pure-text requests are accepted, but this tool is intended primarily for multimodal prompts containing image parts.
max_tokensintegerMaximum number of tokens to generate. Input tokens plus this limit must fit within the model's context length.
modelstringVision-capable Mistral model. Default: pixtral-large-latest.
seedintegerRandom seed for deterministic sampling. Maps to Mistral's `random_seed`.
temperaturenumberSampling temperature: higher values make output more random; lower values make it more focused. Prefer adjusting this or top_p, not both.
top_pnumberNucleus sampling probability mass: 0.1 considers tokens in the top 10% of probability mass. Prefer adjusting this or temperature, not both.

mistral_ocr Mistral OCR (document to markdown)

Run Mistral OCR on a PDF or image, returning structured markdown per page. Input `document` is one of: - { type: "document_url", documentUrl: "https://...pdf" } - { type: "image_url", imageUrl: "https://..." | "data:image/..." } - { type: "file", fileId: "<id-from-files-api>" } Options: - `pages`: array of 0-indexed page numbers or string like "0-5,7". - `tableFormat`: 'markdown' (default) or 'html'. - `extractHeader` / `extractFooter`: include page header/footer when present. - `includeImageBase64`: embed extracted image bytes as base64 in the response. - `document_annotatio…

ParameterTypeDescription
document *Document to process, supplied as a document URL, an image URL or data URI, or an uploaded file ID.
bbox_annotation_formatobjectJSON Schema for structured annotations of each extracted bounding box or image.
confidence_scores_granularitystringConfidence granularity. 'block' also fills pages[].blocks[].confidence_scores and requires OCR 4.1 (mistral-ocr-4-1) or newer.
document_annotation_formatobjectJSON Schema for a structured annotation extracted from the entire document.
document_annotation_promptstringInstructions for whole-document structured extraction. Requires document_annotation_format.
extractFooterbooleanExtract each page footer into its footer field and remove it from the page markdown.
extractHeaderbooleanExtract each page header into its header field and remove it from the page markdown.
imageLimitintegerMaximum number of images to extract from the document.
imageMinSizeintegerMinimum height and width of an image to extract.
includeBlocksbooleanReturn paragraph-level blocks (bounding box + type) per page. Requires OCR 4 (mistral-ocr-4-0) or newer.
includeImageBase64booleanInclude base64-encoded data for extracted images in the response.
modelstringOCR model. Default: mistral-ocr-latest.
pagesZero-based page numbers to process, as an array or comma-separated numbers and ranges such as "0-5,7".
tableFormatstringFormat for extracted tables: Markdown or HTML.

voxtral_transcribe Voxtral speech-to-text

Transcribe an audio file to text using Mistral Voxtral. Accepted models: - voxtral-mini-latest - voxtral-small-latest Audio source is one of: - { type: "file_url", fileUrl: "https://..." } (public URL) - { type: "file", fileId: "<id-from-files-api>" } Options: - `language`: ISO-639-1 hint (e.g. 'fr', 'en'). Boosts accuracy when known. - `temperature`: sampling temperature. - `diarize`: return per-speaker segments (default false). - `timestampGranularities`: ['segment'] to return per-segment timestamps. - `contextBias`: list of phrases/terms that should bias the decoder.…

ParameterTypeDescription
audio *Audio to transcribe, supplied as a public URL or an uploaded file ID.
contextBiasarrayWords or phrases to favor when decoding the audio.
diarizebooleanIdentify speakers in the returned transcription segments. Defaults to false.
languagestringISO-639-1 language hint (e.g. 'fr', 'en').
modelstringSTT model. Default: voxtral-mini-latest.
temperaturenumberSampling temperature for transcription.
timestampGranularitiesarrayOnly 'segment' is currently supported.

process_document Process a business document end-to-end

Single-call pipeline: provided text/Markdown or Mistral OCR → classify (if kind=auto) → typed extraction → validation. source.type=text skips OCR and Files uploads. Text with kind=generic makes no API calls; classification and typed extraction use Mistral chat. Results expose extraction_source. Provided text has null ocr_confidence and page_count; ocr_text contains the supplied text unchanged. Replaces the manual chain of mistral_ocr + mistral_chat + JSON parsing. Kinds: contract | invoice | id_document | generic. Use kind=auto to let the server classify. Returns a discriminated union â…

ParameterTypeDescription
source *Already extracted text/Markdown, or an OCR source: remote URL, uploaded file ID, or inline image.
kindstringExtraction task. auto classifies the document; generic returns text without typed extraction. Text source with generic makes no API calls.
optionsobjectPage selection, OCR confidence floor and local cache policy.