DX-115085: MCP server hardening — auth, validation, annotations, and smoketests#86
Merged
Merged
Conversation
…smoketests Critical fixes: - Add @secured and @with_metrics decorators to GetDescriptionOfTableOrSchema so OAuth tokens are properly injected - Add input validation to GetSchemaOfTable for empty string/list inputs - Add MCP ToolAnnotations (readOnlyHint/destructiveHint) to all tools; RunSqlQuery destructiveHint is conditional on allow_dml setting Medium fixes: - Sanitize error message in DremioAsyncHttpClient to not leak URI/PAT - Wrap GetTableOrViewLineage in try/except with sanitized error response - Return clean error dict for DML rejection in RunSqlQuery - Rename RunSqlQuery parameter from 's' to 'query' for clarity - Update GetSchemaOfTable docstring with explicit format examples - Expand GetUsefulSystemTableNames from 1 to 6 entries (jobs_recent, engines, users, COLUMNS, VIEWS) Smoketest improvements: - Add 11 smoketest cases to stremable_http_cli.py covering all fixes - Add --token, --local, --check-annotations, --check-new-contract flags - Add _local_mcp_server context manager with ContextVar propagation to server thread via settings.with_overrides()
Contributor
Author
|
Doing a full test run against Dremio cloud - |
ktsunoda
approved these changes
Feb 23, 2026
tevin831
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@securedand@with_metricsdecorators so OAuth tokens are injectedIndexErrorreadOnlyHint/destructiveHint;RunSqlQuery.destructiveHintis conditional on theallow_dmlsettingDremioAsyncHttpClientno longer leaks URI/PAT in errors;GetTableOrViewLineagereturns a sanitized error dict on failure;RunSqlQueryreturns a clean error for DML rejections→queryfor clarityjobs_recent,engines,users,COLUMNS,VIEWS)stremable_http_cli.pycovering all fixes, with--token,--local,--check-annotations,--check-new-contractflagsmodel_copy().with_overrides()so the correct Dremio URI is usedTest plan
uv run python tests/stremable_http_cli.py cli test --token <TOKEN> --url <MCP_URL> --no-check-annotations --no-check-new-contractuv run python tests/stremable_http_cli.py cli test --token <TOKEN> --url <MCP_URL> --local