mcp-mistral-queue
This server provides a rate-limited, queue-based interface to the Mistral AI API, enabling safe multi-process and multi-client access to the Mistral free tier. It uses a shared SQLite database (WAL mode, stored in a secure per-user directory, path overridable) for coordination.
Key capabilities:
Single-shot prompts: Submit a plain text prompt for a text response.
Multi-turn conversations: Provide a full
messagesarray for context-aware interactions.Flexible model selection: Choose any Mistral chat model (default:
mistral-small-latest).Custom system prompt: Set a system prompt when using the single-prompt mode.
Priority queueing: Assign priority (1=high, 2=normal, 3=low) to influence processing order.
Automatic rate-limit handling: Enforces a ~31‑second start interval between requests and backs off on 429 errors, coordinating across processes.
Internal streaming & cancellation: Streams responses internally and handles client cancellation gracefully, updating the database on cancel.
MCP integration: Exposes an
ask_mistraltool for MCP-compatible clients (e.g., Claude Desktop, Vibe, Goose, OpenCode) and includes diagnostic commands (get_queue_status,clear_queue).CLI usage: Offers a direct command-line interface for ad‑hoc requests.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-mistral-queueExplain Python list comprehensions briefly"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-mistral-queue
An MCP (Model Context Protocol) server and CLI tool that coordinates local and multi-process / multi-client calls to the Mistral free tier (~1 request / 30 seconds) via a shared SQLite queue. It uses SQLite (WAL mode) and async queueing with a single in-flight task to space request starts. This is best-effort traffic control, not an official SLA.
Features
Automatic rate-limit coordination: Shared ~31s start interval; on 429, shared backoff then re-enter the gate. Resets to the base interval on success.
Multi-process & priority control: Multiple processes/tasks can enqueue work. Priority (1–3) plus single in-flight processing order the queue.
Flexible model & message options: Any Mistral chat model name (defaults to
mistral-small-latest; e.g.mistral-large-latest,codestral-latest), plus full conversation history via amessagesarray.Streaming & cancel handling: Streams the Mistral API response internally (tool returns the full text); on client cancel (
CancelledError) updates task status in the DB.Local control DB: Temp DB under a per-user directory with mode
0700(path overridable viaMMQ_TEMP_DB_PATH).uv-friendly: PEP 723 inline script metadata; use
uv runto resolve deps.Mistral Vibe integration: Register as an MCP server (
--mcp) for Vibe / Claude Desktop / similar clients. Direct CLI use isuv run(notvibe mmq.py ...).
Related MCP server: claude-sync
Prerequisites
Python 3.10+
uv installed (0.1.0+ recommended)
A Mistral API key (
MISTRAL_API_KEY)
export MISTRAL_API_KEY="your-mistral-api-key"Usage
1. CLI mode (direct run)
Run the script with uv run.
The vibe command is Mistral Vibe’s agent CLI; vibe mmq.py "..." does not execute this script.
# Basic run (default model: mistral-small-latest)
uv run mmq.py "Explain Python list comprehensions briefly"
# Choose a model (e.g. mistral-large-latest, codestral-latest)
uv run mmq.py -m mistral-large-latest "Explain a complex algorithm"
# Custom system prompt
uv run mmq.py -s "You are an AI that speaks casually." "How is the weather today?"
# Priority (1: high, 2: normal, 3: low)
uv run mmq.py --priority 1 "Urgent question"
# Full conversation context as a messages JSON array
uv run mmq.py --messages '[{"role":"system","content":"Strict programmer"},{"role":"user","content":"What is ownership in Rust?"}]'2. MCP server mode (Mistral Vibe / other clients)
Expose the ask_mistral tool to Vibe, Claude Desktop, OpenCode, Goose, and similar clients.
This is a separate path from CLI uv run mmq.py "...".
Use an absolute path to this repo’s mmq.py (package is not on PyPI yet).uv run resolves the PEP 723 deps; see docs/SMOKE_VIBE.md.
Vibe / Claude Desktop example (claude_desktop_config.json or equivalent):
{
"mcpServers": {
"mistral-queue": {
"command": "uv",
"args": [
"run",
"--with", "mcp[cli]>=1.0.0,<2",
"--with", "mistralai>=1.0.0,<2",
"--no-project",
"/absolute/path/to/mmq.py",
"--mcp"
],
"env": {
"MISTRAL_API_KEY": "your-mistral-api-key"
}
}
}
}After changing config, restart the client and have the agent use the ask_mistral tool (pass model when needed, e.g. mistral-large-latest).
After a PyPI release:
uvx/ published install may replace the path form. The console script ismmq(seepyproject.toml), notmcp-mistral-queue. Track that in docs/tasks.md.
MCP tools
When the server is running, clients can use the following tools:
ask_mistral
Argument | Type | Default | Description |
prompt | string | null | Single-shot user prompt text |
messages | array | null | Conversation history ( |
model | string |
| Mistral model name |
system_prompt | string | null | Custom system prompt (only when using |
priority | number | 2 | Task priority (1: high, 2: normal, 3: low) |
Control data location
The coordination temp DB is stored in a per-user directory created with mode 0700:
Default:
<tempdir>/mcp_mistral_queue_<USER>/mcp_mistral_flow_control.db
(tempfile.gettempdir(), often/tmpon Linux)Override: set
MMQ_TEMP_DB_PATHto a full file path (parent dir is created with0700)
Tests
# Unit + e2e (fake API; no network required)
uv run --with 'mcp[cli]>=1.0.0,<2' --with 'mistralai>=1.0.0,<2' \
--with pytest --with pytest-asyncio --no-project \
python -m pytest tests/ -v -m "not live"
# e2e only
uv run --with 'mcp[cli]>=1.0.0,<2' --with 'mistralai>=1.0.0,<2' \
--with pytest --with pytest-asyncio --no-project \
python -m pytest tests/e2e -v -m "not live"
# Live API (optional; consumes free-tier quota)
export MISTRAL_API_KEY=...
uv run --with 'mcp[cli]>=1.0.0,<2' --with 'mistralai>=1.0.0,<2' \
--with pytest --with pytest-asyncio --no-project \
python -m pytest tests/e2e/test_live_api.py -v -m livee2e uses MMQ_FAKE_API=1 and a short MMQ_BASE_WAIT_TIME to exercise process boundaries (CLI / MCP stdio).
For a manual Vibe UI check, see docs/SMOKE_VIBE.md.
License
MIT License
Copyright (c) 2026 utenadev
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for "taming the Claude" with structured task queues.Last updated146371MIT
- Alicense-qualityCmaintenanceLocal-first MCP server that enables multiple Claude agents to coordinate through a shared message bus with SQLite persistence and real-time clock anchoring.Last updatedMIT
- AlicenseBqualityCmaintenanceMCP server providing context usage estimation, conversation compaction, and durable semantic memory via local embeddings and SQLite.Last updated17323MIT
- Alicense-qualityBmaintenanceA local, project-scoped requirement management MCP server that enables AI agents to manage tasks and requirements via SQLite.Last updated15MIT
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/utenadev/mcp-mistral-queue'
If you have feedback or need assistance with the MCP directory API, please join our Discord server