Skip to content

MCP configuration schema

When mistral.rs acts as an MCP (Model Context Protocol) client, it reads a JSON config describing servers to connect to.

{
"servers": [ ... ],
"auto_register_tools": true,
"tool_timeout_secs": 30,
"max_concurrent_calls": 10
}
Field Type Default Purpose
servers array required List of MCP servers.
auto_register_tools bool required Give the model every tool from every connected server. Set it to true; with false, the model gets none of the servers’ tools.
tool_timeout_secs int 30 Seconds a single tool call can run before it times out.
max_concurrent_calls int 10 Most MCP tool calls that can run at once, across all servers.
{
"name": "filesystem",
"source": { ... },
"enabled": true,
"tool_prefix": "fs",
"bearer_token": "...",
"id": "fs-1",
"resources": ["file://**"]
}
Field Type Required Purpose
name string yes Server name.
source object yes How to connect to the server. See transports.
enabled bool no (default true) Set to false to skip a server without removing the entry.
tool_prefix string no (auto-generated mcp_<uuid>) Prefix applied to tool names.
bearer_token string no Optional bearer token.
id string no (auto UUID) Stable identifier for the server.
resources array no Resource URI patterns the server exposes, e.g. ["file://**"], used for resource discovery and subscription.
{
"type": "Process",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"env": { "KEY": "value" },
"work_dir": "/path"
}
Field Purpose
type Literal "Process".
command Executable to run.
args Arguments.
env Optional environment variables.
work_dir Optional working directory.
{
"type": "Http",
"url": "https://mcp.example.com",
"headers": { "Authorization": "Bearer ..." },
"timeout_secs": 60
}
Field Purpose
type Literal "Http".
url Endpoint URL.
headers Optional request headers.
timeout_secs Optional per-source timeout.
{
"type": "WebSocket",
"url": "wss://mcp.example.com/ws",
"headers": { ... },
"timeout_secs": 60
}

Same fields as HTTP with a WebSocket URL.

Tools from a server with tool_prefix = "fs" are exposed as fs_read_file, fs_list_directory, etc. The separator is an underscore. Without tool_prefix, an auto-generated mcp_<uuid> prefix is used.

{
"servers": [
{
"name": "filesystem",
"tool_prefix": "fs",
"source": {
"type": "Process",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/srv/agent-workspace"]
}
},
{
"name": "github",
"source": {
"type": "Http",
"url": "https://mcp.github.example.com",
"headers": {
"Authorization": "Bearer xxx"
}
}
}
],
"auto_register_tools": true,
"max_concurrent_calls": 8,
"tool_timeout_secs": 45
}

Pass it on the CLI:

Terminal window
mistralrs serve --mcp-config mcp.json -m Qwen/Qwen3-4B

The same path can be supplied via the MCP_CONFIG_PATH environment variable.