MCP Server Reference¶
Complete reference for the BenchBox MCP (Model Context Protocol) server, including all available tools, resources, and prompts.
Running the Server¶
Prerequisites¶
Install BenchBox with MCP dependencies:
uv sync --extra mcp
Starting the Server¶
# Via Python module
uv run python -m benchbox.mcp
# Via entry point (if installed globally)
benchbox-mcp
# With explicit MCP path overrides
benchbox-mcp --results-dir /tmp/benchbox-results --charts-dir /tmp/benchbox-charts
The server communicates via stdio using JSON-RPC, compatible with Claude Code and other MCP clients.
Testing Locally¶
To verify the server works, you can test it interactively:
# Start server and send a test request
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | uv run python -m benchbox.mcp
This should return a JSON response listing all available tools.
Using the MCP Inspector¶
For interactive testing, use the MCP Inspector:
# Install the inspector
npx @anthropic-ai/inspector
# Connect to BenchBox
npx @anthropic-ai/inspector "uv run python -m benchbox.mcp"
The inspector provides a web UI to browse tools, test calls, and view responses.
Server Options¶
benchbox-mcp supports explicit flags and environment-variable fallback.
CLI flags
Flag |
Description |
|---|---|
|
Results root used by MCP result reads/writes |
|
Charts root used by MCP visualization paths |
|
Logging level (DEBUG, INFO, WARNING, ERROR) |
Environment variables
Variable |
Default |
Description |
|---|---|---|
|
|
Results root when |
|
|
Charts root when |
|
|
Base root used to derive results/charts when specific vars are unset |
|
|
Logging level when |
Precedence
Explicit MCP flag (
--results-dir,--charts-dir,--log-level)Specific env var (
BENCHBOX_RESULTS_DIR,BENCHBOX_CHARTS_DIR,BENCHBOX_LOG_LEVEL)Derived from
BENCHBOX_OUTPUT_DIRfor pathsBuilt-in defaults (
benchmark_runs/results,benchmark_runs/charts,INFO)
Example:
BENCHBOX_RESULTS_DIR=/tmp/results BENCHBOX_LOG_LEVEL=DEBUG benchbox-mcp
Tools¶
Tools are executable actions that can be invoked by AI assistants. BenchBox MCP
is a beta-public smoke/control-plane surface, not a CLI-equivalent
execution surface. It exposes a documented subset of benchmark execution,
validation, dry-run preview, result reads, analytics, and chart generation
through public BenchBox APIs. MCP must not import benchbox.cli command
internals.
MCP run results are exported through ResultExporter as normal result JSON
bundles and include execution_context.entry_point = "mcp" when the result
object supports execution context metadata. They are schema-level comparable to
CLI result bundles, but MCP does not claim option parity with benchbox run.
Actual Tool Inventory¶
Tool |
Category |
Writes |
Purpose |
|---|---|---|---|
|
discovery |
No |
List platforms, benchmarks, chart templates, or all discovery data. |
|
discovery |
No |
Return benchmark metadata, queries, schema, and scale-factor information. |
|
discovery |
No |
Return CPU, memory, disk, Python, package, and BenchBox environment facts. |
|
discovery |
No |
Report platform dependency availability and install guidance. |
|
execution |
Yes |
Run, dry-run, or validate a benchmark through the MCP control-plane subset. |
|
execution aid |
No |
Return SQL or DataFrame query details for a benchmark/query/platform. |
|
results |
Optional |
List result files, read one result, or export a result in another format. |
|
analytics |
No |
Compare result files, detect regressions, calculate trends, or aggregate runs. |
|
analytics |
No |
Read captured query plans from a result bundle. |
|
analytics |
No |
Validate result JSON integrity, completeness, and believability. |
|
visualization |
No |
Suggest useful chart types for one or more result files. |
|
visualization |
Yes |
Generate ASCII chart output from result files. |
Run Surface Contract¶
run_benchmark is the only benchmark execution tool. Dry-run preview and
configuration validation are modes on this tool (dry_run=true and
validate_only=true), not separate MCP tools.
MCP run parameter schema
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Target platform, for example |
|
string |
Yes |
- |
Benchmark identifier, for example |
|
number |
No |
|
Data scale factor; benchmark-specific defaults and constraints may still apply. |
|
string or null |
No |
|
Comma-separated query IDs, for example |
|
string or null |
No |
|
Comma-separated phases; execution defaults to |
|
string or null |
No |
|
Execution mode: |
|
boolean |
No |
|
Capture query plans where the selected platform supports them. |
|
boolean |
No |
|
Preview the run plan without executing queries. |
|
boolean |
No |
|
Validate platform, benchmark, scale, and mode without executing. |
Behavior
validate_only=truereturns configuration validity, resolved execution mode, errors, and warnings.dry_run=trueuses the core dry-run executor and returns the plan/resources preview the MCP subset can model; it currently reports the default load/power plan rather than applying thephasesparameter.mode=data_onlygenerates benchmark data without running queries.phasesapplies to normal execution and maps to the benchmark execution type used byBaseBenchmark.run_with_platform().Normal execution uses
BaseBenchmark.run_with_platform()through public benchmark and adapter APIs.MCP execution intentionally suppresses console output and returns structured JSON for agent clients.
Intentionally omitted CLI-only controls
These benchbox run options are currently product-scope omissions, not
undocumented MCP parameters. Adding any of them requires a new contract decision
or a shared non-CLI execution service below both CLI and MCP.
CLI surface |
MCP status |
Reason |
|---|---|---|
|
Omitted |
MCP result roots are server configuration ( |
|
Omitted |
Platform-specific key/value plumbing is CLI orchestration surface. |
|
Omitted |
Benchmark-specific key/value plumbing is CLI orchestration surface. |
|
Omitted |
Tuning/table layout workflows are CLI-equivalent scope. |
|
Omitted |
Regeneration/upload forcing needs broader lifecycle service semantics. |
|
Omitted |
TPC compliance and repeated measurement policy remain CLI scope. |
|
Omitted |
Output/data-format policy is not exposed through MCP run control. |
|
Omitted |
MCP exposes only |
|
Omitted |
MCP already runs as structured, quiet server-side execution. |
|
Omitted |
Cache and publication workflows are not MCP run controls. |
interactive prompts and |
Omitted |
MCP requests are non-interactive by protocol. |
Discovery Tools¶
list_available¶
List platforms, benchmarks, chart templates, or all discovery data.
Benchmark rows include support_status from
benchbox.core.benchmark_registry; MCP does not maintain a separate support
classification.
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
No |
|
|
get_benchmark_info¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Benchmark identifier. |
Returns benchmark metadata including support_status, category, query/schema
information, scale-factor constraints, and DataFrame capability.
system_profile¶
No parameters. Returns host and package information useful for capacity planning.
check_dependencies¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string or null |
No |
|
Specific platform to check; omitted checks all platforms. |
|
boolean |
No |
|
Include detailed package information. |
Benchmark Query Tools¶
get_query_details¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Benchmark identifier. |
|
string |
Yes |
- |
Query identifier, for example |
|
string or null |
No |
|
Optional platform for dialect-specific query lookup. |
|
string or null |
No |
|
|
Public benchmark query details include registry support_status in
benchmark_info. Internal/repo-only benchmark details remain addressable by
explicit ID where previously supported, but do not expose support-status claims.
See the Benchmark Visibility Policy
for the full surface-by-surface matrix.
Results Tools¶
get_results¶
get_results combines recent-run listing, result reading, and result export.
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string or null |
No |
|
Result filename; omitted lists recent runs. |
|
string |
No |
|
|
|
string or null |
No |
|
Export path relative to the configured results dir. |
|
integer |
No |
|
Max recent runs when listing. |
|
string or null |
No |
|
Platform filter when listing. |
|
string or null |
No |
|
Benchmark filter when listing. |
|
boolean |
No |
|
Include query details when reading one result. |
Analytics Tools¶
analyze_results¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
No |
|
|
|
string or null |
No |
|
Baseline result file for |
|
string or null |
No |
|
Comparison result file for |
|
string or null |
No |
|
Platform filter for non-compare analyses. |
|
string or null |
No |
|
Benchmark filter for non-compare analyses. |
|
number |
No |
|
Regression/change threshold. |
|
string |
No |
|
Trend metric: |
|
string |
No |
|
Aggregate grouping: |
|
integer |
No |
|
Max runs to analyze where applicable. |
get_query_plan¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Result filename containing captured query plans. |
|
string |
Yes |
- |
Query identifier. |
|
string |
No |
|
|
validate_results¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
No* |
|
Path to one result JSON file. |
|
string |
No* |
|
Directory of result JSON files for batch validation. |
|
boolean |
No |
|
Include PASS checks in output. |
*Provide either result_file or directory.
Visualization Tools¶
BenchBox MCP visualization is result-aware semantic charting. suggest_charts
and generate_chart read BenchBox result files and accept semantic chart IDs
from benchbox.core.visualization.chart_types, such as performance_bar,
power_bar, and query_heatmap. These IDs are distinct from raw
textcharts_* primitive MCP tools. BenchBox does not register or proxy the
external textcharts-mcp server; if a client configures that server separately,
its tools remain a separate raw rendering namespace.
suggest_charts¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Comma-separated result filenames. |
generate_chart¶
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Comma-separated result filenames. |
|
string |
No |
|
Chart type for single-chart output. |
|
string or null |
No |
|
Template name for multi-chart output. |
|
string or null |
No |
|
Output directory relative to charts dir. |
|
string |
No |
|
Output format; current MCP output is ASCII. |
Available chart_type values and template names are derived from the
visualization registries and are discoverable with list_available(category="charts").
Prompts¶
Prompts are reusable templates for AI analysis. Invoke via slash commands in Claude Code.
analyze_results¶
Analyze benchmark results and identify performance patterns.
Arguments (positional):
benchmark(default: “tpch”)platform(default: “duckdb”)focus(optional): Focus area like ‘slowest_queries’, ‘memory’, ‘io’
Usage:
/mcp__benchbox__analyze_results tpch duckdb slowest_queries
compare_platforms¶
Compare benchmark performance across multiple platforms.
Arguments (positional):
benchmark(default: “tpch”)platforms(default: “duckdb,polars-df”): Comma-separated platform namesscale_factor(default: 0.01)
Usage:
/mcp__benchbox__compare_platforms tpch "duckdb,polars-df,sqlite" 0.1
identify_regressions¶
Identify performance regressions between benchmark runs.
Arguments (positional):
baseline_run(optional): Baseline result filecomparison_run(optional): Comparison result filethreshold_percent(default: 10.0)
Usage:
/mcp__benchbox__identify_regressions run1.json run2.json 5
benchmark_planning¶
Help plan a benchmark strategy for a specific use case.
Arguments (positional):
use_case(default: “testing”): One of ‘testing’, ‘production’, ‘comparison’, ‘regression’platforms(optional): Comma-separated platform listtime_budget_minutes(default: 30)
Usage:
/mcp__benchbox__benchmark_planning comparison "duckdb,snowflake" 60
troubleshoot_failure¶
Diagnose and resolve benchmark failures.
Arguments (positional):
error_message(optional): Error message from failed runplatform(optional): Platform where failure occurredbenchmark(optional): Benchmark that failed
Usage:
/mcp__benchbox__troubleshoot_failure "Connection refused" snowflake tpch
benchmark_run¶
Execute a planned benchmark with validation and dependency checks.
Arguments (positional):
platform(default: “duckdb”): Target platformbenchmark(default: “tpch”): Benchmark to runscale_factor(default: 0.01): Data scale factorqueries(optional): Query subset (e.g., “1,5,10”)
Usage:
/mcp__benchbox__benchmark_run duckdb tpch 0.1
/mcp__benchbox__benchmark_run snowflake tpcds 1 "1,5,10"
This prompt:
Validates the configuration
Checks dependencies
Runs the benchmark
Provides execution summary and recommendations
platform_tuning¶
Get tuning recommendations for a specific platform.
Arguments (positional):
platform(default: “duckdb”): Platform to tuneworkload(optional): Workload characteristics description
Usage:
/mcp__benchbox__platform_tuning duckdb
/mcp__benchbox__platform_tuning snowflake "heavy aggregation workload"
This prompt provides:
Memory configuration recommendations
Parallelism settings
I/O optimization
Platform-specific tuning parameters
Resources¶
Resources provide read-only access to BenchBox data. Currently, resources are accessed indirectly through tools.
Error Handling¶
All tools return structured error information:
{
"error": "Description of the error",
"error_type": "ExceptionClassName",
"suggestion": "How to resolve the issue"
}
Common error types:
ConfigurationError: Invalid platform or benchmark configuration
DependencyError: Missing required dependencies
FileNotFoundError: Result file not found