Repository navigation
fix(mcp)!: decouple external access, fix read-only mode, add X-MCP-Allow-Destructive-Tools, generic unsupported-input guard #1360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aaron ("AJ") Steers (aaronsteers)
merged 13 commits into
release-candidate/v1
from
devin/1791835169-mcp-external-access-orthogonal
Oct 12, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f99e071
fix(mcp): make external-access policy independent of pipeline-change …
devin-ai-integration[bot] 0b70c2c
test(mcp): drop legacy wording from read-only test id
devin-ai-integration[bot] e362a4e
docs(mcp): simplify external_access_allowed docstring
devin-ai-integration[bot] 4096d4b
ci(mcp): retrigger cloud integration tests after transient 502
devin-ai-integration[bot] 62f8730
docs(mcp): describe sync run/cancel under pipeline-change and read-on…
devin-ai-integration[bot] a31a767
docs(mcp): reorder read-only and sync run/cancel wording
devin-ai-integration[bot] 30b6451
fix(mcp): make Airbyte read-only mode hide non-read-only tools
devin-ai-integration[bot] 5d66dd9
feat(mcp): add X-MCP-Allow-Destructive-Tools policy
devin-ai-integration[bot] 462d5d5
refactor(mcp): generic map-driven guard for unsupported env vars and …
devin-ai-integration[bot] f09f8f3
refactor: move unsupported env-var guard out of MCP and run it for th…
devin-ai-integration[bot] ea7f722
fix(mcp): scope read-only and destructive policies to Cloud tools; fi…
devin-ai-integration[bot] d84f042
fix(mcp): scope pipeline-change policy to Cloud tools
devin-ai-integration[bot] 8758a36
fix(cli): run unsupported env-var check via cyclopts config hook
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
| """Startup guards for removed PyAirbyte environment variables.""" | ||
|
|
||
| import os | ||
|
|
||
| from airbyte.constants import CLOUD_MCP_SAFE_MODE_ENV_VAR | ||
| from airbyte.exceptions import AirbyteLibInputError | ||
|
|
||
|
|
||
| UNSUPPORTED_ENV_VARS: dict[str, str] = { | ||
| CLOUD_MCP_SAFE_MODE_ENV_VAR: ( | ||
| "Remove `AIRBYTE_CLOUD_MCP_SAFE_MODE` and consider using one of these " | ||
| "alternatives:\n" | ||
| "- `AIRBYTE_CLOUD_MCP_ALLOW_PIPELINE_CHANGES=0`: block changes to " | ||
| "sources, destinations, and connections.\n" | ||
| "- `AIRBYTE_CLOUD_MCP_ALLOW_EXTERNAL_ACCESS=0`: block SQL and API " | ||
| "passthrough tools.\n" | ||
| "- `AIRBYTE_CLOUD_MCP_READONLY_MODE=1`: only expose read-only tools.\n" | ||
| "- `AIRBYTE_CLOUD_MCP_ALLOW_DESTRUCTIVE_TOOLS=0`: hide destructive tools.\n" | ||
| "- `AIRBYTE_CLOUD_MCP_LOCAL_DEMO_MODE=1`: only allow changes to " | ||
| "resources created in this session (local mode only; not recommended " | ||
| "except for demos).\n" | ||
| ), | ||
| } | ||
| """Removed PyAirbyte environment variables, mapped to replacement guidance. | ||
|
|
||
| Checked at startup of the `pyab` CLI and both MCP servers. Startup fails if any | ||
| listed name is set. | ||
| """ | ||
|
|
||
|
|
||
| def check_unsupported_env_vars() -> None: | ||
| """Fail fast if a removed PyAirbyte env var is set. | ||
|
|
||
| Raises `AirbyteLibInputError` on the first name in `UNSUPPORTED_ENV_VARS` | ||
| present in the environment with any value, including an empty string. | ||
| """ | ||
| for name, guidance in UNSUPPORTED_ENV_VARS.items(): | ||
| if name in os.environ: | ||
| raise AirbyteLibInputError( | ||
| message=f"`{name}` is no longer supported.", | ||
| guidance=guidance, | ||
| ) |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.