Repository navigation
feat(mcp)!: replace Cloud MCP session "safe mode" with opt-in STDIO "local demo mode" - #1359
Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791825520-remove-mcp-safe-mode' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791825520-remove-mcp-safe-mode'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
There was a problem hiding this comment.
🔵 Needs a closer look
Removing a default safety boundary is an intentional breaking behavior change that warrants final human validation despite no concrete implementation defects found.
0 open findings
What changed in this PR
Removes Cloud MCP’s session-based safe mode so agents can modify existing resources, while retaining policy controls and name-based deletion guards.
Changes:
- Removes safe-mode configuration, GUID tracking, and related errors.
- Updates external-access defaults, safety guidance, and documentation.
- Revises tests for the new policy behavior.
| File | Description |
|---|---|
.github/mcp-ci-tests.mcp.json |
Removes the safe-mode environment setting. |
airbyte/constants.py |
Removes the safe-mode constant. |
airbyte/exceptions.py |
Removes the safe-mode exception and guidance. |
airbyte/mcp/__init__.py |
Updates MCP safety documentation. |
airbyte/mcp/_error_handling.py |
Removes safe-mode error handling. |
airbyte/mcp/_tool_utils.py |
Removes GUID tracking and changes external-access defaults. |
airbyte/mcp/cloud.py |
Allows operations on resources from prior sessions. |
airbyte/mcp/server.py |
Replaces safe-mode guidance with deletion-guard guidance. |
docs/CONTRIBUTING.md |
Removes obsolete safe-mode configuration. |
tests/unit_tests/test_deferred_cloud_credentials.py |
Updates deferred-deployment error tests. |
tests/unit_tests/test_mcp_cloud.py |
Removes session-registration test setup and assertions. |
tests/unit_tests/test_mcp_connection_schedules.py |
Removes safe-mode schedule tests. |
tests/unit_tests/test_mcp_datadog.py |
Removes safe-mode telemetry coverage. |
tests/unit_tests/test_mcp_http_main.py |
Updates hosted instruction assertions. |
tests/unit_tests/test_mcp_policy_middleware.py |
Updates policy middleware cases. |
tests/unit_tests/test_mcp_tool_errors.py |
Preserves error-masking coverage with a supported error. |
tests/unit_tests/test_mcp_tool_filters.py |
Updates external-access filter cases. |
tests/unit_tests/test_mcp_tool_utils.py |
Removes GUID-tracking tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit 8e5943f in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit 8e5943f in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit 8e5943f in the Show a line coverage summary of the most covered files.
Updated |
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
Please add a config guard. If users explicitly pass safe mode as an input header arg or env var, then hard-fail with a message the explains the new correct options. Only present the options relevant to the env var. For hosted mode (header inputs), give only the viable inputs with no mention of demo mode. for local mode, give the suggested alternatives, followed lastly by the demo mode option (not recommended except for demos). |
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
Aaron ("AJ") Steers (@aaronsteers) Added the config guard in a2fbf8c:
Both raise |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
aa84fe6
into
release-candidate/v1
Overview
👉 TL;DR: Cloud MCP no longer blocks agents from changing or deleting resources they didn't create in the current session. That session tracking survives only as an opt-in "local demo mode" for STDIO.
The old default-on
AIRBYTE_CLOUD_MCP_SAFE_MODEblocked users from enabling connections and editing streams. It's removed, and setting it, or sending anX-MCP-Safe-Modeheader, now hard-fails with guidance on the replacement options. The same tracking is now gated behindAIRBYTE_CLOUD_MCP_LOCAL_DEMO_MODE=1. It's off by default, and the hosted HTTP transport ignores it. Thedelete-me/deletemedeletion guard and the explicit policy controls are unchanged and always on.Pairs with airbytehq/airbyte#88481 (hosted advanced-configuration docs):
Changes
airbyte/mcp/_tool_utils.py:local_demo_mode_enabled(), which reads the env var at call time:check_guid_created_in_session()raises only when that is true. Registration always happens. Renames stay unguarded, as on base.external_access_allowed()now falls back only on pipeline-change denial:AirbyteLibInputError(unmasked):check_if_demo_mode_guards()runs at startup inserver.main()andhttp_main.main()and fails ifAIRBYTE_CLOUD_MCP_SAFE_MODEis set to any value. Its guidance lists the env-var alternatives, with demo mode last and only for STDIO.check_legacy_safe_mode_header()is called fromPolicyGuardMiddleware.on_call_tooland a newon_list_tools, and fails ifX-MCP-Safe-Modeis present. Its guidance lists only the header alternatives.airbyte/constants.py:MCP_LOCAL_DEMO_MODE_ENV_VAR(AIRBYTE_CLOUD_MCP_LOCAL_DEMO_MODE).MCP_LEGACY_SAFE_MODE_HEADER(X-MCP-Safe-Mode).CLOUD_MCP_SAFE_MODE_ENV_VAR, used only by the guard.airbyte/exceptions.py,airbyte/mcp/_error_handling.py: replacesAirbyteSafeModeErrorwithAirbyteLocalDemoModeError(user-facing) and drops the safe-mode sentence fromAirbyteExternalAccessDisabledError.guidance.airbyte/mcp/cloud.py: the register/check call sites are unchanged from base.airbyte/mcp/server.py: the instructions now describe the deletion guard in place of safe mode.airbyte/mcp/__init__.py: new short "Local Demo Mode" section. Safe-mode docs are removed here, indocs/CONTRIBUTING.md, and in.github/mcp-ci-tests.mcp.json.Review Spotlight
Reviewers with limited time, please review first:
local_demo_mode_enabled,check_guid_created_in_session,check_if_demo_mode_guards,check_legacy_safe_mode_header, and the newexternal_access_alloweddefault)Risks
delete-me/deletemein the resource name:safe_mode=Trueon theapi_util/CloudWorkspacedelete paths is unchanged.AIRBYTE_CLOUD_MCP_SAFE_MODEwill refuse to start after upgrading. Known instance: coral-agentsscripts/start_mcp_server.pycallssetdefault("AIRBYTE_CLOUD_MCP_SAFE_MODE", "1"). The hosted deploy configs in this org don't set it, but live Cloud Run env vars weren't checked.Follow-ups
AIRBYTE_CLOUD_MCP_SAFE_MODEsetdefaultfrom coral-agentsscripts/start_mcp_server.pybefore it picks up this RC.Link to Devin session: https://app.devin.ai/sessions/5dd86f59bf0e4c0ea97d21c1111a8f8c
Open in Devin Desktop: https://app.devin.ai/desktop/session/5dd86f59bf0e4c0ea97d21c1111a8f8c?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)