Mistral MCP — Document Extraction
mistral-mcp
Mistral AI 기능을 모든 MCP 클라이언트(Claude Code, Cursor, Zed, Windsurf, Claude Desktop)에 노출하는 MCP 서버
프랑스어 버전: README.fr.md
목적
Mistral은 프랑스어, 코드, OCR, 조정, 오디오 및 에이전트 스타일 워크플로우를 위한 강력한 모델을 보유하고 있지만, 대부분의 MCP 지원 IDE는 Anthropic이나 OpenAI를 기본으로 사용합니다. mistral-mcp는 이러한 Mistral 기능을 깔끔한 MCP 인터페이스로 제공하여, 에이전트 루프를 다시 구축할 필요 없이 적절한 하위 작업을 적절한 모델로 라우팅할 수 있게 합니다.
이 저장소의 목표는 "또 하나의 얇은 래퍼"가 되는 것이 아닙니다. 명확한 스키마, 예측 가능한 출력, 전송 유연성 및 우수한 테스트 커버리지를 갖춘 강력하고 유지 관리 가능한 MCP 서버를 지향합니다.
Related MCP server: MCP Server TypeScript
현재 인터페이스 (v0.4.0)
도구 (22)
핵심 생성:
mistral_chatmistral_chat_streammistral_embedmistral_tool_callcodestral_fim
비전 및 오디오:
mistral_visionmistral_ocrvoxtral_transcribevoxtral_speak
에이전트 및 분류기:
mistral_agentmistral_moderatemistral_classify
파일 및 배치:
files_uploadfiles_listfiles_getfiles_deletefiles_signed_urlbatch_createbatch_listbatch_getbatch_cancel
MCP 네이티브 유틸리티:
mcp_sample- MCP 샘플링을 통해 클라이언트 모델에 생성 위임
리소스 (2)
mistral://models- 허용된 별칭 및 라이브 모델 카탈로그mistral://voices- Voxtral TTS를 위한 라이브 음성 카탈로그
프롬프트 (6)
프랑스어 큐레이팅 프롬프트:
french_invoice_reminderfrench_meeting_minutesfrench_email_replyfrench_commit_messagefrench_legal_summary
영어 큐레이팅 프롬프트:
codestral_review
프롬프트 열거형 인수는 completable()로 래핑되어 있어, MCP 클라이언트가 completion/complete를 통해 프롬프트 인수 완성을 호출할 수 있습니다.
주요 특징
모든 도구에
inputSchema,outputSchema및 주석이 포함된 고수준McpServerAPI이중 전송 지원: 기본적으로 stdio, 원격 배포를 위한 Streamable HTTP
모든 곳에서 구조화된 출력:
structuredContent및 텍스트 대체mcp_sample을 통한 MCP 샘플링 지원열거형 프롬프트 인수에 대한 프롬프트 완성 지원
나중에 추가된 것이 아니라 도구와 함께 등록된 리소스 및 프롬프트
Mistral SDK 클라이언트의 재시도/백오프 및 요청 시간 초과
전송
Stdio
기본 모드입니다. Claude Code 및 대부분의 로컬 MCP 클라이언트가 사용하는 방식입니다.
node dist/index.jsStreamable HTTP
--http 또는 MCP_TRANSPORT=http로 활성화합니다.
MCP_TRANSPORT=http node dist/index.js관련 환경 변수:
MCP_HTTP_HOST- 기본값127.0.0.1MCP_HTTP_PORT- 기본값3333MCP_HTTP_PATH- 기본값/mcpMCP_HTTP_TOKEN- 선택적 베어러 토큰MCP_HTTP_ALLOWED_ORIGINS- 선택적 쉼표로 구분된 허용 목록MCP_HTTP_STATELESS=1- 상태 비저장 세션 모드
/healthz는 의도적으로 공개되어 있으며 MCP 서버에 접근하지 않습니다.
설치
git clone https://github.com/Swih/mistral-mcp.git
cd mistral-mcp
npm install
npm run buildAPI 키 설정:
export MISTRAL_API_KEY=your_key_here또는 저장소 루트의 .env를 사용하세요. 절대 커밋하지 마십시오.
Claude Code에서 사용
claude mcp add mistral -- node /absolute/path/to/mistral-mcp/dist/index.js예시 프롬프트:
이 PDF에
mistral_ocr을 사용한 다음, 추출된 텍스트에french_meeting_minutes를 실행하세요.
개발
npm run dev
npm run build
npm run lint
npm test
npm run inspector테스트 전략
현재 테스트 모음은 4개 계층에 걸쳐 148개의 테스트를 포함합니다:
도구, 리소스, 프롬프트, 전송, 오디오, 에이전트, 파일, 배치 및 샘플링에 대한 단위 테스트
도구 메타데이터 및 MCP 보장에 대한 계약 테스트
MISTRAL_API_KEY가 설정되었을 때 실제 Mistral API에 대한 라이브 API 테스트빌드된 서버에 대한 Stdio 엔드투엔드 테스트
MISTRAL_API_KEY가 없으면 로컬 기본값은 139개 통과 및 9개 게이트 라이브/stdio 테스트입니다.
프로젝트 레이아웃
mistral-mcp/
|-- src/
| |-- index.ts
| |-- transport.ts
| |-- tools.ts
| |-- tools-fn.ts
| |-- tools-vision.ts
| |-- tools-audio.ts
| |-- tools-agents.ts
| |-- tools-files.ts
| |-- tools-batch.ts
| |-- tools-sampling.ts
| |-- resources.ts
| `-- prompts.ts
|-- test/
|-- examples/
|-- .github/workflows/ci.yml
|-- package.json
`-- tsconfig.test.json상태
v0.4.0 — 출시됨. v0.3.0 대비 전체 변경 사항은 CHANGELOG.md를 참조하세요:
공유 헬퍼, 라이브 모델 + 음성 카탈로그, 계약 테스트
비전 + OCR
오디오 전사 + 음성
에이전트 + 조정 + 분류
파일 + 배치 API
Streamable HTTP 전송 + MCP 샘플링
프랑스어 큐레이팅 프롬프트 5개 + 영어 프롬프트 1개 + 프롬프트 인수 완성
예시
실행 가능한 스크립트는 examples/에 있습니다. examples/README.md를 참조하세요.
라이선스
MIT Copyright Dayan Decamp
Available Tools
6 toolscodestral_fimCodestral fill-in-the-middle completionARead-only
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.
Inputs: prompt (required), suffix (required), seed, stop, +4 more. Returns: text, model, usage, finish_reason
mistral_chatMistral chat completionARead-only
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.
Inputs: messages (required), seed, model, top_p, +4 more. Returns: text, model, usage, finish_reason, +1 more
mistral_ocrMistral OCR (document to markdown)ARead-onlyIdempotent
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: "" }
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_annotation_format: JSON schema for whole-document structured extraction.bbox_annotation_format: JSON schema for extracted image / bbox annotations.confidence_scores_granularity: 'page', 'word', or 'block'. 'block' adds per-block content/type confidence underpages[].blocks[].confidence_scoresand requires OCR 4.1 or newer.includeBlocks: return paragraph-level blocks (bounding box + type) in reading order — titles, lists, tables, images, equations, captions, code, references, aside text, header, footer, signature. Requires OCR 4 (mistral-ocr-4-0) or newer; older models accept the flag but return an emptyblocksarray.
Returns pages[].markdown plus optional pages[].hyperlinks, header, footer,
images bounding boxes, blocks, annotations, confidence scores, and dimensions.
Inputs: document (required), model, pages, imageLimit, +10 more. Returns: model, pages, usage, annotations, +2 more
mistral_visionMistral multimodal chat (vision)ARead-only
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.
Inputs: messages (required), seed, model, top_p, +2 more. Returns: text, model, usage, finish_reason
process_documentProcess a business document end-to-endARead-onlyIdempotent
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 — switch on kind to access typed fields.
Validation checks schema and, for OCR sources, OCR confidence; not factual or accounting accuracy.
Typed extraction rejects text longer than 60000 characters rather than truncating it.
Cache keys include source, kind, page limit, endpoint, models and pipeline version. Override location with MISTRAL_MCP_CACHE_DIR. Override mode with options.cache. Default cache mode is 'read_write' EXCEPT for kind=id_document (auto-bypass to avoid persisting PII). Set options.cache='read_write' explicitly to opt in for id documents.
options.maxPages and options.minOcrConfidence apply only to OCR sources. The confidence floor defaults to 0.3. Below the floor the
tool returns isError. Missing or partial confidence scores also return isError;
use mistral_ocr directly if you need raw OCR without a confidence guarantee.
0.3 is a conservative starting point, not a measured one: calibrate it for your
corpus with npm run eval:docs.
Inputs: source (required), kind, options. Returns: dob, kind, name, total, +22 more
voxtral_transcribeVoxtral speech-to-textARead-onlyIdempotent
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: "" }
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.
Returns plain text, detected language, optional segments[], and token usage.
Inputs: audio (required), model, diarize, language, +3 more. Returns: text, model, usage, language, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct modality/action: code FIM, text chat, OCR, vision chat, document pipeline, and audio transcription. There is minor overlap between mistral_chat and mistral_vision (both chat) and between process_document and mistral_ocr, but the descriptions explicitly steer selection, so confusion is limited.
Names mix provider-prefixed conventions (codestral_fim, mistral_chat, mistral_ocr, mistral_vision, voxtral_transcribe) with a plain action name (process_document). The pattern is somewhat readable but not a predictable verb_noun scheme and the provider prefixes fragment consistency.
Six tools is well-scoped for a multimodal Mistral wrapper, with each tool covering a distinct capability rather than redundancy. Slightly broad for a server named 'Document Extraction' since it also includes code completion and chat, but not excessive.
Covers OCR, vision, chat, transcription, and a combined pipeline, but several tools reference a Files API (fileId) that is not exposed as a tool, creating a dead-end for uploading files. No model-listing or file-management operations leave workflows partially blocked.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for progressive tool usage at any scale (see https://klavis.ai)
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- -licenseNot gradedqualityDmaintenanceA TypeScript implementation of a Model Context Protocol server and client that enables interaction with language models (specifically Mistral running on Ollama).-
- -licenseNot gradedqualityNot gradedmaintenanceA production-ready TypeScript MCP server providing basic tools (add, echo, timestamp), resources (server info, greetings, data access), and prompt templates (analyze, code-review, summarize). Serves as a foundation for building custom MCP servers with extensible architecture.547 npm-
- AlicenseBqualityDmaintenanceA TypeScript-based MCP server that provides tools to interact with local Codex and Gemini CLIs via stdio transport. It enables users to execute prompts through the ask_codex and ask_gemini tools, supporting custom models and timeout configurations.111 npm6MIT
- FlicenseAqualityDmaintenanceA TypeScript MCP server template with Zod validation, dual transport (stdio/HTTP), and modular architecture for building MCP-compatible tools, resources, and prompts.11-