Skip to content

Commit b3c538b

Browse files
feat: Set AIRBYTE_CLOUD_MCP_SAFE_MODE default to 1 (#845)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent fed8d94 commit b3c538b

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

airbyte/mcp/__init__.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
],
8787
"env": {
8888
"AIRBYTE_MCP_ENV_FILE": "/path/to/my/.mcp/airbyte_mcp.env",
89-
"AIRBYTE_CLOUD_MCP_READONLY_MODE": "0",
90-
"AIRBYTE_CLOUD_MCP_SAFE_MODE": "0"
89+
"AIRBYTE_CLOUD_MCP_SAFE_MODE": "1",
90+
"AIRBYTE_CLOUD_MCP_READONLY_MODE": "0"
9191
}
9292
}
9393
}
@@ -97,15 +97,6 @@
9797
Note:
9898
- Replace `/path/to/my/.mcp/airbyte_mcp.env` with the absolute path to your dotenv file created in
9999
Step 1.
100-
- The `AIRBYTE_CLOUD_MCP_READONLY_MODE` and `AIRBYTE_CLOUD_MCP_SAFE_MODE` environment variables
101-
control safe mode filtering for Airbyte Cloud operations:
102-
- `AIRBYTE_CLOUD_MCP_READONLY_MODE=1`: Only read-only Cloud tools are available. Write and
103-
destructive operations are disabled. Note: This mode does allow running syncs on existing
104-
connectors.
105-
- `AIRBYTE_CLOUD_MCP_SAFE_MODE=1`: Write operations are allowed, but destructive operations
106-
(update, delete) are disabled.
107-
- Both default to `0` (disabled), which means no restrictions are applied.
108-
- These settings only affect Cloud operations; local operations are never restricted.
109100
110101
### Step 3: Testing the MCP Server Connection
111102
@@ -120,6 +111,39 @@
120111
4. "Use your MCP tools to check your connection to your Airbyte Cloud workspace."
121112
5. "Use your MCP tools to list all available destinations in my Airbyte Cloud workspace."
122113
114+
## Airbyte Cloud MCP Server Safety
115+
116+
The PyAirbyte MCP server supports environment variables to control safety and access levels for
117+
Airbyte Cloud operations.
118+
119+
**Important:** The below settings only affect Cloud operations; local operations are not affected.
120+
121+
### Airbyte Cloud Safe Mode
122+
123+
Safe mode is enabled by default and is controlled by the `AIRBYTE_CLOUD_MCP_SAFE_MODE` environment
124+
variable.
125+
126+
When enabled, write operations are allowed but destructive operations (updates, deletions) are
127+
only allowed for objects created within the same session. For example, you can create a new
128+
connector and then delete it, but you cannot delete an existing connector that was not created in
129+
the current session. Modifications to configurations are likewise treated as potentially destructive
130+
and are only allowed for objects created in the current session.
131+
132+
Set the environment variable `AIRBYTE_CLOUD_MCP_SAFE_MODE=0` to disable safe mode.
133+
134+
### Airbyte Cloud Read-Only Mode
135+
136+
Read-only mode is not enabled by default and is controlled by the
137+
`AIRBYTE_CLOUD_MCP_READONLY_MODE` environment variable.
138+
139+
When enabled, only read-only Cloud tools are available. Write and destructive operations are
140+
disabled.
141+
142+
This mode does allow running syncs on existing connectors, since sync operations
143+
are not considered to be modifications of the Airbyte Cloud workspace.
144+
145+
Set the environment variable `AIRBYTE_CLOUD_MCP_READONLY_MODE=1` to enable read-only mode.
146+
123147
## Contributing to the Airbyte MCP Server
124148
125149
- [PyAirbyte Contributing Guide](https://github.com/airbytehq/PyAirbyte/blob/main/docs/CONTRIBUTING.md)

airbyte/mcp/_tool_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
AIRBYTE_CLOUD_MCP_READONLY_MODE = (
2525
os.environ.get("AIRBYTE_CLOUD_MCP_READONLY_MODE", "").strip() == "1"
2626
)
27-
AIRBYTE_CLOUD_MCP_SAFE_MODE = os.environ.get("AIRBYTE_CLOUD_MCP_SAFE_MODE", "").strip() == "1"
27+
AIRBYTE_CLOUD_MCP_SAFE_MODE = os.environ.get("AIRBYTE_CLOUD_MCP_SAFE_MODE", "1").strip() != "0"
2828

2929
_REGISTERED_TOOLS: list[tuple[Callable[..., Any], dict[str, Any]]] = []
3030
_GUIDS_CREATED_IN_SESSION: set[str] = set()

0 commit comments

Comments
 (0)