superset/mcp_service/docs/tool-search-optimization.md
This guide explains how to optimize context usage when connecting to Superset's MCP service using Anthropic's Tool Search Tool feature.
Superset's MCP service provides 21 tools across various categories. Loading all tool definitions upfront can consume significant context tokens (~15-20K tokens). The Tool Search Tool feature allows Claude to dynamically discover tools on-demand, reducing initial context overhead by up to 85%.
Superset MCP tools are categorized with tags to help clients configure optimal loading strategies:
| Tag | Description | Tools | Recommended Strategy |
|---|---|---|---|
core | Essential discovery and health tools | health_check, get_instance_info, list_charts, list_dashboards, list_datasets | Always load |
discovery | Detailed resource information and schema | get_chart_info, get_dashboard_info, get_dataset_info, get_schema | Can defer |
data | Data retrieval and previews | get_chart_preview, get_chart_data | Defer |
mutate | Create/modify resources | generate_chart, update_chart, update_chart_preview, generate_dashboard, add_chart_to_existing_dashboard, execute_sql | Defer |
explore | URL generation for exploration | generate_explore_link, open_sql_lab_with_context | Defer |
When calling the Claude API with Superset MCP tools, configure defer_loading based on tool categories:
{
"type": "mcp_toolset",
"mcp_server_name": "superset",
"default_config": {"defer_loading": true},
"configs": {
"health_check": {"defer_loading": false},
"get_instance_info": {"defer_loading": false},
"list_charts": {"defer_loading": false},
"list_dashboards": {"defer_loading": false},
"list_datasets": {"defer_loading": false}
}
}
This configuration:
For Claude Desktop (claude_desktop_config.json), add the Superset MCP server with defer_loading:
{
"mcpServers": {
"superset": {
"command": "npx",
"args": ["@superset/mcp-server", "--stdio"],
"env": {
"SUPERSET_URL": "http://localhost:8088",
"SUPERSET_ACCESS_TOKEN": "your-token"
},
"toolConfig": {
"default": {"defer_loading": true},
"overrides": {
"health_check": {"defer_loading": false},
"get_instance_info": {"defer_loading": false},
"list_charts": {"defer_loading": false},
"list_dashboards": {"defer_loading": false},
"list_datasets": {"defer_loading": false}
}
}
}
}
}
| Configuration | Estimated Initial Tokens | Savings |
|---|---|---|
| All tools loaded | ~15-20K | Baseline |
| Core only + defer | ~4-5K | ~75% reduction |
| Minimal (health only) | ~500 | ~97% reduction |
core tagged tools are loaded when the session startsData Exploration Flow (loads progressively):
list_datasets (core, always loaded)get_dataset_info (discovery, loaded on-demand)generate_explore_link (explore, loaded on-demand)Chart Creation Flow (loads progressively):
list_datasets (core, always loaded)get_dataset_info (discovery, loaded on-demand)generate_chart (mutate, loaded on-demand)get_chart_preview (data, loaded on-demand)Dashboard Building Flow (loads progressively):
list_charts (core, always loaded)generate_dashboard (mutate, loaded on-demand)