-
Notifications
You must be signed in to change notification settings - Fork 2
Tool Filtering
Value Proposition Conserve context window space and reduce LLM inference costs. Streamline agent tasks with targeted capabilities by systematically filtering irrelevant tools. Read the full value proposition.
Filter easily using whitelist mode. Specify the desired preset or group. This automatically disables everything else.
Recommended Default:
{
"mcpServers": {
"mysql-mcp": {
"command": "npx",
"args": [
"-y",
"@neverinfamous/mysql-mcp",
"--transport",
"stdio",
"--tool-filter",
"starter"
],
"env": {
// Local testing requires port 3307 and root/root
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "user",
"MYSQL_PASSWORD": "<YOUR_PASSWORD>",
"MYSQL_DATABASE": "database",
"REDIS_URL": "redis://localhost:6379",
"ALLOWED_IO_ROOTS": "/path/to/allowed/dir"
}
}
}
}Combine groups using the + prefix to build focused capabilities. For example, to enable core operations alongside text search tools:
Core + Text:
{
"mcpServers": {
"mysql-mcp": {
"command": "npx",
"args": [
"-y",
"@neverinfamous/mysql-mcp",
"--transport",
"stdio",
"--tool-filter",
"core,+text"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "user",
"MYSQL_PASSWORD": "<YOUR_PASSWORD>",
"MYSQL_DATABASE": "database",
"REDIS_URL": "redis://localhost:6379",
"ALLOWED_IO_ROOTS": "/path/to/allowed/dir"
}
}
}
}Docker Default:
{
"mcpServers": {
"mysql-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MYSQL_HOST=host.docker.internal",
"-e",
"MYSQL_USER=user",
"-e",
"MYSQL_PASSWORD=<YOUR_PASSWORD>",
"-e",
"MYSQL_DATABASE=database",
"-e",
"REDIS_URL=redis://host.docker.internal:6379",
"-e",
"ALLOWED_IO_ROOTS=/tmp/sandbox",
"writenotenow/mysql-mcp:<VERSION>",
"--transport",
"stdio",
"--tool-filter",
"starter"
]
}
}
}Note
Exclusions (-) CAN be combined with whitelists/presets. This excludes specific tools from a broader group (e.g., --tool-filter "starter,-codemode").
-
Whitelist Mode (Recommended): Precision control for optimal context window efficiency. Enforce strict capability boundaries by starting with a curated preset or standalone
group.-
group→ Specify a group without a preset. Only tools in that group are enabled. -
starter→ Enables core, json, text, and codemode tools. -
core,+text→ Enables core AND text tools.
-
-
Legacy/Exclusion Mode: Start with
-group.-
-core→ Enables ALL tools, then removes core tools.
-
Syntax Reference:
| Prefix | Target | Example | Effect |
|---|---|---|---|
+ (or none) |
Preset | starter |
Base Preset: Enable ONLY this preset as the foundation |
| (none) | Tool | mysql_read_query |
Exclusive Whitelist: Enable ONLY this tool |
- |
Group | -json |
Disable tools in that specific group |
| (none) | Group | text |
Exclusive Whitelist: Enable ONLY tools in this group (when used in isolation) |
+ |
Group | +text |
Context-Aware Modifier: Append tools from this group to the active selection |
- |
Tool | -mysql_drop_table |
Disable one specific tool |
+ |
Tool | +mysql_create_index |
Enable one specific tool |
List individual tool names (without + prefix) to create a fully custom whitelist. This enables only your specified tools:
# Enable specific tools (whitelist mode)
--tool-filter "mysql_read_query,mysql_write_query,mysql_list_tables"
# Mix tools from different groups
--tool-filter "mysql_read_query,mysql_create_index,mysql_json_extract"
# Combine with a preset or group
--tool-filter "core,+mysql_like_search,+mysql_json_stats"This helps automated clients needing minimal capabilities. Note: codemode is included in the starter preset. It is not globally auto-injected.
Use presets to load relevant tools for specific tasks. Run the server executable with --help for the full, current list of presets.
Prominent Examples:
-
starter: The recommended default (a preset containing multiple groups: core, json, text, and codemode).
If you need fine-grained control, use individual groups. Run the server executable with --help for the complete current mapping. Note that the mysql_tool_index prompt indexes tools only, not tool groups.
Prominent Categories:
-
Query & Data (
core,json,text): Foundational read/write capabilities and formatting. -
Code Mode (
codemode): V8 sandbox for server-side execution. -
Performance (
performance): Query execution plans and optimization tools. -
ProxySQL (
proxysql): Manage routing rules and connection pooling.
- Tools - Complete list of all tools
- Code Mode - Code Mode API documentation
- Configuration - MCP client configuration
Value Proposition Enforce strict execution boundaries and maximize LLM context efficiency for secure, autonomous database interactions. Read the full value proposition
- Installation
- Configuration
- Architecture
- HTTP Transport
- Tool Filtering
- Code Mode
- Tools
- Prompts
- Resources
- Observability & Telemetry