fix(cli): support duckdb_external_access opt-in in recce mcp-server#1464
Merged
kentwelcome merged 3 commits intoJul 15, 2026
Conversation
recce mcp-server always ran DuckDB with enable_external_access=false and offered no way to opt in, unlike recce server. On a local dbt/duckdb project whose sources use external_location read_csv(...) and whose staging models are views, any row_count_diff/profile_diff touching a VIEW failed with "Scanning CSV files is disabled through configuration". exceptions.py points users at duckdb_external_access: true in recce.yml, but mcp-server ignored that key. Resolve the setting in mcp_server identically to server: add the --duckdb-external-access flag and merge it with the recce.yml key (flag OR config). Default stays False, so safe-by-default behavior and security parity with recce server are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
…C-3890)
The three mcp-server resolution tests patch recce.mcp_server.run_mcp_server,
which requires the optional mcp extra. The Test Python Versions CI job
installs recce without that extra, so recce.mcp_server is not importable and
patch() fails at setup with "module 'recce' has no attribute 'mcp_server'".
Guard those three with skipif(find_spec("mcp") is None). The three --help
tests need no mcp and keep running in that job. Verified both ways: mcp
present -> 6 pass; mcp absent (simulated) -> 3 pass, 3 skip.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ckdb_external_access-opt-in
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.
PR checklist
What type of PR is this?
fix
What this PR does / why we need it:
recce mcp-serveralways ran DuckDB withenable_external_access=falseand offered no way to turn it on, unlikerecce server. On a local dbt/duckdb project whose sources useexternal_location: read_csv(...)and whose staging models are views, anyrow_count_diff/profile_difftouching a VIEW model failed withPermission Error: Scanning CSV files is disabled through configuration.recce/exceptions.pytells users to setduckdb_external_access: truein recce.yml, but mcp-server ignored that key, so the hint was misleading.This makes mcp-server resolve the setting identically to
server: the--duckdb-external-accessflag, OR theduckdb_external_accesskey in recce.yml. Default stays blocked (opt-in only).Which issue(s) this PR fixes:
Fixes DRC-3890
Special notes for your reviewer:
False(blocked) by design:recce mcp-server --sseis HTTP-exposed, so this is a security boundary. Production (recce-cloud-infra'srecce_instance_launcher) runs it with no opt-in, so prod behavior is unchanged; enabling it there is a separate infra decision.--duckdb-external-accessoption block and merge line are duplicated verbatim fromserverfor exact parity; factoring into a shared list would also touchserver, out of scope here.Does this PR introduce a user-facing change?:
Yes.
recce mcp-servernow accepts--duckdb-external-accessand honorsduckdb_external_access: truein recce.yml, matchingrecce server. Default is unchanged (external access blocked).