Tool filtering¶
By default every tool a server exposes is offered to the model. toolFilter narrows
that, per server.
mode- Either
"include"(allow-list) or"exclude"(deny-list). Defaults to"include"when omitted. tools- Array of exact tool names. Matching is case-sensitive.
Behaviour¶
- No
toolFilter, or an emptytoolsarray → all tools are loaded. - Include mode → only the listed tools are exposed. A listed tool that the server doesn't have logs a warning; the connection continues.
- Exclude mode → everything except the listed tools is exposed.
- An invalid
modevalue stops the bridge at startup with an error.
An invalid mode is fatal
Unlike a failing server, a malformed toolFilter isn't skipped — it exits with
status 1. This is deliberate: silently ignoring a broken deny-list would expose tools
you meant to block.
Examples¶
Only these two tools reach the model.
An allow-list on one server, a deny-list on another.
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["--directory", "./mock-weather-mcp-server", "run", "main.py"],
"toolFilter": {
"mode": "include",
"tools": ["get_current_temperature"]
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"toolFilter": {
"mode": "exclude",
"tools": ["delete_file", "write_file"]
}
}
}
}