Skip to content

MCP configuration schema

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

{
"servers": [ ... ],
"auto_register_tools": true,
"tool_timeout_secs": 30,
"max_concurrent_calls": 10
}
FieldTypeDefaultPurpose
serversarrayrequiredList of MCP servers.
auto_register_toolsbooltrueExpose every tool from every connected server to the model.
tool_timeout_secsint30Per-tool-call timeout.
max_concurrent_callsint10Cap on concurrent MCP calls.
{
"name": "filesystem",
"source": { ... },
"enabled": true,
"tool_prefix": "fs",
"bearer_token": "..."
}
FieldTypeRequiredPurpose
idstringno (auto UUID)Stable identifier for the server.
namestringyesServer name.
sourceobjectyesTransport configuration.
enabledboolno (default true)Disable a server without removing the entry.
tool_prefixstringno (auto-generated mcp_<uuid>)Prefix applied to tool names.
resourcesarraynoOptional resource list.
bearer_tokenstringnoOptional bearer token.
{
"type": "Process",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"env": { "KEY": "value" },
"work_dir": "/path"
}
FieldPurpose
typeLiteral "Process".
commandExecutable to run.
argsArguments.
envOptional environment variables.
work_dirOptional working directory.
{
"type": "Http",
"url": "https://mcp.example.com",
"headers": { "Authorization": "Bearer ..." },
"timeout_secs": 60
}
FieldPurpose
typeLiteral "Http".
urlEndpoint URL.
headersOptional request headers.
timeout_secsOptional 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.