# Mistral AI MCP

> Mistral AI connects your agent to European LLMs for complex tasks like chat completions and content moderation. You can generate vector embeddings for semantic search, process massive data sets with batch jobs, or check user-generated text safety before it hits production. Use this MCP when you need reliable access to Mistral's models without switching APIs.

## Overview
- **Category:** ai-frontier
- **Price:** Free
- **Tags:** llm, natural-language-processing, embeddings, model-inference, ai-agents, batch-processing

## Description

Mistral AI lets your agent talk to powerful European language models directly through conversation. Instead of writing complex API calls every time, you just tell your agent what you want—like drafting a response or checking text for safety. The MCP handles the rest. Need to index thousands of documents? You can set up batch jobs to process them asynchronously and track their progress until they’re done. For data retrieval, simply generate vector embeddings; this turns raw text into searchable numerical representations perfect for any custom knowledge base. If you're building a complex system, Vinkius makes it easy: you connect your preferred agent client once and get access to Mistral's full suite of tools right in the chat window.

## Tools

### cancel_batch
Stops a running batch job using its unique ID if processing needs to be halted early.

### chat
Sends conversational messages to specified Mistral models, receiving the assistant's textual response.

### create_batch
Starts a large processing job by pointing it to an input file and a specific API endpoint.

### delete_file
Permanently removes a previously uploaded data file used for batch or document AI processing.

### embeddings
Generates vector embeddings from text input, which are necessary for semantic search and database storage.

### get_batch
Retrieves the detailed status and results of a specific batch processing job using its ID.

### list_batches
Provides an overview of all past and current batch jobs, showing their status and file IDs.

### list_files
Lists every data file uploaded to the MCP, including its ID, size, and purpose.

### list_models
Shows a list of all available Mistral AI models with their IDs and technical capabilities.

### moderate
Checks input text against safety guidelines, returning detailed scores for categories like hate or violence.

## Prompt Examples

**Prompt:** 
```
Send a message to Mistral Large asking 'What is the capital of France?'
```

**Response:** 
```
Mistral responded: 'The capital of France is Paris. It is the most populous city in France and serves as the country's political, economic, and cultural center.'
```

**Prompt:** 
```
List all available Mistral models.
```

**Response:** 
```
Available models: mistral-large-latest (most capable, 128K context), mistral-small-latest (efficient, 32K context), codestral-latest (code specialist, 32K context), mistral-embed (embeddings, 8K context).
```

**Prompt:** 
```
Moderate this text: 'I want to learn about AI safety and content filtering.'
```

**Response:** 
```
The text passed moderation with all safety scores below thresholds. Categories checked: sexual (0.01), hate (0.00), violence (0.00), self-harm (0.00), criminal (0.00). Content is safe to process.
```

## Capabilities

### Chat with various models
Send conversations to different Mistral model sizes, from highly capable large models to efficient small ones, receiving formatted responses directly.

### Generate vector embeddings
Convert chunks of text into numerical vectors suitable for semantic search and similarity comparisons in a database.

### Moderate content safety
Check any text input against predefined categories, returning specific safety scores to flag dangerous or inappropriate material.

### Manage large batch processing
Create and track jobs that process huge volumes of data over time, letting you run compute-intensive tasks without timing out.

### Discover available models
List all Mistral AI models and their specific IDs, capabilities, and context window sizes so you know which one to use for the job.

## Use Cases

### Building an internal knowledge retriever
A company needs to build a Q&A system that answers questions based on thousands of private documents. The agent uses `list_files` to upload the PDFs, then calls `embeddings` on chunks of text to create vectors, finally letting your AI client query those vectors for highly relevant answers.

### Real-time user input safety checks
A messaging app needs to prevent abuse. Every message submitted is first passed through the `moderate` tool. If the score for 'hate' exceeds 0.5, the system automatically rejects the message and alerts a human moderator.

### Analyzing large log files
An ML team needs to process millions of historical chat logs for sentiment analysis. They use `create_batch` with an endpoint designed for classification, allowing them to run the job overnight and check progress using `get_batch` in the morning.

### Comparing model performance
A developer wants to know if Mistral's small model is fast enough. They use `list_models` to identify both 'mistral-small-latest' and 'mistral-large-latest', then send identical prompts via the `chat` tool to compare response time and quality metrics.

## Benefits

- Stop writing repetitive API calls. You can use the `chat` tool to talk to Mistral's models directly through your agent, making complex interactions feel like a natural chat session.
- Move beyond keyword searches. By calling `embeddings`, you generate vector representations that allow your agent to search based on meaning and context, not just exact matches.
- Process massive datasets reliably. The MCP handles batch jobs, so if you need to process ten thousand documents, you use `create_batch` and then check status with `list_batches`—you don't wait for a timeout.
- Automate content review. Before accepting user input, you can run the `moderate` tool to instantly get safety scores, blocking harmful or violating text before it reaches your database.
- Maintain clarity across models. The `list_models` tool lets you see all available Mistral options at a glance, ensuring you pick the right model (like 'codestral-latest') for the specific task at hand.

## How It Works

The bottom line is that it turns complex API interactions into simple conversational commands for your agent.

1. Subscribe to this MCP in Vinkius and enter your unique Mistral API key.
2. Your AI client uses the stored credentials to authenticate requests when you call a function, like generating embeddings or starting a chat.
3. The MCP sends the structured request to Mistral AI, receives the processed data, and relays the final output back to your agent conversation.

## Frequently Asked Questions

**How do I use Mistral AI MCP for chat completions?**
You use the `chat` tool by providing the desired model ID and the message array in your prompts. This lets you send conversations to various models like 'mistral-large-latest' while keeping everything within your agent flow.

**What is the difference between `embeddings` and `chat`?**
Chat is for back-and-forth conversation, returning natural language answers. Embeddings are for data storage; they convert text into numbers (vectors) so you can programmatically compare meaning across documents.

**Can I process millions of records using Mistral AI MCP?**
Yes. For large volumes, use the `create_batch` tool to set up a job. You then track its progress over time with `list_batches` and `get_batch`, ensuring stability and managing costs.

**What if I submit a batch job by mistake?**
You can use the `cancel_batch` tool immediately. Just provide the specific batch ID, and it stops all further processing for that job.

**Does Mistral AI MCP handle file management?**
Yes. You can manage files used by the service using `list_files` to see what's uploaded, or use `delete_file` when you are done with a dataset.